Skip to content

Add TypeScript Eve example with Zep memory - #599

Merged
jackaldenryan merged 2 commits into
mainfrom
jack/persist-then-get-context
Aug 11, 2026
Merged

Add TypeScript Eve example with Zep memory#599
jackaldenryan merged 2 commits into
mainfrom
jack/persist-then-get-context

Conversation

@jackaldenryan

Copy link
Copy Markdown
Contributor

Summary

  • Adds examples/typescript/eve, a runnable Eve agent that uses Zep for long-term memory (hooks to persist, turn-scoped dynamic instructions for auto-recall via graph.search, and authored user/company search tools).
  • Documents the Eve lifecycle workaround for current-turn recall (onMessage utterance stash → turn.started instructions) and includes smoke/seed scripts for local verification.

Test plan

  • cd examples/typescript/eve && cp .env.example .env and set ZEP_API_KEY / GOOGLE_API_KEY
  • npm install && npm run smoke && npm run seed:company
  • npm run dev (or eve dev --no-ui) and confirm billing preference recall plus zep_search_company / call_service_a behavior

Made with Cursor

Demonstrates turn-scoped dynamic-instruction recall, hook-based persist, and authored search tools against user and company graphs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread examples/typescript/eve/agent/hooks/zep-persist.ts Fixed
Comment thread examples/typescript/eve/agent/instructions/zep-memory.ts Fixed
Comment thread examples/typescript/eve/agent/instructions/zep-memory.ts Fixed
Comment thread examples/typescript/eve/agent/instructions/zep-memory.ts Fixed
Comment thread examples/typescript/eve/agent/instructions/zep-memory.ts Fixed
Comment thread examples/typescript/eve/scripts/smoke-memory.ts Fixed

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical

  • examples/typescript/eve/agent/channels/eve.ts:22-28 and agent/lib/identity.ts:52-60placeholderAuth() permits unauthenticated production requests while all non-user principals fall back to the shared ZEP_DEMO_USER_ID. Consequently, unrelated visitors share one Zep memory graph and can retrieve each other’s conversation-derived facts. Concurrent new sessions can also have utterances swapped by the shared FIFO stash. Remove placeholderAuth() from deployable configuration, or assign an isolated identity per authenticated principal/session; restrict the fixed demo identity to local development.

Warning

  • examples/typescript/eve/scripts/seed-company-graph.ts:106-124 — A partially completed seed run is not idempotent. If fewer than ten episodes exist, rerunning adds all ten again, duplicating previously inserted facts. Identify seed episodes by a stable source ID and add only missing entries, or recreate/abort when a partial seed is detected.

  • examples/typescript/eve/scripts/smoke-memory.ts:20-31 — Processing readiness is measured against the user’s total episode count. For the default reused demo user, two old processed episodes satisfy the condition immediately, so the test can query before its newly added messages are processed and may pass using stale Service A facts. Track the newly created thread/episode identifiers or record the baseline count and wait for the new episodes specifically.

@socket-security

socket-security Bot commented Aug 11, 2026

Copy link
Copy Markdown

@socket-security

socket-security Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Medium
Low adoption: npm microsandbox

Location: Package overview

From: examples/typescript/eve/package-lock.jsonnpm/microsandbox@0.5.10

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/microsandbox@0.5.10. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm ocache

Location: Package overview

From: examples/typescript/eve/package-lock.jsonnpm/eve@0.32.0npm/ocache@0.1.5

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ocache@0.1.5. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

CodeQL flagged clear-text logging of ZEP_DEMO_USER_ID-derived values in
persist/recall paths and the smoke script.

Co-authored-by: Cursor <cursoragent@cursor.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Critical — agent/channels/eve.ts:24-27, agent/lib/identity.ts:51-56: placeholderAuth() permits unauthenticated production browser requests, while those callers fall back to the shared ZEP_DEMO_USER_ID. Any visitor can therefore read and poison every other demo visitor’s persisted memory through zep_search and message ingestion. Remove placeholderAuth() from deployable configuration, or assign each authenticated principal an isolated Zep user ID and reject callers without one.

  • Warning — scripts/seed-company-graph.ts:108-125: Partial reruns duplicate existing seed episodes. When fewer than ten episodes exist, the script adds all ten rather than only the missing entries, polluting search results despite claiming reruns avoid duplicates. Check stable source IDs/content and add only absent episodes, or recreate the graph before reseeding.

  • Warning — scripts/smoke-memory.ts:61-100: The smoke test reuses the configured demo user and waits only for that user to have two processed episodes. Existing episodes from an earlier run satisfy the condition immediately, so the test can pass using stale context/search results without verifying the newly added messages were processed. Use a unique user per run or record the initial episode count and wait for the expected increment.

@jackaldenryan
jackaldenryan merged commit f400a33 into main Aug 11, 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.

2 participants