How daniel-ddv/cortexdb works
CortexDB is an embedded AI-memory and knowledge-graph product, with SQLite by default and optional PostgreSQL or shared gRPC access. Users capture or import knowledge, then retrieve memories and graph/RAG context through a library, MCP tools, REST, or remote clients. The graph preserves documented product capabilities and relationships visible in the excerpts or README; several internal implementations are represented by their exact package directories because their source was not sampled.
Main entry points: cortexdb.go CortexDB facade · store.go Core store and search · routes.go REST API · graphrag_tool_ingest.go GraphRAG ingest and search
Components 21
User Interfaces
- MCP tools
cmd/cortexdb-mcp-stdio/main.go - CortexDB facade
pkg/cortexdb/cortexdb.go - REST API
pkg/httpapi/routes.go - gRPC API
pkg/rpcserver/server.go - Language clients
clients/python/cortexdb_client/client.py
Knowledge Workflows
- Memory operations
pkg/cortexdb/memory_api.go - Memory lifecycle
pkg/memoryflow/service.go - Scoped agent memory
pkg/agentmem/search.go - Agent-memory import
pkg/cortexdb/import_agent_memory.go - Data connectors
pkg/connector - Governed ontology
pkg/cortexdb/ontology_storage.go
Retrieval and Graph
- GraphRAG ingest and search
pkg/cortexdb/graphrag_tool_ingest.go - Graph organization
pkg/graphflow/pipeline.go - Knowledge graph engine
pkg/graph - Hybrid query and retrieval
pkg/cortexdb/query_api.go - Vector indexes
pkg/index/hnsw.go
Persistence
- Core store and search
pkg/core/store.go - SQLite or PostgreSQL
pkg/core/store_init.go
Serving and Integrations
- Live graph view
pkg/liveview/server.go - Shared-brain server
cmd/cortexdb-grpc/main.go
Other components
- Agent or user
Connections 23
- Agent or user → MCP tools: uses tools
README.md - Agent or user → CortexDB facade: uses library
README.md - Agent or user → REST API: calls REST
README.md - Agent or user → Language clients: uses client
README.md - MCP tools → Graph organization: registers tools
cmd/cortexdb-mcp-stdio/main.go - REST API → Memory operations: routes calls
pkg/httpapi/routes.go - REST API → CortexDB facade: routes calls
pkg/httpapi/routes.go - Shared-brain server → gRPC API: creates server
cmd/cortexdb-grpc/main.go - gRPC API → CortexDB facade: delegates RPCs
pkg/rpcserver/server.go - Language clients → Shared-brain server: sends RPCs
clients/python/cortexdb_client/client.py - Memory lifecycle → CortexDB facade: uses memory APIs
pkg/memoryflow/service.go - Scoped agent memory → Core store and search: searches store
pkg/agentmem/search.go - Graph organization → CortexDB facade: builds and analyzes
pkg/graphflow/pipeline.go - GraphRAG ingest and search → Knowledge graph engine: reads and writes
pkg/cortexdb/graphrag_tool_ingest.go - GraphRAG ingest and search → Core store and search: uses storage
pkg/cortexdb/graphrag_tool_ingest.go - CortexDB facade → Core store and search: uses store
- Core store and search → SQLite or PostgreSQL: persists data
- Hybrid query and retrieval → Vector indexes: retrieves vectors
- Hybrid query and retrieval → Knowledge graph engine: retrieves graph context
- Governed ontology → Core store and search: stores schemas
pkg/cortexdb/ontology_storage.go - Live graph view → Agent or user: serves graph view
README.md - Data connectors → CortexDB facade: imports knowledge
- Agent-memory import → CortexDB facade: imports memories
README.md