πΊοΈ Architecture Recap
This page summarizes the full end-to-end system design of the Agentic GraphRAG Digital Twin. It maps out how individual components interact to deliver high-speed, secure, and context-aware responses, serving as the outline for our portfolio deep-dive.
π End-to-End Execution Flowβ
When a user submits a query to the Digital Twin console, the request progresses through the following steps:
[User Interface]
β 1. Sends Query (Next.js client)
βΌ
[FastAPI Server]
β 2. Evaluates regex-based Security Guardrails
βΌ
[LangGraph Orchestrator] ββββ 3. Routes queries dynamically
ββββΊ [Pinecone DB] βββββββ 4. Fetches semantic vectors
ββββΊ [NetworkX Graph] ββββ 5. Traverses relationships
β
βΌ 6. Merges context & reflects on answer completeness
[Groq LLM Engine (Llama-3.3)]
β 7. Generates stream response tokens
βΌ
[FastAPI SSE Stream]
β 8. Transmits tokens as Server-Sent Events
βΌ
[Next.js Frontend]
β 9. Renders typing effect & highlights active graph nodes
π οΈ Key Architectural Pillarsβ
1. The Ingestion Engineβ
- Documents are split into overlapping chunks, embedded using
all-MiniLM-L6-v2, and index-stored in Pinecone. - Concurrently, key entities are extracted, resolved, and saved into a NetworkX directed graph to map connections.
2. The Stateful Router (LangGraph)β
- Instead of using a simple one-shot prompt, an active Agentic Loop runs.
- The router checks the query properties: it uses vector search for factual lookups, and graph traversals for system relations or dependency queries.
3. The Low-Latency Streaming Pipelineβ
- The backend utilizes FastAPI to stream responses using Server-Sent Events (SSE).
- High-speed computation is powered by Groq utilizing the Llama-3.3-70B model, yielding responses within milliseconds.
4. Zero-Dependency Visualizationβ
- The knowledge topology is rendered in real-time on an HTML5
<canvas>element using a custom physics solver. - Drag-and-drop actions, node scaling, and active path highlights are all handled natively.
5. Multi-Client Integration (MCP)β
- The entire system is packaged as an MCP Server, allowing tools to be queried standardly by other desktop agents (like Claude or Gemini).
π₯ Video Portfolio Script Outlineβ
Use this structural outline when recording the architecture walkthrough:
- The Hook (0:00 - 1:00): Quick demo of the streaming chat + canvas graph animation. Define what an "Agentic GraphRAG Twin" is.
- The Retrieval Setup (1:00 - 3:00): Screen share of the HuggingFace script and the Pinecone console. Discuss why vector search alone isn't enough.
- GraphRAG Under the Hood (3:00 - 6:00): Walkthrough of
sidebars.jsand code files demonstrating LangGraph routing decisions and NetworkX lookups. - Security & Streaming (6:00 - 8:00): Code review of the FastAPI SSE generator and regular-expression guardrails. Show how they block mock prompt injections.
- The MCP Value Pitch (8:00 - 10:00): Demonstrate hooking up the local python server to an external IDE agent to show true machine-to-machine tool execution.