Skip to content

Cap search results and ingest batches at 200 - #223

Merged
jgpruitt merged 1 commit into
mainfrom
reduce-search-results-200
Oct 16, 2026
Merged

jgpruitt merged 1 commit into
mainfrom
reduce-search-results-200

Conversation

@jgpruitt

Copy link
Copy Markdown
Collaborator

Summary

  • Reduce the public search result limit from 1,000 to 200; keep the API default of 10 and hybrid candidate cap of 1,000 per arm.
  • Update the web search default and result-limit control, CLI/MCP export defaults, and pack-listing requests to fit the new cap.
  • Reduce memory.batchCreate to 200 memories and automatically chunk CLI/MCP imports and pack installation at 200, preserving the 768 KiB byte budget.
  • Update user/design documentation and add search, batch-validation, chunking, and database regression coverage.

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:full passed against local PostgreSQL (typecheck, lint, unit/integration tests, and 33 CLI end-to-end tests).
  • git diff --check passed.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 18:25
@jgpruitt jgpruitt self-assigned this Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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,
@jgpruitt
jgpruitt merged commit babed57 into main Oct 16, 2026
7 checks passed
@jgpruitt
jgpruitt deleted the reduce-search-results-200 branch October 16, 2026 19:27
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