mem0ai / mem0
Code health
Hotspots average 4.3, the place fixes pay off most.
Explore this codebase
- Code health map94hotspots across 1,491 files
- Ownership657sole-owned files: one author, no second reader
- Architecture11modules, 121 entry points
- Decisions2recorded, of which 0 in force and 2 background
- Refactoring143open opportunities, one per file
- TestsNo coverage report yet. Run your tests with coverage on, then add the report:
AlsoDocsChatFilesKnowledge graphChange couplingCommitsStatsCosts
Do next · 3
38 things worth doing in the week to Aug 14, the last indexed commit, 35 of them now.
Worth planning
Start breaking up addToVectorStore (CCN 72, 381 lines): first lift lines 1066-1270
mem0-ts/src/oss/src/memory/index.ts:1066
addToVectorStore nests deeply; easier to read and change once split, which also removes a duplicate; function changed in 8 commits; its file is imported by 18 files, changed 22 times in 90 days.
- gain
- up to under +0.1 health on this file(inferred)
- finding
- Nested complexity
- size
- CCN 72, 381 lines, nests 7 deep
- severity
- high
Medium effort, worth a checkStart breaking up _add_to_vector_store (CCN 65, 257 lines): first lift lines 1045-1192
mem0/memory/main.py:1045
_add_to_vector_store nests deeply; easier to read and change once split, which also removes a duplicate; its file is imported by 17 files, changed 31 times in 90 days.
- gain
- up to under +0.1 health on this file(inferred)
- finding
- Nested complexity
- size
- CCN 65, 257 lines, nests 7 deep
- severity
- high
Medium effort, worth a checkStart breaking up registerHooks (CCN 107, 474 lines): first lift lines 678-1056
integrations/openclaw/index.ts:678
registerHooks nests deeply; easier to read and change once split, which also removes a duplicate; its file is imported by 2 files, changed 4 times in 90 days.
- gain
- up to +0.9 health on this file(inferred)
- finding
- Nested complexity
- size
- CCN 107, 474 lines, nests 6 deep
- severity
- high
Medium effort, worth a check
Improve what Repowise can see
Add a test coverage report
Without one, Repowise cannot tell tested code from untested code, so every test-related action says “unknown”.
- line coverage
- Unknown, no report
Small effort
Everything we found
5 areas
Every detector's open count by area. The actions above are the part worth doing.
- Code health2,229 open findingsCriticalChange entropy · mem0-ts/src/oss/src/memory/index.ts67 findings · 8.0 deducted
- Refactoring143 open opportunitiesMediumloadDreamConfig+1.5 health, S effort · integrations/mem0-plugin/.opencode-plugin/dream.ts
- Decisions0 drifting from the codeMediummem0-ts/src/oss/tests/vector-stores-compat.test.tsHigh-churn file with no governing decision
- Ownership657 sole-owned filesMediumtests/vector_stores/test_pgvector.pyOne author, no second reader
- Dead code152LowDIM_COLORUnreachable constant (0 lines)