LearnNewsExamplesServices
Frontmatter
titleAdd MCP read and query endpoints
authorAki-07
stateMerged
createdAtOct 11, 2025, 5:06 PM
updatedAtOct 11, 2025, 8:06 PM
closedAtOct 11, 2025, 8:06 PM
mergedAtOct 11, 2025, 8:06 PM
branchesdevfeat/read-apis
urlhttps://github.com/neomjs/neo/pull/7463
Merged
Aki-07
Aki-07 commented on Oct 11, 2025, 5:06 PM

Please make sure to read the Contributing Guidelines: https://github.com/neomjs/neo/blob/dev/CONTRIBUTING.md

Fixes #7408 #7409

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • It's submitted to the dev branch, not the main branch
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Summary

  • add GET /memories backed by Chroma listMemories service with pagination
  • add GET /summaries backed by listSummaries service returning metadata & docs
  • keep responses aligned with MemoryCoreMcpApi design to unblock search + admin work
  • Extends the Memory MCP service with semantic search: wraps Gemini embeddings in textEmbeddingService.mjs, reuses chromaManager, and augments both route handlers to expose POST /memories/query and POST /summaries/query. (ai/mcp/server/memory/services/textEmbeddingService.mjs:1, ai/mcp/server/memory/services/memoryService.mjs:1, ai/mcp/server/memory/services/summaryService.mjs:1, ai/mcp/server/memory/routes/memories.mjs:1, ai/mcp/server/memory/routes/summaries.mjs:1)
  • Each endpoint validates input, optionally filters by session/category, calls Chroma’s query, and returns relevance metadata (distance + normalized score) in the shape defined by openapi.yaml.
tobiu
tobiu commented on Oct 11, 2025, 8:06 PM

thx for your contribution, accepted.

✦ PR Review: ticket-implement-memory-query-endpoints & ticket-implement-memory-read-endpoints

This PR correctly implements both tickets' functionality, adding core read/query capabilities for memories and summaries.

Key Observations:

  • Endpoint Implementation: Routes in memories.mjs and summaries.mjs are well-defined, with clean logic and proper request validation, following our established async/service pattern.
  • Service Layer: memoryService.mjs and summaryService.mjs effectively abstract ChromaDB interactions. list functions handle data fetching/pagination correctly, while query functions perform semantic searches and calculate a relevanceScore.
  • Code Quality: The code is clean, well-documented, and maintains a consistent style with excellent separation of concerns.
  • Error Handling: Input validation is robust, with clear error messages and appropriate status codes.

Conclusion:

This is a high-quality, robust PR that's ready for merging. Excellent work.

Follow-up Opportunity:

I've created a follow-up ticket for minor refinements at ticket-refine-memory-server-endpoints.md. It's an optional task if you'd like to continue contributing.