-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Add expansion filtering params for noise reduction #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
New recall_memory parameters: - expand_min_importance: Filter expanded results by importance (0-1) - expand_min_strength: Only follow relations with strength >= threshold (0-1) These are pass-through params - server-side implementation required. Addresses noise issue where expand_relations returned too many low-relevance memories. Updated: types.ts, index.ts inputSchema, automem-client.ts, CHANGELOG.md
📝 WalkthroughWalkthroughThe changes add expansion filtering parameters ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/index.ts (1)
374-377: Align tag_match default description with documented best practicesThe
tag_matchdescription says"exact" ... (default)but the coding guidelines indicatetag_match=prefixshould be the default for namespace-style tags (e.g.,slack:*). Consider updating this description (or the actual default behavior, if it changed intentionally) so they stay in sync.Based on learnings, the preferred default is
prefixfor recall.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/ci.yml(1 hunks)CHANGELOG.md(1 hunks)src/automem-client.ts(1 hunks)src/index.ts(1 hunks)src/types.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Use TypeScript for implementation. Compile TypeScript to JavaScript in thedist/directory usingnpm run build
When queuing or storing a memory from hooks or tools, set a single top-leveltimestampin ISO 8601 UTC format. Do not setmetadata.timestampand do not add date-derived tags.
Use precise, namespace-style tags (e.g.,slack/channel-ops) instead of free-form text tags when storing memories.
Files:
src/index.tssrc/automem-client.tssrc/types.ts
src/index.ts
📄 CodeRabbit inference engine (CLAUDE.md)
src/index.ts: Define tool schema intoolsarray insrc/index.tswithinputSchema. Add handler inCallToolRequestSchemaswitch statement. Add corresponding method toAutoMemClientif API call needed. Updatesrc/types.tswith new argument types when adding a new MCP tool.
For memory recall, preferrecall_memorytool withtagsand optionally aquery. Usetag_mode=anyandtag_match=prefixas defaults (supports namespaces likeslack:*). Specifytag_mode=allto require all tags ortag_match=exactfor strict matches.
Relationships between memories support 11 types: RELATES_TO, LEADS_TO, OCCURRED_BEFORE, PREFERS_OVER, EXEMPLIFIES, CONTRADICTS, REINFORCES, INVALIDATED_BY, EVOLVED_INTO, DERIVED_FROM, and PART_OF. Useassociate_memoriestool to create these relationships.
Files:
src/index.ts
src/automem-client.ts
📄 CodeRabbit inference engine (CLAUDE.md)
Implement HTTP client methods for AutoMem API in
src/automem-client.ts. Handle response field mapping for memory IDs (may bememory_id,id, or nested) and timestamps (timestamp,created_at, orupdated_at).
Files:
src/automem-client.ts
src/types.ts
📄 CodeRabbit inference engine (CLAUDE.md)
Store all TypeScript type definitions, interfaces for configurations, arguments, and results in
src/types.ts
Files:
src/types.ts
CHANGELOG.md
📄 CodeRabbit inference engine (CLAUDE.md)
Update
CHANGELOG.mdwith changes before publishing. Document version changes inpackage.json, ensurenpm run buildsucceeds, passnpm test, and verify file references beforenpm publish.
Files:
CHANGELOG.md
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: verygoodplugins/mcp-automem PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T18:19:58.813Z
Learning: Applies to src/index.ts : For memory recall, prefer `recall_memory` tool with `tags` and optionally a `query`. Use `tag_mode=any` and `tag_match=prefix` as defaults (supports namespaces like `slack:*`). Specify `tag_mode=all` to require all tags or `tag_match=exact` for strict matches.
📚 Learning: 2025-12-02T18:19:58.813Z
Learnt from: CR
Repo: verygoodplugins/mcp-automem PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T18:19:58.813Z
Learning: Applies to src/index.ts : Define tool schema in `tools` array in `src/index.ts` with `inputSchema`. Add handler in `CallToolRequestSchema` switch statement. Add corresponding method to `AutoMemClient` if API call needed. Update `src/types.ts` with new argument types when adding a new MCP tool.
Applied to files:
src/index.ts
📚 Learning: 2025-12-02T18:19:58.813Z
Learnt from: CR
Repo: verygoodplugins/mcp-automem PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T18:19:58.813Z
Learning: Applies to src/index.ts : For memory recall, prefer `recall_memory` tool with `tags` and optionally a `query`. Use `tag_mode=any` and `tag_match=prefix` as defaults (supports namespaces like `slack:*`). Specify `tag_mode=all` to require all tags or `tag_match=exact` for strict matches.
Applied to files:
src/index.tssrc/automem-client.tssrc/types.ts
📚 Learning: 2025-12-02T18:19:58.813Z
Learnt from: CR
Repo: verygoodplugins/mcp-automem PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T18:19:58.813Z
Learning: Applies to src/automem-client.ts : Implement HTTP client methods for AutoMem API in `src/automem-client.ts`. Handle response field mapping for memory IDs (may be `memory_id`, `id`, or nested) and timestamps (`timestamp`, `created_at`, or `updated_at`).
Applied to files:
src/automem-client.ts
📚 Learning: 2025-12-02T18:19:58.813Z
Learnt from: CR
Repo: verygoodplugins/mcp-automem PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T18:19:58.813Z
Learning: The MCP AutoMem server translates MCP tool calls into AutoMem API requests. It provides memory management for AI assistants with storage, hybrid search, and relationship support using FalkorDB and Qdrant.
Applied to files:
CHANGELOG.md
🔇 Additional comments (5)
.github/workflows/ci.yml (1)
3-61: Formatting-only changes appear unrelated to PR objective.The CI workflow file contains only indentation and spacing adjustments with no semantic changes to triggers, steps, or behavior. However, this file is orthogonal to the PR's stated objective of adding
expand_min_importanceandexpand_min_strengthparameters to the recall_memory API.This suggests the formatting changes may have been applied by an automated tool or formatter and bundled with the feature work. Consider whether this cleanup should be:
- In a separate formatting/maintenance PR, or
- Explained as part of a broader code quality effort (e.g., linting fixes)
Please confirm whether these formatting changes are intentional and whether they align with your project's code style standards (e.g., via a linter or formatter configuration).
src/automem-client.ts (1)
144-151: Expansion filtering params correctly forwarded in recallMemoryThe new
expand_min_importanceandexpand_min_strengthquery params are wired through cleanly and only sent when numeric, preserving existing behavior when omitted. Naming matches the types and tool schema.src/types.ts (1)
110-112: RecallMemoryArgs extensions are consistent and minimalThe added
expand_min_importance?andexpand_min_strength?fields are typed appropriately and align with client and tool schema usage for expansion filtering.src/index.ts (1)
405-416: New recall_memory expansion filters are well-specified
expand_min_importanceandexpand_min_strengthare exposed with clear 0–1 bounds and descriptions, matching the TypeScript types and client behavior, while leaving defaults to the server as described.CHANGELOG.md (1)
5-29: Changelog accurately captures expansion filtering additionsThe Unreleased 0.9.0 notes correctly describe the new expansion filtering parameters, their intent (noise reduction), and the client/type updates, including the requirement for a server update. This is consistent with the code changes.
New recall_memory parameters:
These are pass-through params - server-side implementation required. Addresses noise issue where expand_relations returned too many low-relevance memories.
Updated: types.ts, index.ts inputSchema, automem-client.ts, CHANGELOG.md