Add @getzep/zep-adk integration (Google ADK, TypeScript)#526
Merged
Conversation
d1a02b4 to
89b29c0
Compare
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>
4645d8c to
415c0d3
Compare
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-adkpackage (integrations/adk/typescript) — Zep memory for the official Google ADK for TypeScript.Hook (verified against installed
@google/adk1.2.0)Primary:
createZepBeforeModelCallback(zep, { userId, threadId })— abeforeModelCallbackthat persists the latest user message and injects Zep's Context Block by mutatingllmRequest.config.systemInstruction(theappendInstructionshelper is unreachable under NodeNext — the packageexportsmap exposes only.). Alternative:ZepContextTool extends BaseTooloverridingprocessLlmRequest. Per-turn persistence goes via the callback/tool (not the session-endBaseMemoryService.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 inintegrations/SPIKE_FINDINGS.md.🤖 Generated with Claude Code