How manojkesani/mrag works
M-RAG ingests PDFs, images, and text into searchable vectors, then answers questions through an iterative retrieval-and-assessment agent with citations. The main user workflow is upload/query through the Streamlit UI and FastAPI, followed by ingestion or RAG execution and a returned result. The graph preserves documented ingestion and agent stages plus their helper layers. Some subsystems are represented from README documentation and the SOURCE INDEX; unsampled implementation details and unverified links are omitted or marked dashed.
Main entry points: ingestion/nodes.py Ingestion Nodes · rag/nodes.py Agent Nodes · graph.py Ingestion Graph · main.py FastAPI
Components 23
User Interfaces
- Streamlit UI
frontend/app.py - FastAPI
api/main.py - Query Router
api/rag_router.py - CLI
cli/main.py
Ingestion Pipeline
- Ingestion Graph
ingestion/graph.py - Ingestion Nodes
ingestion/nodes.py - File Loaders
core/loaders - Image Describer
core/processors/image_describer.py - Chunking Strategies
core/chunkers - Embedding Models
core/embedders - Content Elements
core/elements.py
Agentic Retrieval
- RAG Graph
rag/graph.py - Agent Nodes
rag/nodes.py - Query Strategies
rag/strategies.py - Multi-Query Retriever
rag/retriever.py - Reranker
rag/reranker.py - Agent Notepad
rag/notepad.py
Storage and Models
- Qdrant Storer
core/storers/qdrant.py - Qdrant
- PostgreSQL
- Groq LLM
- Langfuse
Other components
- User
Connections 27
- User → Streamlit UI: uses
README.md - Streamlit UI → FastAPI: uploads and queries
README.md - User → CLI: runs commands
README.md - CLI → Ingestion Graph: runs ingestion
cli/main.py - FastAPI → Ingestion Graph: starts ingestion
api/main.py - FastAPI → Query Router: routes queries
api/main.py - Query Router → RAG Graph: runs query
api/rag_router.py - Ingestion Graph → Ingestion Nodes: dispatches stages
ingestion/graph.py - Ingestion Nodes → File Loaders: loads files
ingestion/nodes.py - Ingestion Nodes → Image Describer: describes images
ingestion/nodes.py - Ingestion Nodes → Chunking Strategies: chunks content
ingestion/nodes.py - Ingestion Nodes → Embedding Models: embeds content
ingestion/nodes.py - Ingestion Nodes → Qdrant Storer: stores vectors
ingestion/nodes.py - Qdrant Storer → Qdrant: writes vectors
README.md - Ingestion Nodes → Content Elements: processes elements
ingestion/nodes.py - RAG Graph → Agent Nodes: dispatches stages
rag/graph.py - Agent Nodes → Query Strategies: transforms queries
rag/nodes.py - Agent Nodes → Multi-Query Retriever: probes and retrieves
rag/nodes.py - Multi-Query Retriever → Embedding Models: embeds queries
rag/retriever.py - Multi-Query Retriever → Qdrant: searches vectors
README.md - Agent Nodes → Reranker: reranks results
rag/nodes.py - Agent Nodes → Agent Notepad: updates memory
rag/nodes.py - Agent Nodes → Groq LLM: plans and answers
README.md - Ingestion Graph → Groq LLM: describes images
README.md - Ingestion Graph → PostgreSQL: stores metadata
README.md - Ingestion Graph → Langfuse: traces runs
README.md - RAG Graph → Langfuse: traces runs
README.md