How nuri428/ontorag works
ontorag is an ontology-first RAG framework: users ask questions through its API or browser UI, an LLM agent selects structured graph tools, and graph-store backends return grounded results. Other product paths load and learn ontology data, provide search and Bayesian/causal reasoning, and expose schema/data browsing. The graph groups the main runtime by responsibility; backend alternatives and several capabilities are documented but their implementations were not sampled, so those links rely on README evidence or are omitted where ownership is unclear.
Main entry points: base.py Graph store interface · main.py HTTP API · agent.py Agent loop · factory.py Backend selection
Components 21
Interfaces
- HTTP API
src/ontorag/api/main.py - Chat endpoint
src/ontorag/api/routes/chat.py - Browser UI
src/ontorag/web/router.py
Ontology data
- Ontology loading
src/ontorag/core/batch_loader.py - Ontology learning
src/ontorag/learn/pipeline.py - Ontology scoping
src/ontorag/core/ontology.py
Agent and tools
- Agent loop
src/ontorag/chat/agent.py - MCP tool routes
src/ontorag/api/routes - Multi-agent flow
src/ontorag/chat/multi_agent
Search and reasoning
- Text and vector search
src/ontorag/api/routes/tools - Graph embeddings
src/ontorag/llm/embedding.py - Bayesian inference
src/ontorag/bayes/engine.py - Causal inference
src/ontorag/causal/engine.py
Providers and storage
- LLM providers
src/ontorag/llm/factory.py - Graph store interface
src/ontorag/stores/base.py - Backend selection
src/ontorag/stores/factory.py - Fuseki backend
src/ontorag/stores/fuseki.py - Neo4j backend
src/ontorag/stores/neo4j.py - FalkorDB backend
src/ontorag/stores/falkordb.py - Qdrant vectors
src/ontorag/stores/_qdrant.py
Other components
- User
Connections 20
- User → HTTP API: sends requests
README.md - HTTP API → Chat endpoint: routes chat
src/ontorag/api/main.py - Chat endpoint → Agent loop: runs agent
src/ontorag/api/routes/chat.py - Agent loop → LLM providers: requests completions
src/ontorag/chat/agent.py - Agent loop → Graph store interface: calls graph methods
src/ontorag/chat/agent.py - HTTP API → MCP tool routes: registers tools
src/ontorag/api/main.py - Browser UI → Graph store interface: queries graph
src/ontorag/web/router.py - Ontology loading → Graph store interface: loads triples
src/ontorag/core/batch_loader.py - Ontology learning → Graph store interface: reads schema
src/ontorag/learn/pipeline.py - Graph store interface → Ontology scoping: scopes ontology data
src/ontorag/stores/fuseki.py - Backend selection → Fuseki backend: selects backend
README.md - Backend selection → Neo4j backend: selects backend
README.md - Backend selection → FalkorDB backend: selects backend
README.md - Text and vector search → Graph store interface: queries ranked results
README.md - Graph embeddings → Text and vector search: supports similarity retrieval
README.md - Text and vector search → Qdrant vectors: stores vectors
README.md - HTTP API → Bayesian inference: routes inference
src/ontorag/api/main.py - HTTP API → Causal inference: routes causal tools
src/ontorag/api/main.py - Causal inference → Bayesian inference: reuses Bayesian model
src/ontorag/causal/engine.py - Multi-agent flow → Agent loop: uses agent loop
src/ontorag/eval/baselines/ontorag_multiagent.py