AI Agent Build Blueprint (Start Building in 60 Seconds)
For AI Agents (Claude, Cursor, GitHub Copilot, Codex, Custom Agents) & Builders: This page contains everything an AI agent needs to connect to Purple8 Hyper Graph (
v0.72.0), choose the right tool profile, model schemas, ingest data, run hybrid GraphRAG, orchestrate stateful workflows with SLAs and Human-In-The-Loop (HITL) approvals, and compare Purple8 against legacy multi-service stacks.Machine-readable summary:
/llms.txt
1. Connect Your AI Agent (Streamable HTTP & SSE)
Purple8 runs an in-process MCP server at /mcp (Streamable HTTP) and /mcp/sse (SSE). Both endpoints accept:
- Standard API Keys (
p8g_...) viaX-API-KeyorAuthorization: Bearer - Session JWTs
- Cloud Sandbox Keys (auto-provisioned into an isolated tenant on first request)
Focused MCP Tool Profiles (?profile=)
Instead of loading all 176 tools into your agent's context window at once, pass ?profile= on the MCP URL:
| Profile | URL Suffix | Tools | When to Use |
|---|---|---|---|
starter | /mcp?profile=starter | 28 | Recommended default. Schema modeling, Unified LPG + RDF graph CRUD/queries, hybrid search, structured table & Markdown commit, and Journey workflows + HITL. 6× smaller prompt footprint. |
builder | /mcp?profile=builder | 117 | Full application building: Starter + full graph.*, schema.*, data.* tables, memory.*, models.*, egress.*, scheduler.*, feedback.*, registry.*. |
ops | /mcp?profile=ops | 37 | Operations & governance: journey.*, sentinel.*, guardrails.*, feedback.*, admin.*. |
full | /mcp (or ?profile=full) | 176 | All 19 namespaces including aec.*, soc.*, supergraph.*, quantum.*, and evolution.*. |
Copy-Paste Client Snippets
claude mcp add --transport http purple8 "https://<your-host>/mcp?profile=starter" \
--header "X-API-Key: <your-api-or-sandbox-key>"{
"mcpServers": {
"purple8-graph": {
"url": "https://<your-host>/mcp?profile=starter",
"headers": {
"X-API-Key": "<your-api-or-sandbox-key>"
}
}
}
}{
"servers": {
"purple8-graph": {
"type": "http",
"url": "https://<your-host>/mcp?profile=starter",
"headers": {
"X-API-Key": "<your-api-or-sandbox-key>"
}
}
}
}{
"mcpServers": {
"purple8-graph": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://<your-host>/mcp?profile=starter",
"--header",
"X-API-Key:${P8_KEY}"
],
"env": {
"P8_KEY": "<your-api-or-sandbox-key>"
}
}
}
}2. End-to-End Agent Playbook: Configure a Complete SOTA Backend
With Purple8, you (the AI agent) are the backend developer and reasoning engine. Purple8 provides the entire software infrastructure in one process (replacing PostgreSQL, Neo4j, Stardog/RDF, Pinecone, LangChain/RAG, Temporal/Airflow, Kafka/CDC, Svix/Webhooks, Auth0/KMS, and SIEM/Compliance).
Zero Server-Side LLM or DocIntel Required to Build & Operate
When connected via MCP, your own agent LLM provides the intelligence. You can build schemas, write Unified LPG + RDF graphs, commit structured tables and Markdown chunks, run hybrid vector + graph retrieval, orchestrate SLA/HITL workflows, and enforce legal holds and cryptographic audit chains with zero server-side LLM keys and zero DocIntel configuration.
Step 1 — Define the Data Model (schema.*)
// Tool: schema.define_node_type
{
"type_name": "Borrower",
"description": "Commercial loan applicant",
"data_classification": "restricted",
"properties": {
"name": { "type": "string", "required": true },
"jurisdiction": { "type": "string", "required": true },
"requested_usd": { "type": "number" }
},
"immutable_properties": ["jurisdiction"]
}Step 2 — Unify Operational LPG + Semantic RDF on a Single Instance (graph.*)
The database industry is split between Property Graphs (LPG) for operational state and RDF Triples/Quads for formal ontologies and regulatory rules. Purple8 runs both natively on the same engine and joins them in a single query via iri_properties:
// 1. Operational LPG Node (Tool: graph.add_node — note parameter is "type" string, not "labels" list)
{
"node_id": "borrower:horizon-9001",
"type": "Borrower",
"properties": {
"name": "Horizon Logistics LLC",
"jurisdiction": "UK",
"requested_usd": 450000
}
}// 2. Counterparty LPG Node with an IRI Bridge Property (Tool: graph.add_node)
{
"node_id": "entity:titanium-cloud",
"type": "RelatedEntity",
"properties": {
"name": "Titanium Cloud Ltd",
"jurisdiction": "BVI",
"jurisdiction_iri": "urn:fibo:jurisdiction:VG"
}
}// 3. Operational LPG Edge (Tool: graph.add_edge)
{
"source_id": "borrower:horizon-9001",
"target_id": "entity:titanium-cloud",
"edge_type": "PARTNER_OF",
"properties": { "relationship": "shared-director-ubo" }
}// 4. Canonical RDF Regulatory Ontology Quad (Tool: graph.assert_statement)
{
"statement": {
"subject": { "kind": "iri", "value": "urn:fibo:jurisdiction:VG" },
"predicate": { "kind": "iri", "value": "urn:aml:mandatesControl" },
"object": { "kind": "literal", "value": "Enhanced Due Diligence (EDD) + Senior Underwriter HITL Gate" },
"graph": { "kind": "iri", "value": "urn:graph:fatf-aml-ontology-2026" }
}
}// 5. Single Conjunctive Query Joining LPG + RDF (Tool: graph.semantic_query)
{
"patterns": [
{ "model": "lpg_edge", "source": "borrower:horizon-9001", "target": { "name": "cp" }, "edge_type": "PARTNER_OF" },
{ "model": "lpg", "node_id": { "name": "cp" }, "label": "RelatedEntity", "iri_properties": { "jurisdiction_iri": { "name": "jur" } } },
{ "model": "rdf", "subject": { "name": "jur" }, "predicate": { "kind": "iri", "value": "urn:aml:mandatesControl" }, "object": { "name": "required_control" }, "graph": "any" }
]
}Step 3 — Commit Structured Tables & Markdown Directly OR Parse 70+ Formats via DocIntel (data.*)
Choose the ingestion path that matches what you are building:
- Path A — App-Generated / Agent-Extracted Data (
data.commit, No DocIntel Required): Commit entities, relationships, Markdown chunks, and structuredtablesdirectly into Hyper Graph. Passfile_bytes_b64so aFileanchor node is created automatically, and query structured rows withdata.get_table/data.query_table_rowsusing the returnedtable_id:
// Tool: data.query_table_rows
{
"table_id": "tbl_509e43396bbf5ba27b6153b5",
"where": { "AML_Status": "EDD_HITL_Required" }
}- Path B — Unstructured 70+ Format Document Parsing (
data.ingest_file/data.ingest_text, Requires Purple8 DocIntel): When parsing binary documents (PDF, DOCX, XLSX, PPTX, IFC/BIM, CAD, OCR images across 75+ languages),data.ingest_file/data.ingest_textforwards the document to Purple8 DocIntel (P8G_DOCINTEL_URL), which extracts entities, relationships, and tables and commits them into Hyper Graph.
Step 4 — Define & Start a Stateful Workflow with SLAs & HITL (journey.*)
// Tool: journey.define
{
"journey_type": "commercial_underwriting",
"description": "KYC -> Risk Assessment -> Underwriting HITL -> Disbursed",
"stages": [
{ "name": "submitted", "sla_warn_seconds": 1800, "sla_breach_seconds": 3600 },
{ "name": "kyc_verified", "sla_warn_seconds": 7200, "sla_breach_seconds": 86400 },
{ "name": "underwriting_review", "sla_warn_seconds": 86400, "sla_breach_seconds": 172800 },
{ "name": "approved" }
]
}// Tool: journey.start
{
"journey_type": "commercial_underwriting",
"entity_id": "borrower:horizon-9001"
}Step 5 — Hybrid Retrieval, Event Automation & Cryptographic Governance (graph.*, scheduler.*, egress.*, admin.*)
- Zero-LLM Agent Retrieval: Call
graph.hybrid_search(query_text="...", k=10),graph.vector_search(...),graph.traverse(...), orgraph.shortest_path(...)to retrieve fused vector + graph context in milliseconds without needing a server-side LLM. - Automation & Governance:
scheduler.add_trigger(...)— schedule interval/cron/event automations.egress.add_sink(...)— stream HMAC-signed CDC webhooks (event_types:node_added,stage_advanced,journey_completed, etc.).admin.hold_place(...)&admin.retention_set(match={"labels": ["LoanFacility"]}, retain_days=2555, action="archive")— enforce legal holds and retention policies.guardrails.evaluate(check_type="input", text="...")— scan payloads for prompt injection and PII.admin.audit_verify()— verify the cryptographic hash-chain across all AI and human actions.
Step 6 — Build the Frontend UI When Requested ("Frontend-Only" Application Pattern)
Because Purple8 is the complete backend (storage, Unified LPG + RDF graph, vector search, structured tables, workflows, HITL, RBAC, and audit), never write a custom backend API server (no Express, FastAPI, or ORM glue). When the user asks for a frontend UI:
- Generate the standalone, zero-dependency TypeScript client SDK:
p8 sdk ts --out src/lib/purple8.ts- Build the React / Next.js / Vite UI directly against
Purple8Client:
import { Purple8Client } from './lib/purple8';
const p8 = new Purple8Client({
baseUrl: import.meta.env.VITE_PURPLE8_URL,
apiKey: import.meta.env.VITE_PURPLE8_KEY,
});
// Query Unified LPG + RDF, structured tables, hybrid search, and HITL queues directly from the UI:
const results = await p8.hybridSearch('British Virgin Islands beneficial ownership', 10);
const flaggedRows = await p8.queryTableRows('tbl_509e43396bbf5ba27b6153b5', { AML_Status: 'EDD_HITL_Required' });
const hitlQueue = await p8.listHitlTasks('pending');Step 7 — Post-Build Runtime LLM & Model Router Configuration (models.* & rag.*)
Once the application backend and frontend are built, customers configure their preferred LLM provider (OpenAI, Anthropic, Google/Vertex, AWS Bedrock, Azure OpenAI, Mistral, Cohere, xAI, or local Ollama/vLLM via /dashboard/ai or PUT /ai/config) or configure Purple8's dynamic Model Router over MCP to power runtime AI in POC and production:
// 1. Register models across cost/capability tiers (Tool: models.upsert)
{
"model": "openai/gpt-5.4-mini",
"tier": "small",
"strengths": ["rag_answer", "extract", "classify"]
}// 2. Dry-run explain how the router selects a model for a given task (Tool: models.route_explain)
{
"task_type": "rag_answer",
"input_tokens": 4000,
"high_stakes": false
}// 3. Auto-profile & run server-side Hybrid GraphRAG in POC/production (Tools: rag.profile_collection -> rag.hybrid_query)
{
"question": "Which entities are connected to Horizon Logistics LLC and what is their underwriting status?",
"mode": "balanced",
"max_hops": 2,
"seed_k": 10
}3. Tool Selection Cheat Sheet for Agents
| Goal | Exact MCP Tool to Call |
|---|---|
| Define & validate graph schema | schema.define_node_type, schema.define_edge_type, schema.validate |
| Unify LPG operational nodes + RDF ontology quads | graph.add_node (iri_properties) + graph.assert_statement → graph.semantic_query |
| Zero-LLM hybrid vector + graph search (for MCP agents) | graph.hybrid_search, graph.vector_search, graph.traverse, graph.shortest_path |
Server-side LLM RAG Q&A (when models.* is configured) | rag.profile_collection → rag.hybrid_query, rag.query |
| Commit entities, Markdown chunks & tables directly (no DocIntel) | data.commit |
Query structured tables (table_id from data.commit) | data.get_table → data.query_table_rows |
| Link structured table columns to graph nodes | data.link_table_rows |
| Parse & ingest a PDF/DOCX/XLSX/IFC by URL (via DocIntel) | data.ingest_file |
| Inspect all node labels and counts | graph.labels, graph.counts |
Run Cypher query (MATCH ... RETURN ...) | graph.query |
| Check if specific edges exist in bulk | graph.edges_exist |
| Find most influential nodes / clusters / QUBO optimum | graph.pagerank, graph.communities, graph.centrality, quantum.optimize |
| Wait for real-time graph mutations (long-poll) | graph.wait_for_changes, graph.poll_changes |
| Schedule a recurring or event-driven automation | scheduler.add_trigger |
| Stream graph changes to an external webhook | egress.add_sink |
| Place legal holds, set retention & verify hash-chained audit | admin.hold_place, admin.retention_set, admin.audit_verify |
| Federate an external REST API, MCP server, or A2A agent | registry.register_tool, registry.register_mcp_server, registry.register_a2a_agent |
| Evaluate text against safety/PII guardrails | guardrails.evaluate |
4. Architecture & Benchmark Comparison (Why Purple8)
| Dimension | Stitched Legacy AI Stack (8–12 Services) | Neo4j + Vector Plugin | Pinecone / Qdrant | Purple8 Hyper Graph (v0.72.0) |
|---|---|---|---|---|
| Processes to run | 8 to 12 separate clusters | JVM + external orchestrator | Vector slice only | 1 in-process engine (docker run) |
| Data models in one engine | Fragmented across silos | Property graph + bolt-on vector | Vectors only | Property + Hyper + Temporal Graph + Vector + Document + Full-Text |
| Network hops per RAG query | 6 to 14 hops | 2 to 4 hops | 2+ hops | 0 hops (in-process) |
| Memory scaling with data size $N$ | Unbounded $O(N)$ | JVM heap grows with $N$ | Index RAM grows with $N$ | Hardware-bounded Cortex memory (~9 GB peak on 8.84M docs) |
| Single-node verified scale | Requires multi-node cluster | High RAM overhead | Vector-only | 20M nodes + 30M edges (50M objects) on 1 node (~42.3 GB RAM) |
| Point lookup & 2-hop latency @ 20M | 5–50 ms over network | 10–150 ms | No graph walk | 52 µs P50 (1.26 ms P99) lookup · 0.38 ms P50 (0.87 ms P99) 2-hop |
| 6M-edge Super-Hub 2-hop walk | Timeouts / OOM | Seconds to minutes | N/A | 53.1 ms P50 (58.8 ms P99), 0 timeouts |
| Hardware-topology adaptation | Manual cluster tuning | Manual JVM tuning | Cloud tier sizing | Auto-adapts to NUMA, CPU sockets, AMX & NVIDIA B200/B300 GPUs |
| Stateful workflows, SLAs & HITL | Requires Airflow / Temporal / LangGraph | None | None | Built-in JourneyEngine |
| Native AI Governance & SOC | Post-hoc proxy wrappers | None | None | Pre-execution tool RBAC, human_only gates, Drift Sentinel, 4-tier SOC & hash-chained audit |
| AI Agent MCP Interface | DIY glue code | Read/query only | Read-mostly | 176 RBAC-governed MCP tools across 19 namespaces |