Overview
Generate a stabletopic_key that allows evolving topics (like architecture decisions) to update a single observation over time instead of creating duplicates. The tool analyzes the type, title, and content to suggest a normalized, cross-session key.
This tool is part of the agent profile and uses deferred loading to optimize performance.
Parameters
Observation type/category (e.g., architecture, decision, bugfix, pattern)Recognized types that map to topic families:
architecture,design,adr,refactor→architecture/*bug,bugfix,fix,incident,hotfix→bug/*decision→decision/*pattern,convention,guideline→pattern/*config,setup,infra,infrastructure,ci→config/*discovery,investigation,root_cause→discovery/*learning,learn→learning/*session_summary→session/*
Observation title (preferred input for stable keys)The title is the primary source for generating the topic segment. It’s normalized by:
- Converting to lowercase
- Removing special characters
- Replacing spaces with hyphens
- Stripping private tags (anything in
[brackets])
Observation content (used as fallback if title is empty)If no title is provided, the first 8 words of the content are used to generate the topic segment.
Response
Suggested topic key in the format
family/segment{family}/{normalized-segment}
Examples:
architecture/jwt-auth-modelbug/fts5-query-sanitizationpattern/structured-memory-formatconfig/sqlite-fts5-setup
Topic Key Generation Logic
1. Infer Topic Family
The algorithm first determines the topic family based on:- The
typeparameter (if it matches a known category) - Keywords in the
titleandcontent(if type doesn’t match) - Defaults to
"topic"if no match
2. Normalize Segment
From the title (or content fallback):- Strip private tags in
[brackets] - Convert to lowercase
- Replace spaces and special chars with hyphens
- Remove redundant family prefix (e.g., “bug-” from segment if family is “bug”)
- Default to
"general"if empty
3. Combine
Returns{family}/{segment}
Usage Examples
Architecture Decision
Bug Fix
Pattern Without Type
Fallback to Content
When to Use
- Before
mem_save: When you want evolving topics to update a single observation - Architectural decisions: Track how decisions evolve over time
- Ongoing bugs: Update the same memory as investigation progresses
- Living documentation: Keep a single observation for patterns or conventions
Workflow
Related Tools
mem_save- Save or upsert observations with topic keysmem_update- Update observations by ID