Repository navigation
Conversation
|
@greptileai review |
| } | ||
|
|
||
| // Derive group_id from context, fall back to last known | ||
| const groupId = ctx.sessionKey ? deriveGroupId(ctx, cfg) : lastGroupId; |
There was a problem hiding this comment.
inconsistent userId handling: when cfg.userId is explicitly set, agent_end uses it directly (line 327), but this line ignores it and derives from context
Facts captured under cfg.userId won't be recalled if ctx.sessionKey is present.
| const groupId = ctx.sessionKey ? deriveGroupId(ctx, cfg) : lastGroupId; | |
| const groupId = cfg.userId ?? (ctx.sessionKey ? deriveGroupId(ctx, cfg) : lastGroupId); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/memory-graphiti/index.ts
Line: 294
Comment:
inconsistent userId handling: when `cfg.userId` is explicitly set, `agent_end` uses it directly (line 327), but this line ignores it and derives from context
Facts captured under `cfg.userId` won't be recalled if `ctx.sessionKey` is present.
```suggestion
const groupId = cfg.userId ?? (ctx.sessionKey ? deriveGroupId(ctx, cfg) : lastGroupId);
```
How can I resolve this? If you propose a fix, please make it concise.Graph-based knowledge memory plugin using Graphiti for temporally-aware knowledge graphs. Supports two backends: - Zep Cloud (managed) via @getzep/zep-cloud SDK - Self-hosted Graphiti via REST API Features: auto-capture (agent_end), auto-recall (before_agent_start), graphiti_search/graphiti_episodes tools, CLI status command, and configurable group ID strategies (channel-sender, session, static). Includes 49 unit tests and 6 integration tests against Zep Cloud. Co-Authored-By: Claude Opus 4.6 <[email protected]>
335e258 to
7555744
Compare
|
Addressed greptile review feedback: Fixed inconsistent
All 49 unit tests pass. |
|
Please make this as a third-party plugin that you maintain yourself in your own repo. Docs: https://docs.openclaw.ai/plugin. Feel free to open a PR after to add it to our community plugins page: https://docs.openclaw.ai/plugins/community |
Summary
memory-graphitiextension inextensions/memory-graphiti/with dual-backend support (Zep Cloud managed service + self-hosted Graphiti REST API), auto-capture/recall hooks, search tools, and CLI.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
memory-graphitiplugin available in thememoryslotapiKey(Zep Cloud) orserverUrl(self-hosted Graphiti)graphiti_search(search knowledge graph) andgraphiti_episodes(retrieve recent episodes)openclaw graphiti statusto check connectivitychannel-sender(default, per-user per-channel),session(per-thread),static(shared graph)Security Impact (required)
Yes— new memory plugin with network access to Zep Cloud or self-hosted GraphitiYes—apiKeyfield markedsensitive: true, supports${ENV_VAR}resolutionYes— calls to Zep Cloud API (api.getzep.com) or self-hosted Graphiti REST APIYes— two new agent tools (graphiti_search,graphiti_episodes)No— operates within the memory plugin slot, same as existing memory pluginssensitive: trueflag. Environment variable resolution prevents hardcoded secrets. All network calls go to user-configured endpoints only.Repro + Verification
Environment
{ "apiKey": "${GETZEP_API_KEY}" }Steps
Expected
Actual
Evidence
49 unit tests covering: config parsing (15), client factory (3), group ID derivation (9), message extraction (7), fact formatting (3), REST client (12).
6 integration tests against live Zep Cloud: healthcheck, addMessages, getEpisodes (with polling), searchFacts.
Human Verification (required)
Compatibility / Migration
Yes— new extension, no changes to existing codeYes— newGETZEP_API_KEYorGRAPHITI_SERVER_URLenv vars neededNoFailure Recovery (if this breaks)
memory-graphitifrom plugin slot config, or uninstall extensionextensions/memory-graphiti/directory — fully self-containedRisks and Mitigations
^3.16.0, integration tests validate live APIGreptile Summary
Added graph-based memory plugin with dual-backend support (Zep Cloud managed service + self-hosted Graphiti). Implements auto-capture/recall hooks, search tools, and CLI commands.
Key changes:
memory-graphitiextension inextensions/memory-graphiti/with comprehensive configuration@getzep/zep-cloud) and self-hosted REST APIgraphiti_search(query knowledge graph) andgraphiti_episodes(retrieve conversation history)openclaw graphiti statusfor connectivity checksIssues found:
userIdhandling between auto-recall and auto-capture hooks (line 294) causes facts to be stored under one ID but searched under another whencfg.userIdis explicitly setCode quality:
MemoryClientinterfaceConfidence Score: 3/5
extensions/memory-graphiti/index.tsline 294 - the userId consistency fix is critical for users who explicitly configure a fixed userIdLast reviewed commit: 335e258