System Architecture
How the 8-agent LangGraph state machine, Neo4j Project Knowledge Graph (PKG), and Hybrid GraphRAG coordinate.
High-Level Infrastructure Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Next.js 16 Web Dashboard │ React Native Expo App │
└──────────────────────────┬──────────────────────────────────────┘
│ HTTPS / JWT (Supabase JWKS)
▼
┌─────────────────────────────────────────────────────────────────┐
│ FastAPI Gateway · AST Cypher Sanitizer · Rate Limiter │
└────────────────┬─────────────────────────────┬──────────────────┘
│ │
┌────────────────┴──────────┐ ┌─────────────┴────────────────┐
│ LangGraph Agent Ensemble │ │ Persistence Layer │
│ 8 Agents · HITL Gate │ │ Neo4j · ChromaDB · Redis │
└───────────────────────────┘ └──────────────────────────────┘AST Cypher Security Sandbox
Because STRAND allows natural language queries to generate dynamic Neo4j Cypher statements, standard regex filtering is insufficient. STRAND parses all LLM-generated Cypher into an Abstract Syntax Tree (AST).
Blocks CREATE, MERGE, DELETE, SET on read routes.
Automatically injects tenant_id into MATCH clauses for isolation.
Blocks system procedures, file loads, and arbitrary code execution.
Hybrid GraphRAG (BM25 + Dense + Neo4j)
Brain Agent fuses lexical keyword matching (BM25) with semantic dense vector search (Chroma all-MiniLM-L6-v2) using Reciprocal Rank Fusion (RRF, k=60).
When retrieved chunks correspond to PKG entities with DERIVES_FROM lineage, STRAND traverses the 1-hop BIM graph neighborhood to answer questions about downstream equipment that pure vector RAG cannot find.
