How sonali1554/envint-hybrid-rag works
Envint is a compliance question-answering and retrieval benchmark. A user submits a question and retrieval tier through the API; the retrieval engine loads policy chunks, searches and ranks them, then the answer layer applies evidence refusal, injection defense, and temporal-conflict handling before returning a cited response. The README also documents benchmarking, robustness checks, and request observability. Edges reflect shown source calls or README-described behavior; unsampled evaluation internals are represented without guessed connections.
Main entry points: engine.py Retrieval engine · main.py HTTP API · client.py Answer generation · schema.py Chunk and API schemas
Components 22
API and observability
- HTTP API
app/main.py - Browser UI
app/static/index.html - Request metrics
app/obs/middleware.py
Corpus and retrieval
- Policy corpus
data/corpus/corpus.json - Corpus loader
app/ingest.py - Retrieval engine
app/retrieval/engine.py - Vector search
app/retrieval/vector.py - Qdrant index
- BM25 search
app/retrieval/bm25.py - RRF fusion
app/retrieval/rrf.py - Cross-encoder reranker
app/retrieval/rerank.py
Grounded answering
- Answer generation
app/llm/client.py - Answer guardrails
app/llm/guardrails.py
Evaluation
- Tier benchmark
app/eval/benchmark.py - LLM robustness
app/eval/llm_robustness.py - Retrieval metrics
app/eval/metrics.py - Compute cost estimate
app/eval/cost.py
Shared foundations
- Embedding backends
app/embeddings.py - Chunk and API schemas
app/schema.py - Application settings
app/config.py
Other components
- Questioner
- Local Ollama
Connections 29
- Questioner → HTTP API: submits question
app/main.py - HTTP API → Browser UI: serves page
app/main.py - HTTP API → Retrieval engine: requests retrieval
app/main.py - HTTP API → Answer generation: requests answer
app/main.py - HTTP API → Request metrics: registers middleware
app/main.py - HTTP API → Chunk and API schemas: validates payloads
app/main.py - HTTP API → Application settings: reads settings
app/main.py - Retrieval engine → Corpus loader: loads corpus
app/retrieval/engine.py - Corpus loader → Policy corpus: reads records
app/ingest.py - Corpus loader → Chunk and API schemas: validates chunks
app/ingest.py - Retrieval engine → Vector search: indexes and searches
app/retrieval/engine.py - Retrieval engine → BM25 search: indexes and searches
app/retrieval/engine.py - Retrieval engine → RRF fusion: fuses ranked hits
app/retrieval/engine.py - Retrieval engine → Cross-encoder reranker: reranks candidates
app/retrieval/engine.py - Vector search → Qdrant index: reads and writes
app/retrieval/vector.py - Vector search → Embedding backends: encodes text
app/retrieval/vector.py - Vector search → Chunk and API schemas: uses chunk model
app/retrieval/vector.py - Retrieval engine → Chunk and API schemas: returns ranked chunks
app/retrieval/engine.py - Answer generation → Answer guardrails: checks evidence
app/llm/client.py - Answer generation → Local Ollama: generates answer
app/llm/client.py - Answer generation → Chunk and API schemas: uses result models
app/llm/client.py - Tier benchmark → Retrieval engine: benchmarks tiers
README.md - LLM robustness → Retrieval engine: exercises retrieval
app/eval/llm_robustness.py - LLM robustness → Answer generation: exercises answering
app/eval/llm_robustness.py - LLM robustness → Answer guardrails: exercises safety
app/eval/llm_robustness.py - Tier benchmark → Retrieval metrics: scores results
- Tier benchmark → Compute cost estimate: estimates compute cost
- Retrieval engine → Application settings: reads settings
app/retrieval/engine.py - Embedding backends → Application settings: selects backend
app/embeddings.py