Add @getzep/zep-mastra integration (Mastra, TypeScript)#525
Merged
Conversation
d26f210 to
17de18a
Compare
Zep memory for Mastra via custom tools (the pattern @mastra/mem0 uses), which preserves Zep's server-side graph retrieval. - createTool factories (bound to a ZepClient): zep-remember (persist), zep-search (graph.search), zep-context (whole-user-graph Context Block via thread.getUserContext). Attach to an Agent's tools record. - Depends on @mastra/core ^1.42.0 and @getzep/zep-cloud ^3.23.0. ESM, NodeNext. - README, SETUP, example, vitest tests, tsup build. CI already routes integrations/mastra/typescript. Verified: tsc --noEmit + vitest (28 passed, 1 skipped) + build. See integrations/SPIKE_FINDINGS.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Apply code-review fixes to @getzep/zep-mastra: - search-tool: extractResults now handles every GraphSearchScope the public type allows (thread_summaries and observations were previously dropped). The branch is an exhaustive switch with a `never` default, so a future SDK scope is a compile error rather than a silently-empty result. - remember-tool: truncate content to Zep's limits (4000 chars for messages, 10000 for graph.add) before the API call via a shared truncateForZep helper in zep-utils. The warning logs only lengths, never content (no PII). - Add eslint flat config (@typescript-eslint) and an `npm run lint` script so the CI test-typescript action's `npm run lint --if-present` runs real linting. - Add a typed `run()` test helper to narrow Mastra's execute() union, fixing pre-existing tsc errors across the test suite without weakening assertions. - Extend vitest coverage: thread_summaries/observations scope extraction and the message/graph length guards (including a no-PII-in-warning assertion). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4a1674b to
608e5d8
Compare
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
Adds the
@getzep/zep-mastrapackage (integrations/mastra/typescript) — Zep memory for Mastra.Hook (verified against installed
@mastra/core1.42.0)Custom tools via
createTool(the pattern@mastra/mem0uses), which keeps Zep's server-side temporal-graph retrieval rather than flattening it into a storage adapter. Shipszep-remember(persist),zep-search(graph.search), andzep-context(whole-user-graph Context Block viathread.getUserContext), bound to aZepClient.execute(inputData, context); tools attach tonew Agent({ id, name, ..., tools: { ... } }).Deps
@mastra/core@^1.42.0,@getzep/zep-cloud@^3.23.0. ESM, NodeNext + strict.Ships
README, SETUP.md (Zep signup), example, vitest tests, tsup build.
Validation
tsc --noEmit+ vitest (28 passed, 1 skipped) + build. Approach inintegrations/SPIKE_FINDINGS.md.🤖 Generated with Claude Code