Skip to main content

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โ€‹

StepNode(s)Action
User query enters systemNode 0Single entry point. LangGraph state initialized.
Intent classificationNode 15-way routing: greeting / abusive / vague / legal-finance / ReAct-OOS
Trivial query handlingNodes 2 & 3Greeting or abusive โ€” resolved immediately, no vector DB hit.
Vague query clarificationNode 4LLM asks follow-up questions. Max 2 rounds before forced retrieval.
Semantic retrievalNode 5Pinecone Serverless. Jina v3 MRL 256d. Confidence score computed.
Web search fallbackNode 6Tavily API. Activated for OOS queries or HITL-authorized <45% confidence.
Answer generationNode 7Context-bound LLM synthesis. Professional formatting enforced.
Hallucination verificationNode 8LLM-as-judge. Grounded โ†’ output. Not grounded โ†’ Node 9.
Grounding retryNode 9ReAct Fallback Prompt. Reformulates and retries generation.
Final outputAll pathsGrounded ยท Cited ยท Safe. Convergence for Nodes 2, 3, 4, 7, 9.

Agentic Financial Parser v2.0 โ€” Technical DocumentationPage 3