Skip to content

Conversation

@jack-arturo
Copy link
Member

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

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
@coderabbitai
Copy link

coderabbitai bot commented Dec 4, 2025

📝 Walkthrough

Walkthrough

The changes add expansion filtering parameters (expand_min_importance and expand_min_strength) to the recall memory API across the type definitions, client implementation, and tool schema. The parameters are optional numeric fields (0–1 range) that allow filtering during memory expansion. Recall output is also updated with new metadata fields and renamed properties to reflect deduplication and expansion details.

Changes

Cohort / File(s) Summary
Type and schema definitions
src/types.ts, src/index.ts
Added expand_min_importance and expand_min_strength optional numeric properties to RecallMemoryArgs with 0–1 range constraints; properties define thresholds for expansion filtering.
Client implementation
src/automem-client.ts
Updated recallMemory() to pass new expansion filtering parameters as query parameters to the backend when provided.
Documentation
CHANGELOG.md
Documented API changes including new filtering parameters, output field renaming (memories → results), dedup_removed field addition, and RecallResult interface extension with expansion metadata.
CI configuration
.github/workflows/ci.yml
Adjusted YAML indentation and spacing in workflow triggers and job definitions; no semantic logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Note: CHANGELOG documents several output-level changes (dedup_removed field, output renaming, RecallResult extensions) that do not appear in the provided code diffs; verify these changes exist in related files or clarify scope.
  • Confirm parameter passing through client correctly forwards optional numeric fields to backend query string.
  • Validate 0–1 range constraints on new numeric properties are enforced consistently across type definitions and schema.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding expansion filtering parameters to reduce noise in recall results.
Description check ✅ Passed The description clearly explains the new parameters, their purpose (noise reduction), and lists the affected files, directly relating to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/expansion-filtering

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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 practices

The tag_match description says "exact" ... (default) but the coding guidelines indicate tag_match=prefix should 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 prefix for recall.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97e8d0f and 2c1058e.

📒 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 the dist/ directory using npm run build
When queuing or storing a memory from hooks or tools, set a single top-level timestamp in ISO 8601 UTC format. Do not set metadata.timestamp and 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.ts
  • src/automem-client.ts
  • src/types.ts
src/index.ts

📄 CodeRabbit inference engine (CLAUDE.md)

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.
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.
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. Use associate_memories tool 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 be memory_id, id, or nested) and timestamps (timestamp, created_at, or updated_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.md with changes before publishing. Document version changes in package.json, ensure npm run build succeeds, pass npm test, and verify file references before npm 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.ts
  • src/automem-client.ts
  • src/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_importance and expand_min_strength parameters 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:

  1. In a separate formatting/maintenance PR, or
  2. 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 recallMemory

The new expand_min_importance and expand_min_strength query 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 minimal

The added expand_min_importance? and expand_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_importance and expand_min_strength are 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 additions

The 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.

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.

2 participants