How renganathan077/hybrid-rag-system works
This is a hybrid retrieval-augmented question-answering service. Users submit questions through the CLI or OpenAI-compatible API; the hybrid workflow retrieves role-filtered document chunks, chooses local context or DuckDuckGo results based on relevance, and generates an answer with Ollama. The documented ingestion and indexing stages prepare PDF chunks and metadata in Milvus. The separate basic RAG graph and direct-query scripts are also represented. Runtime relationships are based on excerpts and README statements; unsampled subsystems are not inferred.
Main entry points: hybrid_rag.py Hybrid CLI · build_index.py Embedding and indexing · rag_graph.py Basic RAG graph · rag_answer.py Direct RAG answer
Components 20
Document preparation
- Source PDFs
data/docs - PDF chunk extraction
ingest_docs.py - Chunking example
chunk_text.py - Chunk records
Vector storage
- Embedding and indexing
build_index.py - Milvus collections
- Milvus reset utility
reset_milvus.py
Hybrid answering
- Collection readiness
hybrid_rag.py - Role-filtered retrieval
hybrid_rag.py - Relevance routing
hybrid_rag.py - DuckDuckGo search
hybrid_rag.py - Context answer generation
hybrid_rag.py - Ollama models
- Langfuse monitoring
- Basic RAG graph
rag_graph.py - Direct RAG answer
rag_answer.py - Direct chunk query
query_docs.py
User interfaces
- Hybrid CLI
hybrid_rag.py - Chat completions API
api.py
Other components
- Question asker
Connections 27
- Source PDFs → PDF chunk extraction: extracts chunks
ingest_docs.py - PDF chunk extraction → Chunk records: writes records
ingest_docs.py - Chunk records → Embedding and indexing: loads records
build_index.py - Embedding and indexing → Ollama models: embeds documents
build_index.py - Embedding and indexing → Milvus collections: creates and fills
build_index.py - Question asker → Hybrid CLI: asks question
hybrid_rag.py - Question asker → Chat completions API: sends chat request
README.md - Chat completions API → Hybrid CLI: calls workflow
api.py - Hybrid CLI → Collection readiness: checks collection
hybrid_rag.py - Collection readiness → Milvus collections: checks and loads
hybrid_rag.py - Hybrid CLI → Role-filtered retrieval: starts graph
hybrid_rag.py - Role-filtered retrieval → Ollama models: embeds query
hybrid_rag.py - Role-filtered retrieval → Milvus collections: searches chunks
hybrid_rag.py - Role-filtered retrieval → Relevance routing: provides context
hybrid_rag.py - Relevance routing → DuckDuckGo search: routes low relevance
hybrid_rag.py - Relevance routing → Context answer generation: routes relevant docs
hybrid_rag.py - DuckDuckGo search → Context answer generation: provides results
hybrid_rag.py - Context answer generation → Ollama models: generates response
hybrid_rag.py - Hybrid CLI → Langfuse monitoring: sends traces
hybrid_rag.py - Basic RAG graph → Milvus collections: searches chunks
rag_graph.py - Basic RAG graph → Ollama models: embeds and answers
rag_graph.py - Direct RAG answer → Milvus collections: searches chunks
rag_answer.py - Direct RAG answer → Ollama models: embeds and answers
rag_answer.py - Direct chunk query → Milvus collections: searches by role
query_docs.py - Direct chunk query → Ollama models: embeds query
query_docs.py - Milvus reset utility → Milvus collections: drops collections
reset_milvus.py - Chunking example → Source PDFs: reads example PDF
chunk_text.py