repowisemem0ai/mem0

Architecture of mem0ai/mem0

mem0ai/mem0 is 1,491 source files holding 8,251 symbols across 11 modules, written mainly in TypeScript, Python, JavaScript. The largest module is integrations, with 288 files, and 121 files are entry points into the dependency graph.

How mem0 fits together

Input enters through the Python library, where mem0/memory/main.py, a hotspot file in the mem0 package, holds the central memory logic. The TypeScript SDK has a matching memory module at mem0-ts/src/oss/src/memory/index.ts. The server directory contains the self-hosted stack, which is started with make bootstrap or Docker Compose and then configured through a browser setup wizard. The cli directory provides the mem0 command line tool, with cli/python/src/mem0_cli/app.py and cli/node/src/index.ts as its entry points for commands such as add and search. The integrations directory, the largest module by file count, contains the integration code.

Largest modules

  • integrations: 288 files and 33,609 lines of code
  • docs: 250 files and 42,947 lines of code
  • mem0-ts: 234 files and 51,167 lines of code
  • mem0: 150 files and 25,428 lines of code
  • server: 140 files and 9,953 lines of code
  • examples: 137 files and 10,417 lines of code
  • tests: 103 files and 25,727 lines of code
  • cli: 93 files and 17,002 lines of code

Languages

By file count: TypeScript 569 files, Python 370 files, JavaScript 28 files, Shell 26 files, Makefile 4 files, Dockerfile 2 files.

Documentation

Repowise documents mem0 in 1,310 pages generated from the source.

More on mem0: summary and FAQ, codebase overview, code health.

Related guide: Best dependency graph tools for monorepos