How aricommits/corpusrag works
CorpusRAG is a document knowledge base: users ingest files or text into named collections, then retrieve grounded answers and generate study materials. The map covers RAG ingestion and retrieval, model/database services, MCP and web interfaces, plus video and handwriting ingestion and lecture orchestration. The README documents summaries, flashcards, and quizzes; their implementation paths are represented, but internal calls are not inferred where source was not shown. Edges are limited to relationships explicit in excerpts, the source index, or README.
Main entry points: kernel.py Corpus facade · ingest.py RAG ingestion · lecture_pipeline.py Lecture orchestrator · retriever.py Retriever
Components 24
User interfaces
- CLI
src/cli.py - Web UI
src/web_ui/app.py - MCP server
src/mcp_server/server.py - Tool profiles
src/mcp_server/profiles.py - Video tools
src/mcp_server/tools/video.py
Knowledge base
- Corpus facade
src/kernel.py - RAG ingestion
src/tools/rag/ingest.py - Adaptive chunking
src/tools/rag/pipeline/adaptive_splitter.py - Retrieval strategies
src/tools/rag/strategies - Retriever
src/tools/rag/retriever.py - RAG agent
src/tools/rag/agent.py
Core services
- Configuration
src/config/base.py - Database backend
src/db/base.py - ChromaDB
src/db/chroma.py - LLM backend
src/llm/backend.py
Media ingestion
- Visual OCR ingest
src/tools/video/ingest.py - Audio transcription
src/tools/video - Handwriting OCR
src/tools/handwriting/ingest_handwriting.py
Study workflows
- Lecture orchestrator
src/orchestrations/lecture_pipeline.py - Summaries
src/tools/summaries/generator.py - Flashcards
src/tools/flashcards/generator.py - Quizzes
src/tools/quizzes/generator.py
Other components
- User
- MCP clients
Connections 25
- User → CLI: uses
README.md - User → Web UI: uses
README.md - MCP clients → MCP server: connects
README.md - CLI → Corpus facade: dispatches
src/cli.py - Web UI → Corpus facade: calls
src/web_ui/app.py - MCP server → Tool profiles: loads profiles
src/mcp_server/server.py - Tool profiles → Video tools: registers tools
src/mcp_server/profiles.py - Video tools → Visual OCR ingest: runs OCR
src/mcp_server/tools/video.py - Corpus facade → RAG ingestion: ingests paths
src/kernel.py - Corpus facade → RAG agent: asks questions
src/kernel.py - Corpus facade → Summaries: generates summaries
src/kernel.py - RAG ingestion → Adaptive chunking: chunks documents
src/tools/rag/ingest.py - RAG ingestion → Database backend: stores documents
src/tools/rag/ingest.py - RAG agent → Retriever: retrieves context
src/tools/rag/agent.py - Retriever → Retrieval strategies: selects strategy
src/tools/rag/retriever.py - Retriever → Database backend: searches
src/tools/rag/retriever.py - RAG agent → LLM backend: generates answer
src/tools/rag/agent.py - ChromaDB → Database backend: implements
src/db/chroma.py - RAG ingestion → Configuration: uses settings
src/tools/rag/ingest.py - Visual OCR ingest → Audio transcription: distinct audio path
README.md - Handwriting OCR → RAG ingestion: ingests into RAG
README.md - Lecture orchestrator → Summaries: generates
README.md - Lecture orchestrator → Flashcards: generates
README.md - Lecture orchestrator → Quizzes: generates
README.md - Lecture orchestrator → Audio transcription: transcribes video
src/orchestrations/lecture_pipeline.py