3 views
akitaonrails/ai-memory
Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust★ 12,477+286 that day#5 on trending
E37.6/100
Duplication42
10.6% in rust, bash, typescript, sql, python, swift, powershell, nix, javascript, docker, nginxDead coden/a
the languages dead code reads are under 5% of the codeComplexity33
79.4% The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
8.21%duplicated code · 36,802 of 448,106 lines
3,000clones in code
494code files of 1,168 scanned
9.75%duplicated over all files · 5,012 clones
Most complex files
- crates/ai-memory-store/src/reader.rs3003 cx
- crates/ai-memory-store/src/ops.rs2733 cx
- crates/ai-memory-cli/src/commands/install_hooks.rs1823 cx
- crates/ai-memory-mcp/src/server.rs1437 cx
- crates/ai-memory-cli/src/commands/render_shared.rs1393 cx
- crates/ai-memory-hooks/src/router.rs1293 cx
- crates/ai-memory-hooks/src/capture_policy.rs1203 cx
- crates/ai-memory-workstream/src/transcript.rs1143 cx
- crates/ai-memory-mcp/src/admin.rs1070 cx
- crates/ai-memory-cli/src/commands/run.rs1040 cx
Dead code 0.37% unused · 2 findings
- crates/ai-memory-web/static/management/theme.jsunused-file
- companions/ai-memory-desktop/ui/app.jsunused-file
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code, and 2 generated files: crates/ai-memory-cli/src/commands/init.rs, crates/ai-memory-store/migrations/V14__users.sql.
Largest clones in the code
- 11 lines in 63 placesrust65 tokenscrates/ai-memory-cli/src/commands/serve.rs:7321–7331crates/ai-memory-consolidate/src/auto_improve.rs:3030–3040crates/ai-memory-consolidate/src/auto_improve.rs:3109–3119crates/ai-memory-consolidate/src/auto_improve.rs:3210–3220crates/ai-memory-mcp/src/server.rs:17043–17053and 58 more
7321async fn reranker_without_llm_provider_fails_server_setup() { 7322 let tmp = TempDir::new().unwrap(); 7323 let store = Store::open(tmp.path()).unwrap(); 7324 let ws = store 7325 .writer 7326 .get_or_create_workspace("default") 7327 .await 7328 .unwrap(); 7329 let proj = store 7330 .writerFirst 10 of 11 lines.
- 110 lines in 2 placesrust3,970 tokenscrates/ai-memory-consolidate/src/consolidator.rs:1288–1397crates/ai-memory-consolidate/src/consolidator_oracle.rs:97–206
1288) -> BatchRequestPlan { 1289 // Stable prefix first so prefix-caching providers can reuse it across 1290 // sessions of the same project: the fixed batch scaffolding (header + 1291 // field schema) and the project instructions lead the message, then the 1292 // per-project slot/title state, then the per-session id and the 1293 // observation dump at the end. Budget math is unchanged — only the 1294 // block order moved. 1295 let mut fixed_header = String::new(); 1296 fixed_header.push_str( 1297 "You are compiling a Karpathy-style multi-page wiki update. Given the \First 10 of 110 lines.
- 389 lines in 2 placesrust2,379 tokenscrates/ai-memory-consolidate/src/consolidator_frozen_oracle.rs:977–1365crates/ai-memory-consolidate/src/projection.rs:1599–1987
977 ); 978} 979 980#[test] 981fn body_truncation_marker_includes_omitted_chars_and_id() { 982 let observations = vec![obs( 983 0, 984 ObservationKind::UserPrompt, 985 "prompt", 986 &"x".repeat(30),First 10 of 389 lines.
7 more
- 15 lines in 17 placesrust131 tokens
- 232 lines in 2 placesrust1,393 tokens
- 6 lines in 20 placesrust62 tokens
- 12 lines in 17 placesrust70 tokens
- 6 lines in 14 placesrust80 tokens
- 12 lines in 17 placesrust60 tokens
- 134 lines in 2 placesrust934 tokens
Largest clones over all files, tests and data included
- 11 lines in 67 placesrust65 tokenscrates/ai-memory-cli/src/commands/serve.rs:7321–7331crates/ai-memory-consolidate/src/auto_improve.rs:3030–3040crates/ai-memory-consolidate/src/auto_improve.rs:3109–3119crates/ai-memory-consolidate/src/auto_improve.rs:3210–3220crates/ai-memory-consolidate/tests/suite/bounded_session_load.rs:1549–1559and 62 more
7321async fn reranker_without_llm_provider_fails_server_setup() { 7322 let tmp = TempDir::new().unwrap(); 7323 let store = Store::open(tmp.path()).unwrap(); 7324 let ws = store 7325 .writer 7326 .get_or_create_workspace("default") 7327 .await 7328 .unwrap(); 7329 let proj = store 7330 .writerFirst 10 of 11 lines.
- 130 lines in 3 placesmarkdowndocs and examples2,144 tokenscrates/ai-memory-core/src/routing_skills/ai-memory-retrieval/SKILL.md:5–134plugins/claude-code/skills/ai-memory-retrieval/SKILL.md:5–134plugins/codex/skills/ai-memory-retrieval/SKILL.md:5–134
5<!-- ai-memory-managed: routing-skill --> 6 7# ai-memory retrieval 8 9Use this skill for read-only ai-memory lookups, catch-up, and evaluating remembered project knowledge before you design, debug, or edit. 10 11## Tools in this cluster 12 13- `memory_query` searches the current project's wiki for prior decisions, gotchas, procedures, rules, and session notes. 14- `memory_recent` lists the most recently updated pages when the user wants a light activity check.First 10 of 130 lines.
- 110 lines in 2 placesrust3,970 tokenscrates/ai-memory-consolidate/src/consolidator.rs:1288–1397crates/ai-memory-consolidate/src/consolidator_oracle.rs:97–206
1288) -> BatchRequestPlan { 1289 // Stable prefix first so prefix-caching providers can reuse it across 1290 // sessions of the same project: the fixed batch scaffolding (header + 1291 // field schema) and the project instructions lead the message, then the 1292 // per-project slot/title state, then the per-session id and the 1293 // observation dump at the end. Budget math is unchanged — only the 1294 // block order moved. 1295 let mut fixed_header = String::new(); 1296 fixed_header.push_str( 1297 "You are compiling a Karpathy-style multi-page wiki update. Given the \First 10 of 110 lines.
- 6 lines in 55 placesrusttests52 tokenscrates/ai-memory-store/tests/suite/auto_improve_staging.rs:95–100crates/ai-memory-store/tests/suite/auto_improve_staging.rs:123–128crates/ai-memory-store/tests/suite/auto_improve_staging.rs:175–180crates/ai-memory-store/tests/suite/auto_improve_staging.rs:472–477crates/ai-memory-store/tests/suite/handoff_ownership.rs:180–184and 50 more
- 92 lines in 3 placesmarkdowndocs and examples1,357 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| rust | 334 | 429,923 | 2,963 | 35,997 | 8.37% |
| bash | 119 | 9,190 | 32 | 767 | 8.35% |
| typescript | 15 | 4,794 | 2 | 13 | 0.27% |
| powershell | 3 | 1,663 | 2 | 16 | 0.96% |
| swift | 20 | 2,076 | 1 | 9 | 0.43% |
| python | 2 | 427 | 0 | 0 | 0% |
| javascript | 1 | 33 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| rust | 525 | 535,081 | 4,803 | 57,754 | 10.79% |
| markdown | 172 | 59,751 | 69 | 1,787 | 2.99% |
| sql | 76 | 3,707 | 61 | 1,373 | 37.04% |
| bash | 167 | 13,498 | 44 | 851 | 6.3% |
| markup | 24 | 2,125 | 11 | 115 | 5.41% |
| yaml | 18 | 2,453 | 10 | 93 | 3.79% |
| typescript | 41 | 8,308 | 3 | 20 | 0.24% |
| txt | 1 | 284 | 3 | 273 | 96.13% |
| python | 11 | 2,739 | 2 | 19 | 0.69% |
| powershell | 8 | 2,099 | 2 | 16 | 0.76% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Oct 22, 2026 | #5 | 12,477 (+286) | 1,168 | 639,473 | 5,012 | 9.75% | 8.21% | E 37.6 | 1c86aeb |
| Oct 20, 2026 | #1 | 11,517 (+666) | 1,138 | 609,858 | 4,720 | 9.63% | 8.2% | E 37.8 | 11ab100 |
| Oct 19, 2026 | #3 | 10,666 (+512) | 1,132 | 607,235 | 4,692 | 9.61% | 8.2% | E 37.7 | b18f22a |
| Oct 18, 2026 | #3 | 10,036 (+178) | 1,129 | 604,783 | 4,667 | 9.61% | 8.19% | E 37.8 | 995e35d |
| Sep 22, 2026 | #3 | 7,812 (+167) | 654 | 299,844 | 2,454 | 9.44% | 8.59% | E 39 | 5157c6b |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.