Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

chore(docker): load provider config from .env and document opencode

Pedro Cardosod50a637a54b8
diff --git a/docker/.env.production.example b/docker/.env.production.example
index 0d368cdd..54651cd9 100644
--- a/docker/.env.production.example
+++ b/docker/.env.production.example
@@ -15,7 +15,7 @@
# AI_MEMORY_PROJECT=homelab
# -- LLM provider ------------------------------------------------------
-# Pick one of: anthropic | openai | openai-oauth | copilot | gemini | openai-compat
+# Pick one of: anthropic | openai | openai-oauth | copilot | gemini | openai-compat | opencode
# anthropic -> Anthropic Messages API (needs ANTHROPIC_API_KEY)
# openai -> OpenAI Chat Completions (needs OPENAI_API_KEY)
# openai-oauth -> ChatGPT/Codex OAuth. Run `ai-memory auth login
@@ -27,6 +27,9 @@
# openai-compat -> Any OpenAI-compatible endpoint: Ollama, vLLM,
# LM Studio, OpenRouter, Together, etc. Set
# AI_MEMORY_LLM_BASE_URL + LLM_API_KEY.
+# opencode -> OpenCode Zen/Go cloud (https://opencode.ai/zen/go/v1).
+# Get your key at opencode.ai/auth. Set OPENCODE_API_KEY.
+# Default model: claude-sonnet-4-6.
#
# Without AI_MEMORY_LLM_PROVIDER set, consolidation falls back to
# rule-based summaries (no LLM cost; lower-signal handoffs).
@@ -39,6 +42,7 @@ AI_MEMORY_LLM_MODEL=moonshotai/kimi-k2.6
# ANTHROPIC_API_KEY=sk-ant-...
# OPENAI_API_KEY=sk-...
# COPILOT_GITHUB_TOKEN=ghu_or_github_pat_REPLACE_ME
+# OPENCODE_API_KEY=sk-... (from opencode.ai/auth, for AI_MEMORY_LLM_PROVIDER=opencode)
LLM_API_KEY=sk-or-v1-REPLACE_ME
# -- Embeddings (hybrid retrieval) -------------------------------------
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 82f3840d..6e510e5e 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -23,19 +23,14 @@ services:
# Bind to loopback by default; flip to 0.0.0.0:49374 when serving
# the homelab LAN. Keep behind a reverse proxy if you do.
- "127.0.0.1:49374:49374"
+ env_file:
+ - path: .env
+ required: false
environment:
- RUST_LOG=ai_memory=info,ai_memory_store=info,ai_memory_wiki=info,ai_memory_mcp=info,tracing_appender=warn
- # Uncomment ONE provider block. All are opt-in; omit to run zero-LLM.
- #
- # Option A — Anthropic API key
- #- AI_MEMORY_LLM_PROVIDER=anthropic
- #- ANTHROPIC_API_KEY=sk-ant-...
- #
- # Option B — Anthropic via Claude Pro/Max subscription (claude setup-token)
- # WARNING: unofficial, against Anthropic's usage policies — use at your
- # own risk (may get your account rate-limited/banned). See docs/install.md.
- #- AI_MEMORY_LLM_PROVIDER=anthropic-oauth
- #- ANTHROPIC_OAUTH_TOKEN=
+ # LLM provider configured via docker/.env (gitignored).
+ # Options: anthropic | openai | openai-compat | gemini | copilot
+ # See .env.production.example for full reference.
healthcheck:
test: ["CMD", "/usr/local/bin/ai-memory", "status"]
interval: 30s