How mosoulzz/cppagentrag works
CppAgentRAG is a browser-facing C++ knowledge-base and agent question-answering service. The main workflow is authenticated document upload, asynchronous parsing/chunking/filtering/embedding and indexing, followed by query routing, hybrid retrieval, reranking, answer generation and citation checks; users also manage documents and sessions and can stream answers or request speech. README-documented platform capabilities are included, but their unsampled wiring is not inferred. Edge evidence is limited to the shown excerpts and explicit README descriptions.
Main entry points: RagEngine.cpp RAG engine · api RAG handlers · IngestPipeline.cpp Ingest pipeline · ChatServer.cpp HTTP application
Components 25
Browser experience
- RAG page
frontend/web/src/pages/RagPage.tsx - RAG API client
frontend/web/src/ragApi.ts
Application and APIs
- HTTP application
apps/chatserver/src/ChatServer.cpp - Authentication
apps/chatserver/src/features/auth/api/AuthenticatedHandler.cpp - RAG handlers
apps/chatserver/include/features/rag/api
Knowledge and RAG
- Upload jobs
apps/chatserver/src/rag/UploadJobManager.cpp - Ingest pipeline
apps/chatserver/src/rag/IngestPipeline.cpp - Document library
apps/chatserver/include/rag/DocumentLibrary.h - Hybrid retrieval
apps/chatserver/src/rag/RetrievalPipeline.cpp - RAG engine
apps/chatserver/src/rag/RagEngine.cpp - Agent tools
apps/chatserver/src/rag/RagAgent.cpp - Conversation memory
apps/chatserver/src/rag/ConversationMemory.cpp - Trash and audit
apps/chatserver/src/rag/TrashBin.cpp
AI capabilities
- Model client
libs/ai-core/src/LlmClient.cpp - Embedding client
libs/ai-core/src/EmbeddingClient.cpp - Document parser
libs/ai-core/src/DocumentParser.cpp
Platform services
- Milvus index
libs/storage/src/milvus/MilvusClient.cpp - MySQL persistence
libs/storage/include/mysql - Redis services
libs/storage/src/redis/RedisClient.cpp - Shared sessions
apps/chatserver/src/session/RedisSessionStorage.cpp - Sambert speech
apps/chatserver/src/features/tts/SambertTts.cpp - RabbitMQ
apps/chatserver/src/infra/mq/MQManager.cpp
Other components
- User
- LLM providers
- Sambert service
Connections 28
- User → RAG page: uses
README.md - RAG page → RAG API client: requests
frontend/web/src/pages/RagPage.tsx - RAG API client → HTTP application: calls API
README.md - HTTP application → Authentication: serves
README.md - HTTP application → RAG handlers: routes
README.md - RAG handlers → Upload jobs: manages uploads
README.md - Upload jobs → RAG engine: runs ingest
README.md - RAG engine → Ingest pipeline: delegates ingest
apps/chatserver/src/rag/RagEngine.cpp - Ingest pipeline → Document parser: parses
apps/chatserver/src/rag/IngestPipeline.cpp - Ingest pipeline → Embedding client: embeds chunks
apps/chatserver/src/rag/IngestPipeline.cpp - Ingest pipeline → Document library: writes documents
apps/chatserver/src/rag/IngestPipeline.cpp - Ingest pipeline → Milvus index: upserts vectors
apps/chatserver/src/rag/IngestPipeline.cpp - RAG engine → Hybrid retrieval: retrieves
apps/chatserver/src/rag/RagEngine.cpp - Hybrid retrieval → Document library: reads chunks
README.md - Hybrid retrieval → Milvus index: vector search
README.md - RAG engine → Model client: generates answer
apps/chatserver/src/rag/RagEngine.cpp - RAG engine → Agent tools: runs agent
apps/chatserver/src/rag/RagEngine.cpp - RAG engine → Conversation memory: reads and writes
apps/chatserver/src/rag/RagEngine.cpp - RAG handlers → Trash and audit: manages documents
README.md - RAG handlers → Conversation memory: serves history
README.md - RAG handlers → Sambert speech: requests speech
README.md - Sambert speech → Sambert service: synthesizes
README.md - Model client → LLM providers: calls models
README.md - Embedding client → LLM providers: requests vectors
README.md - Shared sessions → Redis services: stores sessions
apps/chatserver/src/session/RedisSessionStorage.cpp - RAG handlers → Shared sessions: uses sessions
README.md - RAG engine → MySQL persistence: persists messages
README.md - RAG engine → RabbitMQ: optional async writes
README.md