feat(search): combine temporal filters - #208
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Memory Engine’s temporal search filtering so that multiple temporal predicates can be provided together and are combined with AND semantics end-to-end (protocol → server → engine → SQL), including adding a dedicated contains predicate that can coexist with overlaps.
Changes:
- Switch temporal filter handling from “mutually exclusive mode” to “combine all populated predicates with AND” across the server RPC layer, CLI, and MCP tool surfaces.
- Extend the space search SQL function signatures to accept a new
_temporal_containsargument and apply it as an independent predicate (m.temporal @> point). - Add/adjust integration + projection tests and update user-facing docs to describe conjunctive temporal composition.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/server/rpc/memory/memory.ts | Maps all temporal predicates through to engine filters (adds temporalContains). |
| packages/server/rpc/memory/memory.integration.test.ts | Adds RPC-level test asserting conjunctive temporal predicate behavior. |
| packages/protocol/memory.test.ts | Ensures the protocol schema preserves multiple temporal fields simultaneously. |
| packages/engine/space/types.ts | Adds temporalContains to engine filter types. |
| packages/engine/space/db.ts | Threads temporalContains into search_memory / hybrid_search_memory calls. |
| packages/engine/space/db.integration.test.ts | Adds DB integration test verifying conjunctive temporal filtering (incl. contains + overlaps). |
| packages/database/space/version.ts | Bumps space schema version to reflect the search signature change. |
| packages/database/space/migrate/migrate.integration.test.ts | Updates migration test coverage for upgraded search function signatures. |
| packages/database/space/migrate/idempotent/002_search.sql | Adds _temporal_contains arg + predicate and threads it through hybrid search. |
| packages/cli/mcp/server.ts | Updates MCP tool parameter descriptions to reflect conjunctive temporal behavior. |
| packages/cli/mcp/server.test.ts | Verifies MCP forwarding preserves all temporal filter fields. |
| packages/cli/commands/memory.ts | Refactors CLI temporal flag parsing to build a conjunctive temporal object. |
| packages/cli/commands/memory-projection.test.ts | Verifies CLI preserves/forwards every temporal predicate for search + export. |
| docs/typescript-client.md | Updates TS client example to show composing temporal predicates. |
| docs/search.md | Documents that temporal CLI flags can be combined with AND semantics. |
| docs/mcp/me_memory_search.md | Documents multi-field temporal filters as conjunctive for MCP search tool. |
| docs/mcp/me_memory_export.md | Documents multi-field temporal filters as conjunctive for MCP export tool. |
| docs/concepts.md | Explains that temporal modes can be combined; contradictory predicates yield no results. |
| docs/cli/me-memory.md | Documents that temporal CLI flags can be combined with AND semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing