How aianytime/agentic-rag-with-fde-mindset works
This is a policy and contract intelligence application: users ask questions over a synthetic corpus of Medicaid agreements, Medicare guidance, and federal regulations. The agent plans constrained searches, retrieves and grades evidence, checks document coverage, synthesizes and verifies an answer, and can escalate rather than return an unsafe result. CLI and Streamlit provide user entry points; naive RAG and golden-set evaluation support comparison. Source excerpts are partial, so links for unsampled integrations are included only where the README documents them.
Main entry points: loop.py Agent Loop · cli.py CLI · baseline.py Naive RAG · llm.py Model Gateway
Components 19
User Experience
- CLI
agentic_rag/cli.py - Stakeholder UI
ui/app.py
Corpus Pipeline
- Policy Corpus
agentic_rag/corpus - Corpus Builder
agentic_rag/build_corpus.py - Clause Ingestion
agentic_rag/ingest.py - Qdrant Index
Agent Runtime
- Agent Loop
agentic_rag/loop.py - Tool Harness
agentic_rag/harness.py - Hybrid Retrieval
agentic_rag/retrieve.py - Naive RAG
agentic_rag/baseline.py - Model Gateway
agentic_rag/llm.py
Memory and Audit
- Conversation Memory
agentic_rag/memory.py - Run Observability
agentic_rag/observability.py - JSONL Ledger
Evaluation
- Golden Evaluations
agentic_rag/evals.py
Other components
- Questioner
- OpenAI-compatible API
- Phoenix Tracing
- Human Reviewer
Connections 31
- Questioner → CLI: asks via
- Questioner → Stakeholder UI: asks via
- CLI → Agent Loop: runs agent
- CLI → Naive RAG: runs baseline
- CLI → Clause Ingestion: starts ingest
- CLI → Golden Evaluations: runs evals
- Stakeholder UI → Agent Loop: asks agent
- Stakeholder UI → Naive RAG: runs baseline
- Corpus Builder → Policy Corpus: writes documents
- Clause Ingestion → Policy Corpus: reads documents
- Clause Ingestion → Model Gateway: requests embeddings
- Model Gateway → OpenAI-compatible API: calls model
- Clause Ingestion → Qdrant Index: writes chunks
- Agent Loop → Tool Harness: dispatches tools
- Agent Loop → Model Gateway: plans grades writes
- Agent Loop → Conversation Memory: uses context
- Tool Harness → Hybrid Retrieval: runs search
- Tool Harness → Qdrant Index: scans coverage
- Hybrid Retrieval → Model Gateway: embeds query
- Hybrid Retrieval → Qdrant Index: queries index
- Naive RAG → Hybrid Retrieval: gets top-k
- Naive RAG → Model Gateway: writes answer
- CLI → Conversation Memory: reads and updates
- Agent Loop → Run Observability: records run
- Naive RAG → Run Observability: records run
- Model Gateway → Run Observability: meters calls
- Run Observability → JSONL Ledger: writes records
- Run Observability → Phoenix Tracing: exports traces
- Golden Evaluations → Naive RAG: scores baseline
- Golden Evaluations → Agent Loop: scores agent
- Agent Loop → Human Reviewer: escalates cases