Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ docker run -d --name agentmemory \

Keep `/data` on a persistent volume: it holds the memories, the generated secret (`docker exec agentmemory cat /data/secret`) and the worker cache. The container fetches the pinned `state` and `http` registry workers on first start, so it needs network access then. Set `AGENTMEMORY_SECRET`, `EMBEDDING_PROVIDER` and the other variables from the sections above with `-e`. The `latest` tag points at the image for the highest stable release version (semver order, prereleases and drafts excluded), so an older, backported or prerelease build never replaces it. Pin a version tag for deployments.

## LLM and embedding providers

A provider key alone turns nothing on. To use LLM summaries and compression, set `AGENTMEMORY_LLM_PROVIDER` (`anthropic`, `openai`, `gemini`, `openrouter` or `minimax`) and that provider's key. To use cloud embeddings, set `EMBEDDING_PROVIDER` and its key. All the Compose files above forward both selectors to the worker.

## Local embeddings

Set `EMBEDDING_PROVIDER=local` to generate embeddings without an API key. The shared image includes `@huggingface/transformers` and its runtime dependencies; the image build checks that the package loads after pruning development dependencies. Only ONNX native binaries for the image's platform and architecture are retained; other runtime dependencies remain installed. Model weights are not bundled: the first embedding request downloads `Xenova/all-MiniLM-L6-v2` from Hugging Face and requires network access.
Expand Down
1 change: 1 addition & 0 deletions deploy/coolify/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
VIEWER_ALLOWED_HOSTS: "${VIEWER_ALLOWED_HOSTS:-localhost:3113,127.0.0.1:3113,[::1]:3113}"
VIEWER_ALLOWED_ORIGINS: "${VIEWER_ALLOWED_ORIGINS:-http://localhost:3113,http://127.0.0.1:3113}"
EMBEDDING_PROVIDER: "${EMBEDDING_PROVIDER:-}"
AGENTMEMORY_LLM_PROVIDER: "${AGENTMEMORY_LLM_PROVIDER:-}"
OPENAI_API_KEY: "${OPENAI_API_KEY:-}"
OPENAI_API_KEY_FOR_LLM: "${OPENAI_API_KEY_FOR_LLM:-}"
OPENAI_BASE_URL: "${OPENAI_BASE_URL:-}"
Expand Down
1 change: 1 addition & 0 deletions deploy/runtime/worker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ containers:
VIEWER_ALLOWED_HOSTS: "${VIEWER_ALLOWED_HOSTS:-localhost:3113,127.0.0.1:3113,[::1]:3113}"
VIEWER_ALLOWED_ORIGINS: "${VIEWER_ALLOWED_ORIGINS:-http://localhost:3113,http://127.0.0.1:3113}"
EMBEDDING_PROVIDER: "${EMBEDDING_PROVIDER:-}"
AGENTMEMORY_LLM_PROVIDER: "${AGENTMEMORY_LLM_PROVIDER:-}"
Comment thread
rohitg00 marked this conversation as resolved.
Resolved
OPENAI_API_KEY: "${OPENAI_API_KEY:-}"
OPENAI_API_KEY_FOR_LLM: "${OPENAI_API_KEY_FOR_LLM:-}"
OPENAI_BASE_URL: "${OPENAI_BASE_URL:-}"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
VIEWER_ALLOWED_HOSTS: "${VIEWER_ALLOWED_HOSTS:-localhost:${AGENTMEMORY_VIEWER_PORT:-3113},127.0.0.1:${AGENTMEMORY_VIEWER_PORT:-3113},[::1]:${AGENTMEMORY_VIEWER_PORT:-3113}}"
VIEWER_ALLOWED_ORIGINS: "${VIEWER_ALLOWED_ORIGINS:-http://localhost:${AGENTMEMORY_VIEWER_PORT:-3113},http://127.0.0.1:${AGENTMEMORY_VIEWER_PORT:-3113}}"
EMBEDDING_PROVIDER: "${EMBEDDING_PROVIDER:-}"
AGENTMEMORY_LLM_PROVIDER: "${AGENTMEMORY_LLM_PROVIDER:-}"
OPENAI_API_KEY: "${OPENAI_API_KEY:-}"
OPENAI_API_KEY_FOR_LLM: "${OPENAI_API_KEY_FOR_LLM:-}"
OPENAI_BASE_URL: "${OPENAI_BASE_URL:-}"
Expand Down
29 changes: 29 additions & 0 deletions test/compose-project.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,35 @@ describe("Worker Compose project", () => {
expect(text.slice(0, text.indexOf("containers:")).concat(text.slice(text.indexOf(" state:"), text.indexOf(" agentmemory:")))).not.toContain("fake-gate-key");
});

it("forwards every provider selector and gate wherever provider keys are forwarded", () => {
const selectors = {
AGENTMEMORY_LLM_PROVIDER: "anthropic",
EMBEDDING_PROVIDER: "openai",
AGENTMEMORY_ALLOW_AGENT_SDK: "true",
AGENTMEMORY_INJECT_CONTEXT: "true",
ANTHROPIC_MODEL: "model-a",
ANTHROPIC_BASE_URL: "http://127.0.0.1:4556",
OPENAI_MODEL: "model-b",
OPENAI_BASE_URL: "http://127.0.0.1:4555",
GEMINI_MODEL: "model-c",
OPENROUTER_MODEL: "model-d",
MINIMAX_MODEL: "model-e",
MINIMAX_BASE_URL: "http://127.0.0.1:4557",
};
const native = parse(renderWorkerCompose(options({ workerEnvironment: selectors })));
expect(native.containers.agentmemory.environment).toMatchObject(selectors);
const files = {
"deploy/runtime/worker-compose.yaml": parse(readFileSync(new URL("../deploy/runtime/worker-compose.yaml", import.meta.url), "utf8")).containers.agentmemory.environment,
"docker-compose.yml": parse(readFileSync(new URL("../docker-compose.yml", import.meta.url), "utf8")).services.agentmemory.environment,
"deploy/coolify/docker-compose.yml": parse(readFileSync(new URL("../deploy/coolify/docker-compose.yml", import.meta.url), "utf8")).services.agentmemory.environment,
};
for (const [file, environment] of Object.entries(files)) {
for (const key of Object.keys(selectors)) {
expect(environment[key], `${file} forwards ${key}`).toBe("${" + key + ":-}");
}
}
});

it("preserves memory policy, provider and durability overrides in native and Docker workers", async () => {
const settings = {
FALLBACK_PROVIDERS: "openai,gemini",
Expand Down
Loading