Skip to content

Add @getzep/zep-adk integration (Google ADK, TypeScript)#526

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

Add @getzep/zep-adk integration (Google ADK, TypeScript)#526
danielchalef merged 2 commits into
mainfrom
feat/zep-adk-typescript

Conversation

@danielchalef

Copy link
Copy Markdown
Member

Adds the @getzep/zep-adk package (integrations/adk/typescript) — Zep memory for the official Google ADK for TypeScript.

Hook (verified against installed @google/adk 1.2.0)

Primary: createZepBeforeModelCallback(zep, { userId, threadId }) — a beforeModelCallback that persists the latest user message and injects Zep's Context Block by mutating llmRequest.config.systemInstruction (the appendInstructions helper is unreachable under NodeNext — the package exports map exposes only .). Alternative: ZepContextTool extends BaseTool overriding processLlmRequest. Per-turn persistence goes via the callback/tool (not the session-end BaseMemoryService.addSessionToMemory).

Deps

@google/adk@1.2.0 (pinned — young SDK), @getzep/zep-cloud@^3.23.0. ESM, NodeNext + strict.

Ships

README, SETUP.md (Zep signup), example (LlmAgent), vitest tests.

Validation

tsc --noEmit + vitest (35 passed) + build. Approach in integrations/SPIKE_FINDINGS.md.

🤖 Generated with Claude Code

@danielchalef danielchalef force-pushed the feat/zep-adk-typescript branch from d1a02b4 to 89b29c0 Compare June 17, 2026 19:23
danielchalef and others added 2 commits June 18, 2026 11:00
Zep memory for the official @google/adk via a before-model callback (primary)
and a BaseTool (alternative).

- createZepBeforeModelCallback(zep, {userId, threadId}): persists the latest user
  message and injects Zep's Context Block by mutating llmRequest config
  systemInstruction (the appendInstructions helper is unreachable under NodeNext).
- ZepContextTool extends BaseTool overriding processLlmRequest as a tool-centric
  alternative. Per-turn persistence via the callback/tool (not the session-end
  BaseMemoryService).
- Depends on @google/adk 1.2.0 (pinned; young SDK) and @getzep/zep-cloud ^3.23.0.
- README, SETUP, example, vitest tests. CI already routes integrations/adk/typescript.

Verified: tsc --noEmit + vitest (35 passed) + build. See integrations/SPIKE_FINDINGS.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…resources

Apply targeted code-review fixes to the @getzep/zep-adk integration:

- [high] Add a same-turn dedup guard keyed on context.invocationId so a
  tool-using (multi-step) turn persists the user message only once per
  invocation. The marker is set only AFTER thread.addMessages succeeds, so a
  transient failure does not permanently suppress the message. State lives on
  the shared ZepResourceManager.
- [medium] Handle the thread_summaries graph-search scope (previously fell
  through to "No results found.") and reject any unsupported scope at
  ZepGraphSearchTool construction with a clear error.
- [medium] Add 4096-char message-size handling. Over-long user/assistant
  messages are truncated (to ~4000 chars) via a shared truncateMessageContent
  helper rather than 400ing and being swallowed. The warning logs lengths
  only, never message content/PII.
- [low] Share one ZepResourceManager (ensure-thread + dedup state) between the
  before- and after-model callbacks via the new createZepCallbacks factory, so
  the two hooks are no longer split-brain.

Add regression tests for each fix and a unit test for the limits helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@danielchalef danielchalef force-pushed the feat/zep-adk-typescript branch from 4645d8c to 415c0d3 Compare June 18, 2026 18:00
@danielchalef danielchalef merged commit 1f4b02e into main Jun 18, 2026
10 checks passed
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