Skip to content

Conversation

@abrookins
Copy link
Collaborator

Summary

This PR enhances the long-term memory search functionality by implementing a more robust filtering system that leverages proper filter objects in both the API and MCP interfaces.

Changes

  • Improved API Type Safety: Updated SearchPayload to use filter objects (SessionId, Namespace, etc.) directly as fields instead of primitive types
  • Comprehensive Query Support: Added support for complex filtering operations across all filter types:
    • Tag filters (session_id, namespace, topics, entities, user_id)
      • Equal to/not equal to specific values
      • Contains any/all of specified values
    • Numeric filters (created_at, last_accessed)
      • Greater than/less than
      • Greater than or equal to/less than or equal to
      • Equal to/not equal to
      • Between two values
  • Simplified API/MCP Integration: Created create_with_primitives method to enable easy construction of filter objects from primitive values
  • Enhanced MCP Tool Interface: Expanded MCP tool with comprehensive filtering parameters while maintaining backward compatibility
  • Updated Tests: Added test coverage for all new filtering capabilities

Motivation

Previously, the filtering functionality was limited and didn't fully leverage the filter objects defined in filters.py. This update provides a more powerful, type-safe, and flexible filtering mechanism that simplifies complex queries.

@abrookins abrookins requested a review from Copilot April 9, 2025 21:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

abrookins and others added 5 commits April 9, 2025 17:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@abrookins
Copy link
Collaborator Author

Tools CAN use BaseModels for parameter type checking, same as FastAPI path operations. Refactor incoming.

@abrookins abrookins marked this pull request as ready for review April 11, 2025 17:43
@abrookins abrookins merged commit 25e3149 into main Apr 11, 2025
3 checks passed
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