Chapter 02 โ Architecture Overview
2.1 System Architecture Diagramโ
The complete 9-node data flow of the AFP system. Each node is a distinct LangGraph processing unit with defined state inputs, outputs, and conditional routing edges. Diamond shapes represent decision nodes (Classifier/Router, Hallucination Guard); all other shapes represent action nodes.
Node 0: User Input
Node 1: Intent & ReAct Router
greeting abusive vague legal/finance ReAct / OOS
Node 2: Greeting & Small Talk
Node 3: Abusive / Reject Query
Node 4: Cross- Questioning (LLM)
Node 5: Pinecone Retrieval (MRL 256d)
Node 6: Web Search (Tavily)
retrieved context
Generation & Guardrails
Node 7: LLM Generation
Node 8: Halluc. Guard
grounded โ
not grounded
Node 9: ReAct Fallback Prompt
Final Output Grounded ยท Cited ยท Safe (Nodes 2, 3, 4, 7, 9 converge here)
Figure 1 โ AFP v2.0: 9-Node Agentic LangGraph Architecture. Node 0 (User Input) โ Node 1 (Intent & ReAct Router) โ conditional dispatch to Nodes 2โ6 โ Generation & Guardrails (Nodes 7โ9) โ Final Output. Real-time web search (Node 6) is reached either directly for out-of-scope queries or via Human-in-the-Loop authorization when retrieval confidence is low.
2.2 Data Flow Summaryโ
| Step | Node(s) | Action |
|---|---|---|
| User query enters system | Node 0 | Single entry point. LangGraph state initialized. |
| Intent classification | Node 1 | 5-way routing: greeting / abusive / vague / legal-finance / ReAct-OOS |
| Trivial query handling | Nodes 2 & 3 | Greeting or abusive โ resolved immediately, no vector DB hit. |
| Vague query clarification | Node 4 | LLM asks follow-up questions. Max 2 rounds before forced retrieval. |
| Semantic retrieval | Node 5 | Pinecone Serverless. Jina v3 MRL 256d. Confidence score computed. |
| Web search fallback | Node 6 | Tavily API. Activated for OOS queries or HITL-authorized <45% confidence. |
| Answer generation | Node 7 | Context-bound LLM synthesis. Professional formatting enforced. |
| Hallucination verification | Node 8 | LLM-as-judge. Grounded โ output. Not grounded โ Node 9. |
| Grounding retry | Node 9 | ReAct Fallback Prompt. Reformulates and retries generation. |
| Final output | All paths | Grounded ยท Cited ยท Safe. Convergence for Nodes 2, 3, 4, 7, 9. |
Agentic Financial Parser v2.0 โ Technical DocumentationPage 3