Skip to content

feat(context): mode-aware axme_decisions/axme_memories + active KB triggers#127

Merged
George-iam merged 1 commit intomainfrom
feat/mode-aware-decisions-memories-20260429
Apr 29, 2026
Merged

feat(context): mode-aware axme_decisions/axme_memories + active KB triggers#127
George-iam merged 1 commit intomainfrom
feat/mode-aware-decisions-memories-20260429

Conversation

@George-iam
Copy link
Copy Markdown
Contributor

Summary

  • axme_decisions and axme_memories now adapt output to config.context.mode — full mode unchanged, search mode returns a catalog (id/slug + title + ≤200-char description). Closes a v0.5.0 regression where these tools silently loaded full bodies in search mode, erasing the ~10× token saving.
  • axme_oracle unchanged — always full bodies (stack/structure/patterns/glossary are connected docs, not catalog entries).
  • buildSearchModeInstructions gained an "Active KB usage" block with concrete trigger predicates so the agent calls axme_search_kb / axme_get_* proactively (was: generic "useful for fuzzy lookups").

Why

In a session started today on this repo with context.mode: search, the model loaded the catalog via axme_context (page 2) and then immediately called axme_decisions / axme_memories because the unified startup instruction asked for "in parallel" loads — the tools returned full bodies, defeating the whole point of search mode. User pointed it out and asked for a reliable, mode-aware fix instead of additional prompt text.

Design (per discussion in this session):

  • Server-side gate inside the tools themselves (single source of truth = config). Instructions stay unified across modes.
  • Tools detect mode and produce the right shape. No bans, no agent-side branching.
  • Active-usage triggers in the search-mode instruction make the agent reach for search proactively when the situation matches a recognizable predicate.

Test plan

  • npm test — 542/542 (was 536, +6 new in test/context.test.ts)
  • npx tsc --noEmit clean
  • npm run build clean
  • Manual: open a session with context.mode: search, call axme_decisions → catalog only; flip to full → bodies. Done in a follow-up window after merge.

Notes

CHANGELOG entry added under [Unreleased] (no version bump in this PR — bundle into next release per D-045 batch policy).

Includes a small KB cleanup as part of the same effort:

  • Q-003 answered (auditor flagged 102 MB → 773 MB transformers.js size discrepancy).
  • Stale memory transformers-js-install-size-is-102mb deleted (B-005 shipped, lazy-install pattern now in code, memory was historical noise).

🤖 Generated with Claude Code

…iggers

axme_decisions and axme_memories now read config.context.mode and switch
output shape: full → bodies (existing behaviour), search → compact catalog
(id/slug + title + ≤200-char description). Closes the regression in v0.5.0
where these tools silently re-loaded every body in search mode and erased
the ~10× session-start token saving.

axme_oracle is unchanged — always full, because stack/structure/patterns/
glossary are connected documents and don't fit the catalog shape.

buildSearchModeInstructions gained an "Active KB usage" block with
concrete trigger predicates ("how did we…", touching git/safety/hooks
subsystems, mentioning a library by name, before architectural advice,
before saving a new entry). Replaces the generic "use search for fuzzy
lookups" hint with imperative MUSTs tied to situations the agent can
recognize in the user's task text.

Tests: +6 (542 total). Builds clean. tsc clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> #!axme pr=none repo=AxmeAI/axme-code
@George-iam George-iam merged commit 03d0994 into main Apr 29, 2026
6 checks passed
@George-iam George-iam deleted the feat/mode-aware-decisions-memories-20260429 branch April 29, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant