Agentic retrieval
AgentRAG
A question takes the route it needs. Retrieval when it matters. Memory when it doesn’t.
Conversation can go straight to response
- Guard
- Plan
- Retrieve
- Rerank
- Respond
Conversation state persists in Postgres
The problem
A document assistant should distinguish a question that needs fresh evidence from a conversation that can use existing context. It also needs traceable retrieval, persistent conversation state and a way to assess answer quality.
The implementation
The planner reads the conversation and chooses direct response or retrieval. Technical queries pass through Qdrant search and Jina reranking before response generation. The graph is compiled with a Postgres checkpointer, with an in-memory fallback when persistence cannot initialize.
What it delivers
A complete document-question pipeline with conditional routing, source retrieval, reranking, guarded requests and durable conversation support.
Decisions inside the system.
Retrieval is a decision, not a default.
The planner marks conversation-only questions as CONVERSATIONAL. A conditional edge routes them directly to the responder; other queries visit the retriever first.
Rank evidence before generating an answer.
Qdrant supplies semantic matches and Jina reranks the retrieved material. The response is generated after this evidence-selection stage.
Keep state across application restarts.
Postgres checkpointing provides durable threads. Connectivity is checked before use; initialization failure falls back to MemorySaver, which does not persist across restarts.
Evaluation & scope
The RAGAS evaluation suite implements faithfulness, answer relevancy, context precision, context recall and answer correctness. It accepts populated responses and retrieved contexts from a golden dataset and supports rate-limited judge calls.
The repository contains evaluation code and datasets. No aggregate benchmark score is claimed here; external-service evaluation was not executed during the portfolio review.
Inspect the evidence
Full project overview
An enterprise document assistant with a LangGraph planner, retriever and responder. FastAPI serves the API; Qdrant and Jina provide embedding search and reranking; Portkey routes model calls. NeMo Guardrails checks requests, Postgres persists conversation checkpoints, and Logfire, LangSmith and RAGAS support observation and evaluation.
Cold-chain intelligence
Operational AI agents