Repository navigation
Labels
Description
What needs documenting
The CLI's persistent memory now supports a configurable sync backend so the local memory directory (~/.infer/memory) can be backed by a git remote: pull on run start, commit + push on change. This shipped in inference-gateway/cli#707 (closes inference-gateway/cli#683) and is currently undocumented in the docs repo.
Today cli.md -> Persistent Memory -> Configuration (memory.yaml) only documents the local knobs (enabled, dir, max_chars) from the original memory feature (#679). The new backend block is missing entirely.
Affected page
cli.md, section Persistent Memory -> subsection Configuration (memory.yaml) (the table listingenabled/dir/max_charsand theirINFER_MEMORY_*env vars). Add a new Sync backend subsection there.
What to add
Config surface (memory.yaml)
enabled: true
dir: '' # "" => ~/.infer/memory
max_chars: 4000
backend:
type: local # local (default) | git
git:
repo: '[email protected]:my-org/agent-memory.git'
branch: main
commit_message: 'chore(memory): sync'
timeout: 60 # seconds per git op
sync:
on_start: pull # pull (default) | off
on_finish: push # push (default) | offtype: local is the default and a pure no-op - existing users see no change.
Keys and env vars
| Key | Default | Environment variable | Notes |
|---|---|---|---|
backend.type |
local |
INFER_MEMORY_BACKEND_TYPE |
local (no-op) or git. |
backend.git.repo |
'' |
INFER_MEMORY_BACKEND_GIT_REPO |
Remote URL. Required when type: git. |
backend.git.branch |
main |
INFER_MEMORY_BACKEND_GIT_BRANCH |
Branch to track. |
backend.git.commit_message |
chore(memory): sync |
INFER_MEMORY_BACKEND_GIT_COMMIT_MESSAGE |
Deterministic, non-LLM commit message. |
backend.git.timeout |
60 |
INFER_MEMORY_BACKEND_GIT_TIMEOUT |
Seconds per git op (prevents credential hangs). |
backend.git.sync.on_start |
pull |
INFER_MEMORY_BACKEND_GIT_SYNC_ON_START |
pull or off. |
backend.git.sync.on_finish |
push |
INFER_MEMORY_BACKEND_GIT_SYNC_ON_FINISH |
push or off. |
Validation: when memory is enabled and type: git, repo is required; on_start must be pull/off; on_finish must be push/off.
Behavior worth calling out
- SyncIn (run start): clones the repo if the memory dir is missing, else fast-forward / rebase pulls. An
ls-remoteprobe decides clone vs. init-in-place (empty remote or pre-existing local memory). - SyncOut (on change only): commits + pushes only when
git status --porcelainshows changes (the "if there were any changes" part), via a bounded push -> pull-rebase -> retry loop plus a per-hostflockso concurrent runs (channels / scheduler / heartbeat) do not clobber each other. - Where it pushes from: in chat, the push happens via the
Memorytool on write/delete (not a post-session hook, which would commit-storm per message); in headlessinfer agent, it pulls on start and pushes at run finish. Works across channels / scheduler / heartbeat subprocess runs. - Best-effort, never fatal: a failed clone/pull/push logs and continues; it never aborts the agent run.
- Auth: uses the ambient git credential chain (ssh-agent / credential helper /
GIT_*); the backend injects no ssh/env override. Document SSH vsgh authvs token-in-URL. A warning is logged if the repo URL embeds credentials (they persist in.git/config) - SSH is preferred. The per-optimeoutprevents hangs on an interactive credential prompt.
References
- CLI PR: feat(memory): configurable git sync backend cli#707
- CLI issue: [FEATURE] Configurable memory sync backend (git/GitHub: clone on start, push on finish) cli#683
- Original local-memory docs shipped in: Add persistent memory tool for agent cli#679
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Jul 2, 2026
@claude Can you document it?
inference-gateway-maintainer commentedon Jul 2, 2026
Claude finished @edenreich's task in 6m 9s —— View job •
docs/issue-296-20260702-1147• [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-296-20260702-1147?quick_pull=1&title=Issue%20%23296%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23296%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Documenting the memory git sync backend
cli.md-> Persistent Memory section for current structurememory.yaml) subsectionformat,lint:md, andbuildto verify (all pass)Done. I documented the new
memory.backendgit sync feature incli.md, under Persistent Memory.What I added - a new Sync backend subsection covering:
backendconfig surface inmemory.yaml(type: local | git), withtype: localcalled out as the default no-op so existing users see no change.backend.type,backend.git.repo,branch,commit_message,timeout,sync.on_start,sync.on_finish- with defaults and theirINFER_MEMORY_BACKEND_*env vars.type: git(reporequired;on_startpull/off;on_finishpush/off).ls-remoteprobe), SyncOut on change only (git status --porcelaingate, bounded push -> pull-rebase -> retry loop, per-hostflock), where the push happens (chatMemorytool on write/delete vs. headlessinfer agentat run finish), and best-effort / never-fatal semantics.gh authvs. token-in-URL), the credentials-in-URL warning, and the per-optimeout.I also added a one-line pointer to the new subsection from the existing Configuration (
memory.yaml) subsection.Verification -
bun run format:check,bun run lint:md, andbun run buildall pass; the new prose is server-rendered intodist/cli/index.htmland picked up by the local search index (consistent with the repo's SSR/SEO conventions).PR: #298 - docs: document memory git sync backend (memory.backend)
| Branch:
docs/issue-296-20260702-1147inference-gateway-releaser commentedon Jul 2, 2026
🎉 This issue has been resolved in version 0.6.115 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀