How cmudco/dare-backend works
DARE is a Django REST and Socket.IO backend for a multi-provider research and conversation platform. Its main user path is client requests into conversation/chat APIs, model dispatch and (when relevant) retrieval over uploaded documents, followed by streamed results. Separate branches provide document ingestion and RAG, visual workflow execution, MCP tools, account/access management, and usage billing. The README documents the product-level connections; internal links below are limited to sampled code references. Several major subsystems are represented at their source-directory level because their implementations were not sampled.
Main entry points: step_handler.py Workflow step handler · services Chat services · views.py Conversation API · document_processor.py Document processor
Components 25
Conversation and models
- Conversation API
conversations/api/views.py - Chat services
conversations/services - Conversation data
conversations/models.py - Socket streaming
conversations/socket_server.py
Documents and retrieval
- File API
files/api/views.py - Document ingestion
core/services/document_ingestion_service.py - Document processor
core/services/document_processor.py - Document map
files/services/document_map_service.py - File records
files/models.py - RAG pipeline
core/services/rag/pipeline.py
Workflow and tools
- Workflow API
workflows/api/views.py - Workflow step handler
workflows/handlers/step_handler.py - Workflow run services
workflows/services - MCP manager
mcp/services/mcp_manager.py
Accounts and billing
- Users and access
users/models.py - Billing services
billing/services.py - Wallet model filter
conversations/services/llm_filter_service.py
Core runtime
- LLM dispatch
core/services/llm_service.py - Provider services
core/services
Other components
- Platform clients
- Vector stores
- MCP servers
- LLM providers
- PostgreSQL
- Redis and jobs
Connections 28
- Platform clients → Conversation API: requests chat
README.md - Conversation API → Chat services: serves chat
- Chat services → LLM dispatch: dispatches prompts
README.md - LLM dispatch → Provider services: dispatches by provider
core/services/llm_service.py - Provider services → LLM providers: calls providers
README.md - Chat services → RAG pipeline: retrieves context
README.md - Socket streaming → Platform clients: streams responses
README.md - Conversation API → Conversation data: persists conversations
- Platform clients → File API: uploads documents
README.md - File API → Document ingestion: starts processing
- Document ingestion → Document processor: processes document
core/services/document_ingestion_service.py - Document processor → Document map: builds map
core/services/document_processor.py - Document map → File records: reads and writes
files/services/document_map_service.py - RAG pipeline → Document map: loads map data
core/services/rag/pipeline.py - RAG pipeline → Vector stores: retrieves vectors
README.md - Document processor → Vector stores: indexes documents
README.md - Platform clients → Workflow API: runs workflows
README.md - Workflow API → Workflow step handler: executes steps
- Workflow step handler → Chat services: uses tool loop
workflows/handlers/step_handler.py - Workflow step handler → Workflow run services: records workflow sources
workflows/handlers/step_handler.py - Workflow step handler → MCP manager: executes retrieval tools
- MCP manager → MCP servers: discovers and invokes
mcp/services/mcp_manager.py - Platform clients → Users and access: registers and authenticates
README.md - Users and access → PostgreSQL: stores accounts
README.md - Wallet model filter → Billing services: resolves wallet
conversations/services/llm_filter_service.py - Platform clients → Billing services: tracks usage
README.md - LLM dispatch → Redis and jobs: uses background runtime
- Billing services → PostgreSQL: stores usage
README.md