Repository Analysis

akitaonrails/ai-memory

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

4.0 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of akitaonrails/ai-memory, a Rust project with 5,099 GitHub stars. SynthScan v2.0 examined 226,117 lines of code across 408 source files, recording 777 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 4.0 places this repository in the Likely human-written band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

4.0
Adjusted Score
4.0
Raw Score
100%
Time Factor
2026-08-29
Last Push
5.1K
Stars
Rust
Language
226.1K
Lines of Code
408
Files
777
Pattern Hits
2026-08-29
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 0MEDIUM 99LOW 678

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 777 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Over-Commented Block670 hits · 602 pts
SeverityFileLineSnippetContext
LOWCargo.toml121COMMENT
LOWREADME.md481 -v ai-memory-data:/data \COMMENT
LOW.gitleaks.toml1# gitleaks configuration for ai-memory.COMMENT
LOWevals/src/main.rs1//! Live A/B harness for the ai-memory consolidation prompt.COMMENT
LOWevals/src/main.rs21//! harness only reports the OBJECTIVE deltas (latency, updateCOMMENT
LOWcrates/ai-memory-web/build.rs1//! Build script for ai-memory-web.COMMENT
LOWcrates/ai-memory-web/tests/routes.rs2061/// On a server that DOES authenticate, a caller it can neither name nor placeCOMMENT
LOWcrates/ai-memory-web/src/lib.rs1//! `ai-memory-web` — read-only HTTP browser for the wiki.COMMENT
LOWcrates/ai-memory-web/src/state.rs1//! Web router state — the handle a request handler receives.COMMENT
LOWcrates/ai-memory-web/src/mount.rs21use axum::middleware::Next;COMMENT
LOWcrates/ai-memory-web/src/mount.rs41/// set (`ALPHA / DIGIT / "-" / "." / "_" / "~"`). Dot-segments `.` andCOMMENT
LOWcrates/ai-memory-web/src/mount.rs281/// the call shape.COMMENT
LOWcrates/ai-memory-web/src/markdown.rs1//! Markdown → HTML rendering for the read-only web browser, plus theCOMMENT
LOWcrates/ai-memory-web/src/markdown.rs301 if !trimmed.is_empty() && is_relative && !is_network_path && !trimmed.contains('\\') {COMMENT
LOWcrates/ai-memory-web/src/templates.rs1//! `askama` template definitions and per-route view-models.COMMENT
LOWcrates/ai-memory-web/src/templates.rs161}COMMENT
LOWcrates/ai-memory-web/src/templates.rs181 /// Semantic kind.COMMENT
LOWcrates/ai-memory-web/src/templates.rs201 /// chrome they had before v0.8.COMMENT
LOWcrates/ai-memory-web/src/routes/api.rs541 health,COMMENT
LOWcrates/ai-memory-web/src/routes/api.rs561 ai_memory_core::OwnerFilter::for_actor_context(COMMENT
LOWcrates/ai-memory-web/src/routes/api.rs581///COMMENT
LOWcrates/ai-memory-web/src/routes/api.rs641 #[serde(skip_serializing_if = "Option::is_none")]COMMENT
LOWcrates/ai-memory-web/src/routes/api.rs681///COMMENT
LOWcrates/ai-memory-web/src/routes/api.rs1181 #[serde(default = "default_session_list_limit")]COMMENT
LOWcrates/ai-memory-workstream/src/transcript.rs41 pub source_cursor: Option<String>,COMMENT
LOWcrates/ai-memory-cli/tests/marker_scope.rs1//! Subprocess tests for `.ai-memory.toml` scope resolution in client commands.COMMENT
LOWcrates/ai-memory-cli/tests/autoscope_env.rs1//! Subprocess smoke tests for `[auto_scope]` env-var configuration.COMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml1# ai-memory configuration.COMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml21# Optional server-side hook ingest limiter for shared/remote installs. The rateCOMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml41# schemas verbatim to strict upstreams that reject root combinators with aCOMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml61# provider as JSON-encoded untrusted data. Any failed or invalid response keepsCOMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml81# - Bigger time-pressure on access: mu = 0.08COMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml101sigma = 0.6COMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml121#COMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml161COMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml201min_session_age_secs = 600COMMENT
LOWcrates/ai-memory-cli/templates/config.default.toml221# `ai-memory init` appends further `[auth]` keys (token_pepper, root_username,COMMENT
LOWcrates/ai-memory-cli/src/config.rs41COMMENT
LOWcrates/ai-memory-cli/src/config.rs101COMMENT
LOWcrates/ai-memory-cli/src/config.rs121/// here would crash on harmless deploy-specific env vars before theCOMMENT
LOWcrates/ai-memory-cli/src/config.rs141 pub base_path: String,COMMENT
LOWcrates/ai-memory-cli/src/config.rs161 /// `AI_MEMORY_LLM_COMPAT_STRICT=false` for an incompatible endpoint.COMMENT
LOWcrates/ai-memory-cli/src/config.rs181 /// Server-side opt-in for assistant/Stop capture (#196). When true, theCOMMENT
LOWcrates/ai-memory-cli/src/config.rs201 /// (Vertex/Gemini `functionDeclaration.parameters`) accepts: the nullableCOMMENT
LOWcrates/ai-memory-cli/src/config.rs221 pub reranker: Option<String>,COMMENT
LOWcrates/ai-memory-cli/src/config.rs241 /// LLM consolidation prompt limits. Defaults are sized for a model with aCOMMENT
LOWcrates/ai-memory-cli/src/config.rs261 /// Default `single` mode preserves the legacy global slot; `per_session`COMMENT
LOWcrates/ai-memory-cli/src/config.rs281 /// comma-separated string (`"a,b"`) for ergonomics — env varsCOMMENT
LOWcrates/ai-memory-cli/src/config.rs301 /// [[admission_webhooks]]COMMENT
LOWcrates/ai-memory-cli/src/config.rs461 Either::Many(v) => v,COMMENT
LOWcrates/ai-memory-cli/src/config.rs481 /// Some(root_username)` on root-token requests, so audit_logCOMMENT
LOWcrates/ai-memory-cli/src/config.rs501 /// [`ai_memory_store::hash_token`] to keep stolenCOMMENT
LOWcrates/ai-memory-cli/src/config.rs541 )COMMENT
LOWcrates/ai-memory-cli/src/config.rs661pub struct AutoImproveSettings {COMMENT
LOWcrates/ai-memory-cli/src/config.rs801 pending_path: ai_memory_consolidate::DEFAULT_AUTO_IMPROVE_PENDING_PATH.into(),COMMENT
LOWcrates/ai-memory-cli/src/config.rs821 ///COMMENT
LOWcrates/ai-memory-cli/src/config.rs841 pub per_user: bool,COMMENT
LOWcrates/ai-memory-cli/src/http_client.rs1//! Shared HTTP-client glue for thin-client CLI subcommands.COMMENT
LOWcrates/ai-memory-cli/src/http_client.rs61 /// stripped, e.g. `http://127.0.0.1:49374` or `http://192.168.0.90:49374`.COMMENT
LOWcrates/ai-memory-cli/src/http_client.rs101 Some(config.base_path.clone()).filter(|s| !s.is_empty()),COMMENT
610 more matches not shown…
Decorative Section Separators78 hits · 240 pts
SeverityFileLineSnippetContext
MEDIUMcrates/ai-memory-web/tests/routes.rs179// ── /web HTML chrome for multi-user attribution ──────────────────────COMMENT
MEDIUMcrates/ai-memory-web/tests/routes.rs2494// ── Part A: Cache-Control + ETag tests ─────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-cli/tests/autoscope_env.rs231// ─── Boundary-value cases for the numeric fields ──────────────────────COMMENT
MEDIUMcrates/ai-memory-cli/src/commands/serve.rs2915 // ── Part B: CORS validation tests ──────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-cli/src/commands/hook_capture.rs913 // ── install-time default strategy (#128), no marker required ──────COMMENT
MEDIUMcrates/ai-memory-cli/src/commands/hook_capture.rs913 // ── install-time default strategy (#128), no marker required ──────COMMENT
MEDIUMcrates/ai-memory-cli/src/commands/install_hooks.rs5127 // ── #issue project-strategy preservation on re-apply ─────────────COMMENT
MEDIUMcrates/ai-memory-cli/src/commands/install_hooks.rs5127 // ── #issue project-strategy preservation on re-apply ─────────────COMMENT
MEDIUMcrates/ai-memory-cli/src/commands/install_hooks.rs5341 // ── P1.8 validate_as_user ────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-cli/src/commands/render_shared.rs2895 // ── install-time --project-strategy baking (#128) ────────────────COMMENT
MEDIUMcrates/ai-memory-cli/src/commands/render_shared.rs2895 // ── install-time --project-strategy baking (#128) ────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_multiuser.rs346// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_multiuser.rs350// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_multiuser.rs496// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_multiuser.rs503// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_multiuser.rs557// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_multiuser.rs561// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs388// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs390// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs449// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs451// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs544// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs552// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs642// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs644// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs729// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs731// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs794// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs796// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs855// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs869// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs1055// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/tests/autoscope_stress.rs1070// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-mcp/src/admin.rs9449 // ── user-management endpoints (P1.4) ──────────────────────────COMMENT
MEDIUMcrates/ai-memory-core/src/user.rs225 // ── username validation ───────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-core/src/user.rs289 // ── email validation ──────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-core/src/user.rs346 // ── NewUser::validate normalisation ───────────────────────────COMMENT
MEDIUMcrates/ai-memory-core/src/active_project.rs1039 // ────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-core/src/active_project.rs1054 // ────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-llm/src/openai_compat.rs367 // ── strip_reasoning_blocks ───────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-wiki/src/wiki.rs3788 // ── P1.6: write attribution ─────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-store/src/users.rs117// ── SQL ops ────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-store/src/users.rs299// ── helpers ────────────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-store/src/reader.rs6843 // ── user lookups ────────────────────────────────────────────────COMMENT
MEDIUMcrates/ai-memory-hooks/src/router.rs12074 // ── derive_open_questions heuristic tests ─────────────────────────────COMMENT
MEDIUMcrates/ai-memory-consolidate/tests/lifecycle.rs168 // ── Phase 1 — bootstrap a fresh wiki + store ─────────────────COMMENT
MEDIUMcrates/ai-memory-consolidate/tests/lifecycle.rs213 // ── Phase 3 — time-travel via direct SQL ────────────────────COMMENT
MEDIUMcrates/ai-memory-consolidate/tests/lifecycle.rs260 // ── Phase 5 — real sweep; verify row counts ─────────────────COMMENT
MEDIUMcrates/ai-memory-consolidate/tests/lifecycle.rs332 // ── Phase 6 — FTS5 invariants ───────────────────────────────COMMENT
MEDIUMcrates/ai-memory-consolidate/tests/lifecycle.rs452 // ── Phase 8 — retention scores ordering sanity check ────────COMMENT
MEDIUMcrates/ai-memory-consolidate/src/lint.rs681 // ── LintFinding tolerant deserialization ─────────────────────────────COMMENT
MEDIUMcrates/ai-memory-consolidate/src/lint.rs709 // ── use_llm=false skips contradiction pass ───────────────────────────COMMENT
MEDIUMdocker/compose.tls.cloudflared.yml75# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMdocker/compose.tls.cloudflared.yml77# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMdocker/compose.tls.cloudflared.yml93# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMdocker/compose.tls.cloudflared.yml95# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMdocker/compose.tls.caddy.yml70# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMdocker/compose.tls.caddy.yml72# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMdocker/compose.tls.caddy.yml88# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMdocker/compose.tls.caddy.yml90# ──────────────────────────────────────────────────────────────────────COMMENT
18 more matches not shown…
AI Slop Vocabulary10 hits · 30 pts
SeverityFileLineSnippetContext
MEDIUMCargo.toml14 # Live A/B harness — not part of the shipped binary, but inCOMMENT
MEDIUMcrates/ai-memory-web/src/markdown.rs36 // robust hook. Code (fenced + inline) is skipped so `[[…]]` stays literalCOMMENT
MEDIUMcrates/ai-memory-store/src/ops.rs2150 // path-boundary match robust to trailing slash/backslash drift.COMMENT
MEDIUMdocker/multiuser-test/compose.yml8# The unproxied port is deliberately exposed: it is how the harness checks thatCOMMENT
MEDIUMhooks/_lib.sh103# Extract a harness-native session id from the common hook payload spellings.COMMENT
MEDIUMscripts/managed-workstream-acceptance.sh2# Manual, opt-in acceptance test for managed cross-harness workstreams.COMMENT
MEDIUMscripts/managed-workstream-acceptance.sh3# This is intentionally not called by CI: the real-harness phase uses theCOMMENT
MEDIUMscripts/managed-workstream-acceptance.sh122# the harness produced new portable evidence, and any assigned context deltaCOMMENT
MEDIUMscripts/managed-workstream-acceptance.sh507# native session in any auto-detected harness.COMMENT
MEDIUMscripts/managed-workstream-acceptance.sh521# The harness list in this message grows as adapters join the automaticCOMMENT
Modern AI Meta-Vocabulary11 hits · 29 pts
SeverityFileLineSnippetContext
MEDIUMcrates/ai-memory-cli/templates/config.default.toml155# differ by provider and model. Their sum must fit the model's context window;COMMENT
MEDIUMcrates/ai-memory-hooks/src/router.rs1569/// injects nothing rather than an empty scaffold.COMMENT
MEDIUMdocs/ARCHITECTURE.md538 # their sum must fit the model context window;COMMENT
MEDIUMdocs/companion-crates.md210├── crates/server/ # auth, CSRF, mutation broker, LLM orchestrationCODE
MEDIUMdocs/install.md1685#### Match the consolidation budget to a local model's context windowCOMMENT
MEDIUMdocs/install.md1694# e.g. a model loaded with an 8k context windowCOMMENT
MEDIUMdocs/marker-file.md62# captures. A multi-agent harness fans one goal out to many subagentCOMMENT
MEDIUMdocs/issues-mempalace.md119- **#1561** - "persist and verify embedding model metadata in palaceCODE
MEDIUMdocs/issues-mempalace.md124- **#1563 / #1261** - embedding model is hardcoded to all-MiniLM-L6-v2; usersCODE
MEDIUMdocs/issues-mempalace.md180| #1561/#1563 - no stored embedding model identity; drift on model change | **#8 `{provider, model, dim}` stored next toCODE
MEDIUMdocs/llm-provider-comparison.md370## Run 3 - tightened anti-hallucination system promptCOMMENT
Verbosity Indicators2 hits · 3 pts
SeverityFileLineSnippetContext
LOWcrates/ai-memory-mcp/src/admin.rs3738 // Step 3: execute the rename. The writer validates the name andCOMMENT
LOWcrates/ai-memory-mcp/src/admin.rs3759 // Step 4: count is_latest pages that now belong to the renamed project.COMMENT
Structural Annotation Overuse2 hits · 3 pts
SeverityFileLineSnippetContext
LOWcrates/ai-memory-mcp/src/admin.rs3738 // Step 3: execute the rename. The writer validates the name andCOMMENT
LOWcrates/ai-memory-mcp/src/admin.rs3759 // Step 4: count is_latest pages that now belong to the renamed project.COMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWcrates/ai-memory-consolidate/tests/lifecycle.rs406 // the "don't forget too fast" property explicit — searching for aCOMMENT
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWscripts/install-hooks.sh8# Usage:COMMENT
Fake / Example Data1 hit · 1 pts
SeverityFileLineSnippetContext
LOWcrates/ai-memory-hooks/src/router.rs3735 .unwrap_or_else(|_| git2::Signature::now("test", "test@test.com").unwrap());CODE
Unused Imports1 hit · 1 pts
SeverityFileLineSnippetContext
LOWdocs/examples/auto-improve-eval/score_proposal.py13CODE