Architecture of topoteretes/cognee
topoteretes/cognee is 2,262 source files holding 13,146 symbols across 15 modules, written mainly in Python, TypeScript, JavaScript. The largest module is cognee, with 1,674 files, and 16 files are entry points into the dependency graph.
How cognee fits together
The cognee directory is the largest module and holds the core Python package that ingests data and builds the knowledge graph. Graph storage is implemented through database adapters such as cognee/infrastructure/databases/graph/postgres/adapter.py, and session handling lives in cognee/infrastructure/session/session_manager.py. The README says the core work combines vector embeddings with graph reasoning, so stored memory can be searched by meaning and by relationships. Users reach this memory through the cognee-cli commands remember, recall, forget and improve, or through the API server. The cognee-frontend directory holds the web UI for the local interface, and the cognee-mcp directory holds the MCP server, which the README says runs inside a Docker container when started with cognee-cli -ui.
Largest modules
- cognee: 1,674 files and 185,187 lines of code
- cognee-frontend: 231 files and 19,401 lines of code
- examples: 91 files and 10,023 lines of code
- evals: 76 files and 16,617 lines of code
- .github: 62 files and 8,563 lines of code
- distributed: 29 files and 1,296 lines of code
- cognee-mcp: 20 files and 5,136 lines of code
- root: 20 files and 2,213 lines of code
Languages
By file count: Python 1,810 files, TypeScript 226 files, JavaScript 10 files, Shell 10 files, Dockerfile 6 files.
More on cognee: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos