# Market Scan — AI Agent Memory / Drift / Context (2026-06-26)

> Refresh of the competitive landscape. The 2026-06-25 STRATEGY.md scan ("9 agents,
> 6 rivals") concluded CAI-as-product was dead and pivoted to internal-tool. **This
> scan revisits that** under a new directive: competing with mex on breadth is fine —
> mex is not a bigger tool than CAI. So this is a real market analysis, not a retreat.

## The landscape splits into three layers

1. **Native platform** — Claude Code CLAUDE.md + auto-memory + **compaction** +
   client-side **memory-tool** (just-in-time retrieval). Claude-only. Absorbs the
   "memory that loads itself" story.
2. **Memory / recall tools** — the crowded, high-star layer. Capture sessions →
   compress → inject. Competing on *retrieval quality and token efficiency*.
3. **Drift / governance tools** — verify that committed context stays honest. The
   sparse layer. **This is CAI's home.**

## The players

| Tool | Stars | What it is | Layer | GUI |
|---|---|---|---|---|
| **agentmemory** (rohitg00) | ~24.1k | Benchmarked memory: BM25+vector+KG hybrid, 4-tier consolidation, Ebbinghaus decay, 18+ agents | Memory | Yes (3113/3114, session replay, KG viz) |
| **claude-mem** (thedotmack) | ~84.3k | 5 lifecycle hooks → AI semantic summaries → SQLite+Chroma, 3-layer progressive disclosure (~10× token saving) | Memory | Yes (web viewer :37777) |
| **mex** (theDakshJaitly) | ~1.1k | **CAI's direct ancestor.** Scaffold + 11 drift checkers + TUI + heartbeat + event-log + timeline + telemetry. v0.6.2 | Drift+memory | Yes (TUI) |
| **AIAgentMinder** | small | Governance: per-turn `context-monitor.sh` → `.context-usage`, warn at limit, `/handoff` writes "Next Session" block, scope-check vs roadmap | Governance | No (CC slash cmds) |
| **ctx-drift** | skill | CC skill: structural + **semantic** drift (outdated conventions, superseded decisions), permission drift. LLM-based | Drift | No |
| **Claude native** | — | CLAUDE.md + auto-memory + compaction + memory-tool | Platform | — |

## Where our brainstorm ideas already exist (be honest)

| Our idea (from opportunity-engine.md) | Already shipped by | Maturity |
|---|---|---|
| Session watchdog (live ctx %) + handoff | **AIAgentMinder** (`context-monitor.sh` + `/handoff`); native **compaction** | Shipped |
| Condense brief / compress-and-carry | **claude-mem** (AI summaries), **agentmemory** (4-tier consolidation), native compaction | Shipped, mature |
| Repeated command → skill | **`rtk discover`** (local, with savings estimate) | Shipped |
| Fail→fix pattern | **`rtk learn`** | Shipped |
| Graph visualization | **agentmemory** (KG viz), **mex** (TUI) | Shipped |
| Token-saving as headline metric | **agentmemory** (real benchmarks), **claude-mem** | Measured |

## The genuine white space — what NOBODY does

Confirmed across the high-star tools (agentmemory, claude-mem) and the drift tools:

> **No tool does proactive *opportunity detection*** — "you have done X repeatedly /
> this knowledge is re-derived every session → here is a concrete structural change
> (extract a skill, anchor this in context/, prune this) that will save N tokens."

What the memory tools actually do is **dedup + recall**: SHA-256 dedup of repeated
actions (agentmemory), `/remember` + `/recall` slash commands. That is *storing and
fetching*, not *recommending a workflow change*. The closest neighbour is
`rtk discover` — but only at the **command** level, never the **scaffold/knowledge**
level.

So the two-sentence positioning that survives this scan:

- **The memory tools make recall cheap. CAI makes the *project structure* honest and
  suggests how to *condense* it.**
- CAI's moat is being **scaffold-aware + deterministic + CI-runnable + committed +
  multi-tool** — and, newly, the **only tool that turns observed waste into a
  structural suggestion**, not just a stored memory.

## Strategic read (vs the old STRATEGY.md)

- The old doc's §8 fear ("rebuilding mex feature-by-feature = lose the plot") is
  **partially overruled by the new directive**: breadth vs mex is allowed.
- BUT the scan adds a sharper fear the old doc didn't have: the **memory layer is a
  84k-star red ocean** (claude-mem) with real benchmarks. CAI should **not** try to
  out-recall agentmemory/claude-mem — that fight is lost on day one.
- The defensible expansion is **into the empty quadrant**: proactive,
  scaffold-grounded, savings-quantified *suggestions* + deterministic drift. That is
  breadth, but breadth **away from** the crowded memory layer, not toward it.

## Signal vs. noise — what to actually take, what to ignore

Much of the high-star marketing is overselling. Filtering for substance CAI can use.

### claude-mem (~84k★)
- **Noise:** the star count (a memory tool riding the Claude Code wave ≠ 84k active
  users); "~10× token savings" measured against the worst strawman (dump everything).
- **Signal worth stealing:**
  - **Progressive disclosure** — index (~50–100 tok) → timeline → full detail only
    for filtered hits. CAI's ROUTER→context→pattern navigation is *the same idea*;
    validates the scaffold thesis. Worth naming explicitly and measuring.
  - **Lifecycle hooks as the capture surface** (SessionStart/Stop/PostToolUse). If
    CAI ever observes behaviour, this is the proven plumbing — reuse, don't invent.
- **Take:** borrow the disclosure framing for `cai bench`; reuse hook plumbing if/when
  we observe. Ignore the recall engine entirely.

### agentmemory (~24k★)
- **Noise:** "#1 based on real-world benchmarks", "P@5 math ceiling" — self-selected
  corpus, self-graded. Treat the specific numbers as unverified.
- **Signal worth stealing:**
  - **Honest measurement *method*** — recall@k, MRR, cost/year, median latency,
    stated baseline. This is *how* to report `cai bench` credibly (median + variance +
    named baseline), regardless of their numbers.
  - **4-tier consolidation** (working→episodic→semantic→procedural) is a clean mental
    model for *what belongs where* in the scaffold (transient vs. context/ vs. pattern).
- **Take:** copy the measurement rigor and the tiering vocabulary. Ignore the KG/vector
  machinery — it's recall, the red ocean.

### mex (~1.1k★) — our ancestor
- **Noise:** v0.3 "operational memory layer" (TUI/heartbeat/event-log) is breadth for
  breadth; telemetry is product-shaping, not capability.
- **Signal worth stealing:**
  - **`heartbeat`** — a *cheap, continuous* check (reads `last_updated` + cleanup
    metadata, prints `HEARTBEAT_OK` or flags). Lighter than full `cai check`; good fit
    for a pre-commit / cron pulse. Genuinely useful, low cost.
  - **`doctor`** — one-shot health summary. Cheap to add, good UX.
  - Negated-section handling (already in CAI from mex) — proven false-positive guard.
- **Take:** `cai heartbeat` (cheap pulse) and maybe `cai doctor` are low-cost, on-moat.
  Skip TUI/event-log/timeline unless a real need appears.

### AIAgentMinder
- **Signal worth stealing:**
  - **`/handoff` → "Next Session" block** (decisions / next step / blockers) is the
    *concrete shape* of our condense-brief. Three fields, that's it. Don't over-design.
  - **scope-check vs roadmap** — drift detection applied to *intent*, not just files.
    Adjacent to CAI's checkers; a possible future "scope drift" checker.
- **Take:** adopt the 3-field handoff shape verbatim if we build the brief. Note the
  scope-drift idea for later.

### ctx-drift
- **Signal worth stealing:** the **structural-vs-semantic split**. CAI is pure
  structural (deterministic, zero-token — the moat). Semantic drift (outdated
  conventions, superseded decisions) is the *one* thing CAI deliberately does NOT do,
  because it needs an LLM. Worth stating as an explicit boundary, not a gap.
- **Take:** keep CAI structural-only as a *feature*; let the LLM-judgment layer be
  someone else's (or a clearly-separated optional mode). Don't blur the moat.

### Net distillation — the short list CAI actually adopts
1. **`cai bench`** with credible method (median+variance, named baseline, progressive-
   disclosure framing). *The honesty play; nobody else measures the scaffold itself.*
2. **`cai heartbeat`** — cheap continuous pulse (from mex, on-moat).
3. **Condense-brief = 3 fields** (decisions / next step / blockers), if/when built.
4. **Hook plumbing reuse** (claude-mem pattern) only if we add observation.
5. **Explicit boundary:** structural-only, deterministic. Semantic/recall is *theirs*.
6. **The empty quadrant stays the bet:** observed-waste → structural suggestion.

Everything else (recall engines, vector/KG, TUI, event timelines, star-chasing) is
either noise or red-ocean. Not adopted.

## Open data gaps
- ctx-drift exact mechanics (page rate-limited; revisit).
- Whether mex has any suggestion/opportunity feature beyond logging (scan says no).
- Real token numbers for CAI's own scaffold (still unmeasured — `cai bench` would
  settle it; agentmemory/claude-mem have set the bar for *how* to measure).

## Sources
- agentmemory: github.com/rohitg00/agentmemory
- claude-mem: github.com/thedotmack/claude-mem
- mex: github.com/theDakshJaitly/mex (releases through v0.6.2)
- AIAgentMinder: github.com/lwalden/AIAgentMinder
- ctx-drift: mcpmarket.com/tools/skills/context-drift-detector
- Claude native memory: code.claude.com/docs/en/memory, platform.claude.com/docs/.../memory-tool
