Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
93844e2
fix(hooks): keep truncation from splitting a surrogate pair (#1598)
dmazhukov Nov 3, 2026
7c73b9c
fix(sessions): skip session rows without an id in the sweep (#1645)
dmazhukov Nov 3, 2026
e8f0100
fix(cli): verify compose daemon process identity during reconcile (#1…
pei711 Nov 3, 2026
7a9d1c0
fix(compose): start Worker Compose workers on native Windows (#1641)
rohitg00 Nov 3, 2026
514c3c8
fix(facets): remove facet tags on lesson deletes and observation forg…
xh123637 Nov 3, 2026
26eb2be
fix(deploy): retain local embedding dependencies in Docker images (#1…
mothieras Nov 3, 2026
affcf20
fix(search): keep retrying while the state worker registers (#1626)
Tyxiel Nov 3, 2026
ce95e5e
fix: wait for state worker functions before boot reads (#1627)
cbsincool Nov 3, 2026
57fdbc3
fix(cli): retry slow iii probes and skip the install prompt on Window…
rohitg00 Nov 3, 2026
35888cb
fix: follow up the boot race fixes with the open review findings (#1660)
rohitg00 Nov 3, 2026
241d536
fix(hermes): stop the project git probe from inheriting stdin (#1663)
rohitg00 Nov 3, 2026
e93dafa
test(release-gate): accept the worker's own error in inline-worker-fa…
rohitg00 Nov 3, 2026
dfd7301
test(windows): require a zero exit from the second start (#1667)
rohitg00 Nov 3, 2026
9890b7a
fix(mcp): hide and guard slot tools when AGENTMEMORY_SLOTS is off (#1…
rohitg00 Nov 3, 2026
f935c27
fix(mcp): accept sourceIds on memory_lesson_save (#1661)
rohitg00 Nov 4, 2026
bddba4b
fix(openai): fail on a reply cut at max_tokens instead of returning p…
Rex57 Nov 4, 2026
2c96ade
fix(state): reclaim index generations the manifest can no longer name…
inix-x Nov 4, 2026
cad9aef
fix(mcp): read graph stats from the snapshot instead of enumerating t…
inix-x Nov 4, 2026
387d193
fix(search): rank scoped smart-search again when the first window lea…
dmazhukov Nov 4, 2026
26fd312
fix(search): restore CJK recall for core observation search (#1553)
akushonkamen Nov 4, 2026
8e6dca3
chore: remove code comments and issue references (#1673)
rohitg00 Nov 4, 2026
4f7252d
fix: preserve original memory types in search responses (#1646)
reevesc88 Nov 4, 2026
33ad2c5
fix: exclude unscoped memories from project-filtered recall (#1647)
reevesc88 Nov 4, 2026
e9be964
fix(doctor): do not prompt Fix/Skip in a non-interactive shell (#1671)
rohitg00 Nov 4, 2026
3fec422
fix(cli): keep iii SDK debug lines out of status and stop output (#1672)
rohitg00 Nov 4, 2026
10b49ea
fix(mcp): record why the stdio shim dies (#1662)
rohitg00 Nov 4, 2026
d53a513
fix(plugin): address the directory review on data capture, providers …
rohitg00 Nov 4, 2026
9b86661
fix(cli): install the pinned iii engine on Windows (#1670)
rohitg00 Nov 4, 2026
77a04ce
fix(mcp): save the store before stderr on the crash path (#1674)
rohitg00 Nov 4, 2026
02b91b4
docs(env): name the Agent SDK route and correct the fallback and cap …
rohitg00 Nov 4, 2026
61d2446
fix(memory): bump updatedAt when a supersede marks a memory non-lates…
egantz Nov 4, 2026
b116ddd
fix(pi): read a full lesson by ID and scope the lesson to its project…
YeChenglin8888 Nov 4, 2026
80619c7
fix: make build asset copy cross-platform (#1362)
mattamundson Nov 4, 2026
0875d88
docs: sync documented counts with main (#1678)
rohitg00 Nov 4, 2026
6eb9401
fix(hooks): read Copilot's camelCase subagentStop payload (#1599)
dmazhukov Nov 4, 2026
ea206eb
ci: publish the Docker image to Docker Hub on release (#1677)
rohitg00 Nov 4, 2026
0639d88
chore: prepare 0.9.32 (#1676)
rohitg00 Nov 4, 2026
c4c506b
docs: refresh stale release references for 0.9.32 (#1679)
rohitg00 Nov 4, 2026
6c38928
docs: document the Hermes catalog and ClawHub installs (#1680)
rohitg00 Nov 4, 2026
99ec6d1
fix(plugin): pass settings under accepted names and run hooks in exec…
rohitg00 Nov 4, 2026
0da38f1
docs(readme): separate plugin settings from the connect route for a r…
rohitg00 Nov 4, 2026
a78401f
chore: bump @agentmemory/pi to 0.1.1 and @agentmemory/fs-watcher to 0…
rohitg00 Nov 4, 2026
c26d0b0
fix: detect historical gaps in a partially embedded vector index (#1687)
mvanhorn Nov 5, 2026
f0f7378
fix(cursor): map subagent stop type and summary fields (#1684)
mothieras Nov 5, 2026
4f758ef
feat(runtime): iii 0.25-built state/http workers and a 64 MiB transpo…
rohitg00 Nov 7, 2026
6bb9028
chore: move to iii 0.25.1 (#1694)
rohitg00 Nov 7, 2026
553545e
fix(hooks): redact captured text before cutting it to length (#1695)
rohitg00 Nov 7, 2026
50a5501
fix(hooks): redact compound secret key names (#1701)
rohitg00 Nov 7, 2026
cd6de5f
feat(state): page state reads so scopes above 64 MiB keep working (#1…
rohitg00 Nov 8, 2026
779a551
fix(consolidate): let saved pattern memories reach the procedural tie…
rohitg00 Nov 8, 2026
742c51a
fix(mcp): record the creating agent on memory_action_create (#1697)
rohitg00 Nov 8, 2026
f38d80d
fix(summarize): make the summary deadline configurable (#1689)
rohitg00 Nov 8, 2026
83bd075
fix(deploy): pass the provider selectors to Docker workers (#1700)
rohitg00 Nov 8, 2026
6d8617f
fix(mcp): stop the MCP shim cutting proxied calls off at 15 s (#1691)
rohitg00 Nov 8, 2026
94903f1
fix(hooks): send PreToolUse context in the hook envelope (#1693)
rohitg00 Nov 8, 2026
692a7b5
fix(hooks): give the Claude Code SessionEnd hook time to finish (#1692)
rohitg00 Nov 8, 2026
5576bea
fix(search): stop capping saved memories at three per search (#1696)
rohitg00 Nov 8, 2026
6d1d34d
ci(deps)(deps): bump actions/upload-artifact from 4 to 7 (#1473)
dependabot[bot] Nov 8, 2026
e0b1987
ci(deps)(deps): bump actions/checkout from 6 to 7 (#967)
dependabot[bot] Nov 8, 2026
bd25fff
fix(diagnostics): find and heal facets that point at deleted targets …
rohitg00 Nov 8, 2026
63db094
fix(evict): remove evicted memories from search indexes (#1601)
DimitriChrysafis Nov 8, 2026
0ffd58c
feat(sessions): filter by startedAt and endedAt (#1527)
yxtay Nov 8, 2026
ad14556
fix(skills): regenerate the config reference env count (#1705)
rohitg00 Nov 8, 2026
60c8d9d
fix: bound reflection evidence and insight responses (#1544)
rohitg00 Nov 8, 2026
7e53e1c
fix: preserve consolidation provenance and version heads (#1545)
rohitg00 Nov 8, 2026
d8ee81d
fix(cli): stop demo-owned Compose workers on Windows (#1688)
Mike-Animal-Counseling Nov 8, 2026
77f4535
fix(config): treat placeholder provider keys as unset when picking th…
dmazhukov Nov 8, 2026
2b67b1a
fix(hooks): scope pre-tool-use enrichment to the current project (#1220)
devon3000 Nov 9, 2026
821cc69
fix(providers): clear the circuit breaker failure count on success (#…
redeye1011 Nov 9, 2026
75a71fd
fix(resilient): content filter rejections must not open the circuit b…
dKaulig Nov 9, 2026
0e22eed
fix(health): report CPU as machine-relative, not single-core (#1286)
DanielCarmingham Nov 9, 2026
c3c65d7
fix(cli): preserve newlines in generated Compose values (#1708)
zhichao-poper Nov 9, 2026
e94d39e
fix(clip): use CLIP text tower for text embeddings (#1250)
anhtahaylove Nov 9, 2026
1801792
fix(connect): honor CLAUDE_CONFIG_DIR for Claude Code (#1703)
mothieras Nov 9, 2026
5f18906
fix(release-gate): fail the Windows leftover check when the process q…
rohitg00 Nov 9, 2026
fbf0766
fix(clip): drop issue-ref comments and tighten text tower tests (#1712)
rohitg00 Nov 9, 2026
5634bc5
feat(website): show the developer experience and the performance work…
rohitg00 Nov 9, 2026
be8f01e
chore: prepare 0.9.33 (#1713)
rohitg00 Nov 9, 2026
ae74b8b
ci(release-gate): run the packed gate on arm64 and Intel machines (#1…
rohitg00 Nov 9, 2026
399f6a8
fix(install): retry transient iii engine download failures (#1719)
rohitg00 Nov 9, 2026
28ffc53
docs(changelog): add #1716 and #1719 to 0.9.33 (#1720)
rohitg00 Nov 9, 2026
77ebca5
fix(index): unindex superseded and wiped memories (#1704)
DimitriChrysafis Nov 11, 2026
57bc384
fix(connect): support native Windows in agentmemory connect (#1754)
rohitg00 Nov 11, 2026
ba7b088
fix(search): retry failed keyword index sessions in the background (#…
rohitg00 Nov 12, 2026
816d31a
fix(cli): say when an agent is connected with MCP only (#1756)
rohitg00 Nov 12, 2026
f9a8923
fix(graph): report graphify import truncation and index readiness (#1…
rohitg00 Nov 12, 2026
96ce020
fix(hermes): declare no plugin hooks so plugins doctor passes (#1759)
rohitg00 Nov 12, 2026
1ee2820
fix(cli): explain an engine that runs without the agentmemory worker …
rohitg00 Nov 12, 2026
1350ee5
fix(cli): make demo wait until seeded observations are searchable (#1…
rohitg00 Nov 12, 2026
acbc7ce
fix: evict lowest-value observations at the session cap instead of re…
sbynode-ux Nov 12, 2026
3e48fcb
fix(release-gate): force the dead-letter capture failure without the …
rohitg00 Nov 12, 2026
c08dedd
Merge upstream/main (0.9.32, 0.9.33 and 16 later fixes) into the fork
duckling-openclaw Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agentmemory",
"version": "0.9.31",
"version": "0.9.33",
"description": "Persistent memory for Cursor: auto-captures sessions, prompts, and tool use via hooks, recalls with hybrid BM25 + vector + graph search, and exposes 54 memory tools over MCP. Keyless by default, runs entirely on your machine.",
"author": {
"name": "Rohit Ghumare",
Expand Down
46 changes: 27 additions & 19 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@
# place automatically. Run `npx -y @agentmemory/agentmemory@latest doctor`
# to verify that the daemon reads the env you expect.
#
# Defaults shown in comments. Listed in priority order — the first key
# present wins on the LLM detection path (see src/config.ts::detectProvider).
# Defaults shown in comments. No provider is ever picked from a key alone:
# agentmemory sends session content to an outside AI provider only after you
# name one with AGENTMEMORY_LLM_PROVIDER or EMBEDDING_PROVIDER, or opt into the
# Claude subscription fallback with AGENTMEMORY_ALLOW_AGENT_SDK=true.

# -----------------------------------------------------------------------------
# 1. LLM provider — pick ONE
# 1. LLM provider: off unless you choose one
# -----------------------------------------------------------------------------
#
# Without a provider key, agentmemory runs in noop mode: observations are
# Without AGENTMEMORY_LLM_PROVIDER or AGENTMEMORY_ALLOW_AGENT_SDK=true, agentmemory
# runs in noop mode and sends no session content to an LLM, even when a provider
# key is in the environment.
# In noop mode: observations are
# indexed via zero-LLM synthetic compression and BM25 recall still works,
# but LLM-backed summarisation / reflection / consolidation are disabled.
# A provider key alone does not enable LLM-written observation compression;
Expand All @@ -39,13 +44,12 @@
# AGENTMEMORY_CAPTURE_SPOOL_DIR= # Spool folder (default <data dir>/capture-spool)
# AGENTMEMORY_CAPTURE_SPOOL_MAX_BYTES=5242880 # Spool size limit
# AGENTMEMORY_CAPTURE_SPOOL_MAX_AGE_HOURS=168 # Spooled records older than this are dropped
# The detection order is OPENAI_API_KEY → MINIMAX_API_KEY → ANTHROPIC_API_KEY
# → GEMINI_API_KEY → OPENROUTER_API_KEY → noop.
# To turn on LLM summaries, set AGENTMEMORY_LLM_PROVIDER and that provider's key.
# AGENTMEMORY_LLM_PROVIDER=anthropic # anthropic | openai | gemini | openrouter | minimax

# OPENAI_API_KEY=sk-... # Activates both the OpenAI-compatible LLM provider (DeepSeek, SiliconFlow, vLLM, LM Studio, Ollama via `/v1`) and OpenAI embeddings. Set OPENAI_API_KEY_FOR_LLM=false to scope it to embeddings only.
# OPENAI_API_KEY=sk-... # Used by AGENTMEMORY_LLM_PROVIDER=openai (OpenAI-compatible: DeepSeek, SiliconFlow, vLLM, LM Studio, Ollama via `/v1`) and by EMBEDDING_PROVIDER=openai
# OPENAI_BASE_URL=https://api.openai.com # Override for OpenAI-compatible providers
# OPENAI_MODEL=gpt-5.6-luna # Default OpenAI-compatible chat model
# OPENAI_API_KEY_FOR_LLM=false # Skip OpenAI auto-detection for LLM; key stays active for embeddings

# ANTHROPIC_API_KEY=sk-ant-...
# ANTHROPIC_MODEL=claude-sonnet-5 # Default Anthropic model
Expand Down Expand Up @@ -75,18 +79,17 @@
# Stop-hook recursion when invoked from inside Claude Code.
# AGENTMEMORY_ALLOW_AGENT_SDK=true

# FALLBACK_PROVIDERS=anthropic,gemini # Comma-separated chain tried after the primary provider returns an error (e.g. rate limit)
# FALLBACK_PROVIDERS=anthropic,gemini # Comma-separated chain tried after the chosen AGENTMEMORY_LLM_PROVIDER returns an error (e.g. rate limit); ignored when zero-LLM is active

# -----------------------------------------------------------------------------
# 2. Embedding provider — auto-detected, override via EMBEDDING_PROVIDER
# 2. Embedding provider: off unless you set EMBEDDING_PROVIDER
# -----------------------------------------------------------------------------
#
# Without an embedding provider, vector embeddings are disabled. `mem::search`
# uses BM25; `mem::smart-search` can also fuse structural graph matches when
# graph data exists. Remote
# provider detection order: EMBEDDING_PROVIDER override → GEMINI_API_KEY →
# OPENAI_API_KEY → VOYAGE_API_KEY → COHERE_API_KEY → OPENROUTER_API_KEY →
# BM25-only. Local embeddings are an explicit opt-in, not the keyless default.
# graph data exists. Cloud embeddings send memory text to that provider and run
# only when EMBEDDING_PROVIDER names it; a key alone never turns them on.
# Local embeddings are an explicit opt-in too, not the keyless default.
# `EMBEDDING_PROVIDER=local` uses Xenova/all-MiniLM-L6-v2 (384-dim) on-device;
# the first embedding request downloads the model and needs network access.

Expand Down Expand Up @@ -124,17 +127,21 @@
# VECTOR_WEIGHT=0.6 # Hybrid search weight for vector leg
# AGENTMEMORY_GRAPH_WEIGHT=0.2 # Graph traversal bonus on smart-search ranking
# AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=false # Report boot compaction as off (otherwise deferred; manual maintenance only)
# AGENTMEMORY_GRAPH_IMPORT_MAX_NODES=5000 # Node limit for POST /graph/import-graphify; nodes over it are dropped and reported
# AGENTMEMORY_GRAPH_IMPORT_MAX_EDGES=20000 # Edge limit for POST /graph/import-graphify; edges over it are dropped and reported
# TOKEN_BUDGET=2000 # Max tokens injected via mem::context per session
# MAX_OBS_PER_SESSION=500 # Per-session observation cap before consolidation kicks in
# MAX_OBS_PER_SESSION=500 # Hard per-session cap: later observations of that session are refused; only capture-worker refusals are parked as dead letters (0 = no cap)
# SUMMARIZE_CHUNK_SIZE=400 # When mem::summarize sees a session larger than this, it chunks observations and map-reduces (chunk-summarize → reduce-merge) to stay within the LLM's context window. Default 400 ≈ 50k tokens per chunk at ~110 tok/obs. Native sessions are capped by MAX_OBS_PER_SESSION; chunking primarily matters for bulk-imported jsonl sessions, which bypass that cap.
# SUMMARIZE_CHUNK_CONCURRENCY=6 # Parallel chunk LLM calls during chunked summarize. Default 6 fits ~100-chunk sessions under iii's 180s function-invocation timeout at typical ~8s/call. High-throughput providers (Novita, DeepInfra, DeepSeek) commonly allow 100+ concurrent — bump this for very large imported sessions.
# AGENTMEMORY_SUMMARY_TIMEOUT_MS=120000 # Total time budget in whole milliseconds for one mem::summarize run, shared by every chunk call. Default 120000 (2 min). Raise it for slow or local LLMs (Ollama, LM Studio, vLLM) on large chunked sessions that fail with summary_timeout. Session-end and recovery summaries wait this budget plus 60 s; POST /agentmemory/summarize is still cut off by the 180 s HTTP worker timeout, but the summary keeps running and is saved.

# -----------------------------------------------------------------------------
# 5. Behaviour flags
# -----------------------------------------------------------------------------

# AGENTMEMORY_AUTO_COMPRESS=true # Run LLM-written compression on every observation batch. Requires BOTH this flag and a configured provider; a provider alone leaves synthetic compression active.
# AGENTMEMORY_INJECT_CONTEXT=true # Opt in to Claude-style hook context injection. Pi/OMP use 1 in their launch environment for file enrichment; native prompt recall is independent.
# AGENTMEMORY_ENRICH_TIMEOUT_MS=2000 # PreToolUse hook wait (default 2000 ms). Set this in the hook process environment; setting it only in this server env file does not change the hook timeout.
# CONSOLIDATION_ENABLED=false # Disable the consolidation pipeline. Otherwise enabled when an LLM provider is configured, unless AGENTMEMORY_PROVIDER=noop.
# CONSOLIDATION_DECAY_DAYS=30 # Age (days) after which non-reinforced memories decay during consolidation
# GRAPH_EXTRACTION_ENABLED=true # Extract concept-graph edges on remember; powers the graph-traversal recall path
Expand Down Expand Up @@ -166,6 +173,7 @@
# AGENTMEMORY_DEBUG=1 # Trace MCP shim probe + standalone fallback decisions to stderr
# AGENTMEMORY_FORCE_PROXY=1 # Skip the MCP shim livez probe and trust AGENTMEMORY_URL (for sandboxed MCP clients that can't reach localhost)
# AGENTMEMORY_PROBE_TIMEOUT_MS=2000 # MCP shim livez probe timeout
# AGENTMEMORY_CALL_TIMEOUT_MS=190000 # MCP shim and plugin bridge timeout for each proxied REST call, read from the MCP host environment or this file. Default 190000, a little above the 180 s worker invocation limit, so long calls such as memory_consolidate and memory_reflect end on the server first
# AGENTMEMORY_READY_TIMEOUT_MS=300000 # CLI worker readiness deadline, including state loading (5 minutes)
# AGENTMEMORY_ENGINE_READY_TIMEOUT_MS=120000 # CLI engine readiness deadline (2 minutes)
# Startup deadlines accept whole milliseconds from 1 to 3600000. Shell
Expand Down Expand Up @@ -213,10 +221,10 @@
# 8. iii engine pin
# -----------------------------------------------------------------------------
#
# agentmemory pins iii-engine and its iii-sdk dependencies to v0.25.0.
# The CLI downloads the engine into ~/.agentmemory/bin on macOS/Linux.
# Native Windows requires installing the matching iii.exe manually.
# AGENTMEMORY_III_VERSION=0.25.0 # Override only when deliberately matching a different engine
# agentmemory pins iii-engine and its iii-sdk dependencies to v0.25.1.
# The CLI downloads the engine into ~/.agentmemory/bin, including the Windows ZIP.
# AGENTMEMORY_III_VERSION=0.25.1 # Override only when deliberately matching a different engine
# AGENTMEMORY_LOCAL_DISPATCH=true # iii 0.25 runs calls to the worker's own functions in-process; set false for full engine traces

# Engine usage telemetry (iii). Off unless you set it; true opts in.
# III_TELEMETRY_ENABLED=false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
node-version: [20, 22, 24, 26]
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-node@v6
Expand Down
217 changes: 217 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
name: Docker image

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Release version to build, without the leading v (for example 0.9.32)"
required: true
type: string

permissions:
contents: read

env:
IMAGE: docker.io/ghumarerohit/agentmemory

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 90
permissions:
contents: read
outputs:
version: ${{ steps.v.outputs.version }}
steps:
- name: Resolve version
id: v
env:
EVENT: ${{ github.event_name }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
INPUT_VERSION: ${{ inputs.version }}
run: |
if [ "$EVENT" = "release" ]; then
tag="$RELEASE_TAG"
version="${RELEASE_TAG#v}"
else
version="${INPUT_VERSION#v}"
tag="v$version"
fi
if ! printf '%s' "$version" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then
echo "Not a release version: $version" >&2
exit 1
fi
if [ "${#version}" -gt 128 ]; then
echo "Version is longer than the 128-character Docker tag limit: $version" >&2
exit 1
fi
{
echo "version=$version"
echo "tag=$tag"
} >> "$GITHUB_OUTPUT"

- uses: actions/checkout@v6
with:
ref: refs/tags/${{ steps.v.outputs.tag }}
persist-credentials: false

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3

- name: Image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
type=raw,value=${{ steps.v.outputs.version }}
labels: |
org.opencontainers.image.version=${{ steps.v.outputs.version }}
org.opencontainers.image.licenses=Apache-2.0

- name: Build for smoke test
uses: docker/build-push-action@v6
with:
context: .
file: deploy/Dockerfile
platforms: linux/amd64
load: true
tags: agentmemory-smoke:${{ steps.v.outputs.version }}
cache-from: type=gha,scope=docker-image
cache-to: type=gha,scope=docker-image,mode=max

- name: Smoke test
env:
SMOKE_IMAGE: agentmemory-smoke:${{ steps.v.outputs.version }}
run: |
docker run -d --name am-smoke -p 127.0.0.1:3111:3111 "$SMOKE_IMAGE"
for i in $(seq 1 90); do
if curl -fsS http://127.0.0.1:3111/agentmemory/livez >/dev/null; then
echo "livez ok after $((i * 2)) s"
docker rm -f am-smoke >/dev/null
exit 0
fi
if [ "$(docker inspect -f '{{.State.Running}}' am-smoke)" != "true" ]; then
echo "container exited" >&2
break
fi
sleep 2
done
docker logs am-smoke >&2 || true
docker rm -f am-smoke >/dev/null || true
exit 1

- name: Build multi-platform archive
uses: docker/build-push-action@v6
with:
context: .
file: deploy/Dockerfile
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}
provenance: false
sbom: false
outputs: type=oci,dest=${{ runner.temp }}/image.tar
cache-from: type=gha,scope=docker-image
cache-to: type=gha,scope=docker-image,mode=max

- uses: actions/upload-artifact@v4
with:
name: agentmemory-image-${{ steps.v.outputs.version }}
path: ${{ runner.temp }}/image.tar
retention-days: 14
if-no-files-found: error

publish:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 30
environment: docker-hub
permissions:
contents: read
id-token: write
attestations: write
env:
VERSION: ${{ needs.build.outputs.version }}
steps:
- uses: actions/download-artifact@v4
with:
name: agentmemory-image-${{ needs.build.outputs.version }}
path: ${{ runner.temp }}/image

- name: Log in to Docker Hub
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
printf '%s' "$DOCKERHUB_TOKEN" | skopeo login --username "$DOCKERHUB_USERNAME" --password-stdin docker.io
printf '%s' "$DOCKERHUB_TOKEN" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin docker.io

- name: Push version tag
id: push
run: |
skopeo copy --all --preserve-digests \
--digestfile "$RUNNER_TEMP/digest" \
"oci-archive:$RUNNER_TEMP/image/image.tar" \
"docker://$IMAGE:$VERSION"
echo "digest=$(cat "$RUNNER_TEMP/digest")" >> "$GITHUB_OUTPUT"

- name: Verify platforms
run: |
platforms=$(docker buildx imagetools inspect --raw "$IMAGE:$VERSION" \
| jq -r '.manifests[].platform | "\(.os)/\(.architecture)"' | sort -u | tr '\n' ' ')
echo "platforms: $platforms"
for p in linux/amd64 linux/arm64; do
case " $platforms " in
*" $p "*) ;;
*) echo "missing $p in $IMAGE:$VERSION" >&2; exit 1 ;;
esac
done

- uses: actions/attest-build-provenance@v4
with:
subject-name: ${{ env.IMAGE }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

latest:
needs: publish
runs-on: ubuntu-latest
timeout-minutes: 15
environment: docker-hub
permissions:
contents: read
concurrency:
group: docker-hub-latest
cancel-in-progress: false
steps:
- name: Log in to Docker Hub
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: printf '%s' "$DOCKERHUB_TOKEN" | skopeo login --username "$DOCKERHUB_USERNAME" --password-stdin docker.io

- name: Point latest at the newest stable release
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
tags=$(gh api --paginate "repos/$REPO/releases" \
--jq '.[] | select(.draft | not) | select(.prerelease | not) | .tag_name')
newest=$(printf '%s\n' "$tags" \
| sed 's/^v//' \
| { grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' || true; } \
| sort -t. -k1,1n -k2,2n -k3,3n \
| tail -n 1)
if [ -z "$newest" ]; then
echo "No stable release found; leaving latest unchanged."
exit 0
fi
if ! skopeo inspect --raw "docker://$IMAGE:$newest" >/dev/null 2>&1; then
echo "Image for the newest stable release ($newest) is not pushed yet; leaving latest unchanged."
exit 0
fi
skopeo copy --all --preserve-digests "docker://$IMAGE:$newest" "docker://$IMAGE:latest"
echo "latest -> $newest"
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
persist-credentials: false

Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: npm-release-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/npm-release
Expand Down
Loading
Loading