Skip to content

docs(examples): add a runnable persistent memory example - #1938

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-1935
Nov 22, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-1935

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #1935

Summary

Adds examples/memory/, a runnable example for persistent memory, and links it from the docs. Two scripted headless sessions with the tokenless mock model show the Memory tool writing a fact in one run and reading it back in the next, with the regenerated MEMORY.md index injected into the session's prompt context (infer debug agent system_prompt), the memory-consult and memory-hygiene reminders firing (and pruned when INFER_MEMORY_ENABLED=false), and operation: delete removing both the fact-file and its index entry. A demo reminders.yaml lowers the hygiene nudge to once_after: 1 so a short scripted session can show it firing. Everything runs offline with the demo HOME and the store pointed into the example directory, so no API key and no real memory are touched.

Changes

  • examples/memory/Taskfile.yml - write, store, recall, reminders, delete, disabled, chat, an end-to-end all, plus build/home/clean, running every session against a demo HOME with INFER_MEMORY_DIR (memory.dir) pointed into the example and INFER_MEMORY_BACKEND_TYPE=local pinned inline so an exported CI-agent memory config cannot shadow the example's behavior
  • examples/memory/scenarios.yaml - mock scenarios for Memory write, read and delete plus a say hello prompt for the reminder demos
  • examples/memory/reminders.yaml - demo entry (merge: true) that replaces the memory-hygiene reminder with threshold: 1, seeded into the demo HOME by task home
  • examples/memory/README.md - what to expect with real captured output, the on-disk layout for global vs per-project facts (type: user global, others under the detected project, project: global or org/repo overrides), and a backend.type: git snippet with the exact command to run it
  • docs/examples.md - lists the new example
  • docs/memory.md - links to the walkthrough and adds it under Related

Validation

  • task -d examples/memory all runs the whole story end to end on the tokenless mock model - write, store, recall, reminders, delete, disabled each verified on the CI runner with the demo HOME and store, including a hermeticity fix: the runner exports INFER_MEMORY_BACKEND_TYPE=git with a repo, which silently git-initialized the demo store and left a sibling ..memory.sync.lock; the example pins the local backend and task clean removes the lock
  • task precommit:run passes (mod tidy, mocks, fmt, lint, markdownlint)

examples/memory scripts two sessions with the tokenless mock model - one writes a global fact with the Memory tool into a demo store (demo HOME plus INFER_MEMORY_DIR), the next has the MEMORY.md index injected into its prompt context and reads the fact back, then deletes it, and INFER_MEMORY_ENABLED=false shows the index and the memory-consult and memory-hygiene reminders gone. A demo reminders.yaml lowers the hygiene nudge to once_after 1 turn so a short session can show it firing. README.md shows the on-disk global and per-project layout plus the backend.type git snippet with the exact command. docs/examples.md lists the example and docs/memory.md links to it.
@github-project-automation github-project-automation Bot moved this to Todo in 2026 Nov 22, 2026
@edenreich
edenreich marked this pull request as ready for review November 22, 2026 21:49
@edenreich
edenreich requested a review from a team as a code owner November 22, 2026 21:49
@edenreich
edenreich merged commit d18c354 into main Nov 22, 2026
14 checks passed
@edenreich
edenreich deleted the fix/issue-1935 branch November 22, 2026 21:50
@edenreich edenreich moved this from Todo to Done in 2026 Nov 22, 2026
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.266.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] docs: add a runnable example for persistent memory

1 participant