Repository navigation
Cap search results and ingest batches at 200 - #223
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Pack upgrades exceeding 200 memories can leave old content unchanged because cleanup relies on a truncated lookup.
1 open finding
What changed in this PR
Caps public search results and ingest batches at 200 across Memory Engine, while preserving larger internal hybrid candidate pools.
Changes:
- Updates protocol limits, client defaults, and import chunking.
- Preserves the 1,000-candidate hybrid bound and 768 KiB chunk budget.
- Adds regression coverage and updates documentation.
| File | Description |
|---|---|
| packages/web/src/store/filter.ts | Updates default-limit comment. |
| packages/web/src/components/search/AdvancedSearchPanel.tsx | Limits result control to 200. |
| packages/web/src/api/queries.ts | Sets search default to 200. |
| packages/web/src/api/queries.test.ts | Updates default-limit expectations. |
| packages/server/rpc/memory/memory.integration.test.ts | Tests batch boundary and updates search limits. |
| packages/protocol/memory.ts | Enforces 200-item public caps. |
| packages/protocol/memory.test.ts | Tests limits and candidate independence. |
| packages/engine/space/db.ts | Clamps search results to 200. |
| packages/engine/space/db.integration.test.ts | Tests result and candidate bounds. |
| packages/database/space/migrate/idempotent/002_search.sql | Caps hybrid output, preserving candidate retrieval. |
| packages/cli/util.ts | Updates batch-size comment. |
| packages/cli/mcp/server.ts | Updates tool descriptions and export default. |
| packages/cli/mcp/server.test.ts | Updates export expectations. |
| packages/cli/commands/pack.ts | Reduces pack lookup limits. |
| packages/cli/commands/memory.ts | Updates search help and export default. |
| packages/cli/commands/memory-projection.test.ts | Updates export expectation. |
| packages/cli/chunk.ts | Caps import chunks at 200. |
| packages/cli/chunk.test.ts | Tests multi-chunk protocol compliance. |
| docs/typescript-client.md | Documents API caps. |
| docs/search.md | Updates search limits and examples. |
| docs/mcp/me_memory_search.md | Documents search cap. |
| docs/mcp/me_memory_export.md | Documents export default and cap. |
| docs/formats.md | Explains batch cap and automatic splitting. |
| docs/cli/me-pack.md | Documents capped pack listing. |
| docs/cli/me-memory.md | Updates search and export limits. |
| design/memory-schema.md | Documents ingest bounds. |
| design/hnsw-filtered-semantic-search.md | Distinguishes result and candidate bounds. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const existing = await client.memory.search({ | ||
| meta: { pack: { name: packName } }, | ||
| limit: 1000, | ||
| limit: 200, |
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
memory.batchCreateto 200 memories and automatically chunk CLI/MCP imports and pack installation at 200, preserving the 768 KiB byte budget.Compatibility
Requests with search limits or ingest batch sizes above 200 are now rejected by protocol validation. External clients must lower search limits and split larger ingest batches. The shared SQL search helper retains its 1,000-row internal bound so hybrid candidate retrieval is unchanged.
Validation
./bun run check:fullpassed against local PostgreSQL (typecheck, lint, unit/integration tests, and 33 CLI end-to-end tests).git diff --checkpassed.