How dilolabs/nosia works
Nosia is a self-hosted, multi-tenant RAG and MCP platform. Users add documents, text, Q&A pairs, or websites to build a searchable knowledge base, then chat with models using retrieved context and optional tools; it also exposes an OpenAI-compatible API. The graph preserves source ingestion, chat, MCP, and agent-skill capabilities. Several runtime links are documented in the README rather than shown in sampled implementation, so those are cited as documented relationships; unsampled internals are not asserted.
Main entry points: chat_response_job.rb Chat response job · augmented_prompt.rb Chat and prompt · client.rb MCP connections · chats_controller.rb Chat interface
Components 18
User interaction
- Chat interface
app/controllers/chats_controller.rb - Message handling
app/controllers/messages_controller.rb - Completions API
app/controllers/api/v1/completions_controller.rb
Knowledge ingestion
- Source management
app/controllers/sources_controller.rb - Source endpoints
app/controllers/sources/documents_controller.rb - Indexing jobs
app/jobs/add_document_job.rb - Source models
app/models/document.rb - Chunk search
app/models/chunk/searchable.rb
AI runtime
- Chat response job
app/jobs/chat_response_job.rb - Chat and prompt
app/models/chat/augmented_prompt.rb
Tools and skills
- MCP chat integration
app/models/chat/model_context_protocol.rb - MCP connections
app/models/mcp_server/client.rb - Agent skills
app/models/agent_skill/executor.rb - OpenAlex tools
app/models/open_alex_tools/get_author_comprehensive_works_tool.rb
Persistence
- PostgreSQL and vectors
db/schema.rb
Other components
- User
- AI model service
- External MCP tools
Connections 19
- User → Chat interface: starts chat
- User → Source management: manages sources
- User → Completions API: calls API
- Chat interface → Message handling: routes messages
- Source management → Source endpoints: routes sources
- Source endpoints → Indexing jobs: queues indexing
- Indexing jobs → Source models: indexes sources
- Source models → PostgreSQL and vectors: stores records
- Message handling → Chat response job: starts response
- Completions API → Chat response job: generates completion
- Chat response job → Chat and prompt: builds context
- Chat and prompt → Chunk search: retrieves chunks
- Chunk search → PostgreSQL and vectors: vector search
- Chat response job → AI model service: requests response
- Chat and prompt → MCP chat integration: supports tool context
- MCP chat integration → MCP connections: uses MCP
- MCP connections → External MCP tools: connects tools
- Chat response job → Agent skills: extends chat
- MCP connections → OpenAlex tools: offers tools