How yahyaoui7/true_rag works
RAG Against the Machine indexes a source corpus, retrieves ranked evidence, and generates grounded answers through CLI or local HTTP entry points. The map preserves separate lexical and semantic retrieval, hybrid fusion, incremental index maintenance, caching, dataset workflows, and evaluation. Edges follow README architecture or shown calls; several capabilities are documented but their implementations were not sampled, so the graph avoids inferring additional internal links.
Main entry points: __main__.py CLI Commands · retriever.py Search Coordinator · indexer.py Index Manager · server.py Local HTTP API
Components 24
Corpus Indexing
- File Scanner
src/scanner.py - Chunk Dispatch
src/indexer.py - Python Chunker
src/chunking/python_chunker.py - Markdown Chunker
src/chunking/markdown_chunker.py - Text Chunker
src/chunking/text_chunker.py - Chunk Metadata
src/models.py - Index Manager
src/indexer.py - Incremental Manifest
src/indexer.py - BM25 Index
src/indexer.py - ChromaDB Vectors
src/indexer.py
Retrieval
- Search Coordinator
src/retriever.py - Lexical Search
src/retriever.py - Semantic Search
src/retriever.py - Hybrid Fusion
src/retriever.py
Answering
- Answer Cache
src/caching.py - Prompt Builder
src/prompts.py - Qwen Generator
src/generate.py - Qwen Model
User Interfaces
- CLI Commands
src/__main__.py - Local HTTP API
src/server.py
Evaluation
- Recall Evaluator
src/evaluator.py - Search Datasets
src/models.py
Other components
- User
- Source Corpus
Connections 34
- User → CLI Commands: runs commands
src/__main__.py - User → Local HTTP API: queries API
src/server.py - Source Corpus → File Scanner: scans files
- CLI Commands → Index Manager: builds indexes
src/__main__.py - Index Manager → File Scanner: discovers files
src/indexer.py - Index Manager → Chunk Dispatch: dispatches files
src/indexer.py - Chunk Dispatch → Python Chunker: chunks Python
src/indexer.py - Chunk Dispatch → Markdown Chunker: chunks Markdown
src/indexer.py - Chunk Dispatch → Text Chunker: chunks text
src/indexer.py - Python Chunker → Chunk Metadata: creates chunks
src/chunking/python_chunker.py - Markdown Chunker → Chunk Metadata: creates chunks
src/chunking/markdown_chunker.py - Text Chunker → Chunk Metadata: creates chunks
src/chunking/text_chunker.py - Index Manager → Incremental Manifest: tracks changes
src/indexer.py - Index Manager → BM25 Index: builds and saves
src/indexer.py - Index Manager → ChromaDB Vectors: embeds and upserts
src/indexer.py - CLI Commands → Search Coordinator: searches queries
src/__main__.py - Local HTTP API → Search Coordinator: searches queries
src/server.py - Search Coordinator → BM25 Index: loads index
src/retriever.py - Search Coordinator → Lexical Search: runs lexical search
src/retriever.py - Search Coordinator → Semantic Search: runs semantic search
src/retriever.py - Lexical Search → Hybrid Fusion: scores candidates
src/retriever.py - Semantic Search → Hybrid Fusion: scores candidates
src/retriever.py - Search Coordinator → Hybrid Fusion: fuses results
src/retriever.py - Search Coordinator → ChromaDB Vectors: queries vectors
src/retriever.py - CLI Commands → Answer Cache: checks and saves answers
src/__main__.py - Local HTTP API → Answer Cache: checks and saves answers
src/server.py - CLI Commands → Prompt Builder: builds context prompt
src/__main__.py - Local HTTP API → Prompt Builder: builds context prompt
src/server.py - CLI Commands → Qwen Generator: generates answer
src/__main__.py - Local HTTP API → Qwen Generator: generates answer
src/server.py - Qwen Generator → Qwen Model: loads and invokes
src/generate.py - CLI Commands → Search Datasets: processes datasets
src/__main__.py - CLI Commands → Recall Evaluator: evaluates recall
src/__main__.py - Recall Evaluator → Search Datasets: scores results
src/evaluator.py