ai-memory: back the demo with real Context Graph packages - #110
Open
antejavor wants to merge 3 commits into
Open
ai-memory: back the demo with real Context Graph packages#110antejavor wants to merge 3 commits into
antejavor wants to merge 3 commits into
Conversation
ai-memory.md/.sh/.ps1 previously hand-rolled a generic Client/Preference/Interaction/Workflow/Step schema against the generic mcp-memgraph server -- illustrating the semantic/episodic/procedural memory story with no connection to how Memgraph's own Context Graph project (github.com/memgraph/ai-toolkit/tree/main/context-graph) actually implements it. Rewire the demo to write and recall all three memory types through the real packages a live coding-assistant plugin uses: - sessions-graph : semantic memory (Memory nodes) - actions-graph : episodic memory (Session/Action nodes, FOLLOWED_BY) - skills-graph : procedural memory (Skill nodes, USED_SKILL) The three share a (:User)/(:Session) node as join key, so the payoff "interconnected recall" is a genuine one-shot Cypher traversal through that shared graph, not three lookups glued together. The "Wire It Into a Real Harness" section now points at the actual agent-context-graph plugin bootstrap flow instead of a generic MCP config snippet. Drops the "no Python" positioning (now needs Python 3.10-3.13 to pip install the three packages) in exchange for the example being true to what the real product does. New ai-memory.py holds the seed+recall logic; .sh/.ps1 now provision a venv alongside the Memgraph container. Verified end-to-end on both scripts (bash and real pwsh) against a live container.
…nippet The previous "wire it into a real harness" snippet (uv tool install + agent-context-graph bootstrap + config set identity.user_id) skipped the step that actually wires hooks into Claude Code -- claude plugin marketplace add + claude plugin install. Without it, bootstrap/doctor come back all green but no real session captures anything. context-graph now ships context-graph/scripts/install.sh (ai-toolkit#296) covering that gap in one idempotent command: starts Memgraph if nothing's reachable, registers the marketplace, installs the plugin, installs the CLI with all three connectors, sets identity, verifies with doctor. Point all three variants at it instead of duplicating the (now incomplete) manual steps, and link to the README's configurable-env-vars table rather than re-listing it here.
Follow-up to the previous commit: context-graph's install.sh gained CONTEXT_GRAPH_RUNTIME support (ai-toolkit#296) after finding the "Codex has no non-interactive plugin-install step" claim was stale -- codex-cli's `codex plugin add` installs and enables in one non-interactive call, same as Claude Code's `claude plugin install ... -y`. Point all three variants at both runtimes instead of carrying that now-incorrect caveat forward.
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.
Summary
code-examples/ai-memory.md/.sh/.ps1illustrated Memgraph's semantic/episodic/procedural memory pitch with a hand-rolledClient/Preference/Interaction/Workflow/Stepschema and the genericmcp-memgraphserver — no connection to how Memgraph's own Context Graph project actually implements durable AI memory.This rewires the demo to write and recall all three memory types through the real packages a live coding-assistant plugin uses:
sessions-graph— semantic memory (Memorynodes)actions-graph— episodic memory (Session/Actionnodes,FOLLOWED_BYsequencing)skills-graph— procedural memory (Skillnodes,USED_SKILL)These three share a
(:User)/(:Session)node as join key, so the demo's "interconnected recall" payoff is now a genuine one-shot Cypher traversal through that shared graph, not three lookups glued together in script. The "Wire It Into a Real Harness" section now points at the actualagent-context-graphplugin bootstrap flow (whose Memgraph defaults already match this demo's container) instead of a generic MCP config snippet.This trades the previous "no Python" positioning for Python 3.10-3.13 (to
pip installthe three packages into a throwaway venv) — a deliberate scope call to make the example true to the real product, discussed and confirmed before implementation.ai-memory.pyholds the seed/recall logic.ai-memory.sh/.ps1now provision that venv alongside the same single Memgraph container (no more separatemcp-memgraph/mgconsolecontainers — schema-info/ontology inspection reuses the mgconsole already bundled inmemgraph-mage).ai-memory.mdrewritten to match.Test plan
./ai-memory.shend-to-end against a live Docker Memgraph container: network/container up, venv created,sessions-graph/actions-graph/skills-graphinstalled from PyPI, seed + all four recall queries (semantic/episodic/procedural/interconnected) produced correct output,SHOW SCHEMA INFOsucceeded, wrap-up message printed../ai-memory.sh clean: container, network, and venv removed.pwsh7.4.6 binary (not just syntax-parsed): fullrunflow reproduced identical output,cleanflow removed everything.[System.Management.Automation.Language.Parser]::ParseFileconfirmsai-memory.ps1has no syntax errors.sessions-graph'ssave_memory(session_id=...)provenance write racesactions-graph'screate_sessionunique constraint onSessionif session creation doesn't happen first —ai-memory.pynow creates sessions before anything else references them.