Skip to content

Add @getzep/zep-mastra integration (Mastra, TypeScript)#525

Merged
danielchalef merged 2 commits into
mainfrom
feat/zep-mastra
Jun 18, 2026
Merged

Add @getzep/zep-mastra integration (Mastra, TypeScript)#525
danielchalef merged 2 commits into
mainfrom
feat/zep-mastra

Conversation

@danielchalef

Copy link
Copy Markdown
Member

Adds the @getzep/zep-mastra package (integrations/mastra/typescript) — Zep memory for Mastra.

Hook (verified against installed @mastra/core 1.42.0)

Custom tools via createTool (the pattern @mastra/mem0 uses), which keeps Zep's server-side temporal-graph retrieval rather than flattening it into a storage adapter. Ships zep-remember (persist), zep-search (graph.search), and zep-context (whole-user-graph Context Block via thread.getUserContext), bound to a ZepClient. execute(inputData, context); tools attach to new 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 in integrations/SPIKE_FINDINGS.md.

🤖 Generated with Claude Code

danielchalef and others added 2 commits June 18, 2026 11:00
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>
@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@danielchalef danielchalef merged commit f52ae1a into main Jun 18, 2026
10 checks passed
@danielchalef danielchalef deleted the feat/zep-mastra branch June 18, 2026 19:24
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.

1 participant