Skip to content
Open
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
144 changes: 144 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,147 @@
# -----------------------------------------------------------------------------

# OBSIDIAN_AUTO_EXPORT=true # Auto-export memories to an Obsidian vault on every consolidation

# Additional runtime and integration configuration
# These commented entries document existing readers without changing defaults.

# Agent isolation mode: shared or isolated; used together with AGENT_ID.
#AGENTMEMORY_AGENT_SCOPE=

# Commit SHA override for integrations invoking the post-commit hook manually.
#AGENTMEMORY_COMMIT_SHA=

# Minimum time between consolidation runs, in milliseconds.
#AGENTMEMORY_CONSOLIDATION_COOLDOWN_MS=

# Use explicit to disable fallback to locally saved credentials.
#AGENTMEMORY_CREDENTIAL_MODE=

# Working-directory fallback for manually invoked post-commit hooks.
#AGENTMEMORY_CWD=

# Set to 1 to disable the managed Compose restart policy.
#AGENTMEMORY_DISABLE_COMPOSE_RESTART=

# Smart-search follow-up diagnostic window for repeated searches with disjoint results, in seconds (default: 30).
#AGENTMEMORY_FOLLOWUP_WINDOW_SECONDS=

# Maximum total managed image-store size, in bytes.
#AGENTMEMORY_IMAGE_STORE_MAX_BYTES=

# Override the worker metrics port chosen by the CLI.
#AGENTMEMORY_METRICS_PORT=

# Override the project name derived by capture hooks.
#AGENTMEMORY_PROJECT_NAME=

# Legacy provider override; noop disables session summarization.
#AGENTMEMORY_PROVIDER=

# Override the base directory for local runtime files.
#AGENTMEMORY_RUNTIME_DIR=

# Session identifier fallback for manually invoked post-commit hooks.
#AGENTMEMORY_SESSION_ID=

# State-worker checkpoint period, in milliseconds.
#AGENTMEMORY_STATE_SAVE_INTERVAL_MS=

# Set to 1 or true to suppress the premium-model cost warning.
#AGENTMEMORY_SUPPRESS_COST_WARNING=

# Enable verbose CLI and worker diagnostic logging.
#AGENTMEMORY_VERBOSE=

# Viewer bind address; the default is 127.0.0.1.
#AGENTMEMORY_VIEWER_HOST=

# Directory containing local state and http worker executables.
#AGENTMEMORY_WORKER_BIN_DIR=

# Agent identifier used by scoped memory operations.
#AGENT_ID=

# Enable diagnostic logging for the Cursor workspace adapter.
#AM_CURSOR_DEBUG=

# Background auto-forget is enabled unless set to false.
#AUTO_FORGET_ENABLED=

# Auto-forget interval in milliseconds; use an integer (default 3600000).
#AUTO_FORGET_INTERVAL_MS=

# Background consolidation interval in milliseconds; use a positive integer.
#CONSOLIDATION_INTERVAL_MS=

# Override the iii-engine WebSocket address.
#III_URL=

# Background insight decay is enabled unless set to false.
#INSIGHT_DECAY_ENABLED=

# Background lesson decay is enabled unless set to false.
#LESSON_DECAY_ENABLED=

# Override the MiniMax Anthropic-compatible API base URL.
#MINIMAX_BASE_URL=

# Azure OpenAI API version for chat and embeddings.
#OPENAI_API_VERSION=

# Optional reasoning_effort value sent to compatible chat endpoints.
#OPENAI_REASONING_EFFORT=

# OpenAI-compatible request timeout, in milliseconds.
#OPENAI_TIMEOUT_MS=

# Requested output dimensions for the selected OpenRouter embedding model.
#OPENROUTER_EMBEDDING_DIMENSIONS=

# Embedding batch size used when rebuilding search indexes.
#REBUILD_EMBED_BATCH_SIZE=

# Set to true to enable the optional cross-encoder reranker.
#RERANK_ENABLED=

# Comma-separated Host header allowlist override for the viewer.
#VIEWER_ALLOWED_HOSTS=

# Override the Claude Code configuration directory used by connect.
#CLAUDE_CONFIG_DIR=

# Override the Cline MCP settings file used by connect.
#CLINE_MCP_SETTINGS_PATH=

# Override the Copilot CLI configuration directory used by connect.
#COPILOT_HOME=

# Override the DSH configuration directory used by connect.
#DSH_HOME=

# Select a suffixed Hermes data directory when HERMES_HOME is unset.
#HERMES_DATA_DIR_SUFFIX=

# Override the Hermes configuration and data directory used by connect.
#HERMES_HOME=

# Oh My Pi profile fallback when PI_PROFILE is unset.
#OMP_PROFILE=

# Override the OpenClaw configuration file used by connect.
#OPENCLAW_CONFIG_PATH=

# Override the OpenClaw home directory used by connect.
#OPENCLAW_HOME=

# Override the OpenClaw state directory used by connect.
#OPENCLAW_STATE_DIR=

# Override the Pi coding-agent configuration directory.
#PI_CODING_AGENT_DIR=

# Override the Oh My Pi configuration directory used by connect.
#PI_CONFIG_DIR=

# Select the Pi or Oh My Pi configuration profile.
#PI_PROFILE=
50 changes: 24 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
name: CI

# `paths-ignore` keeps doc-only / website / README / CHANGELOG churn from
# burning runner minutes. Source / config / workflow changes always run.
# `workflow_dispatch` gives a manual re-run button for flake debugging.
# Cheap guards run for every change; only source changes need the test matrix.
on:
push:
branches: [main]
paths-ignore:
- "README.md"
- "CHANGELOG.md"
- "AGENTS.md"
- "ROADMAP.md"
- "website/**"
- "docs/**"
- "assets/**"
- "deploy/**/README.md"
- "**/*.md"
- "**/*.mdx"
pull_request:
branches: [main]
paths-ignore:
- "README.md"
- "CHANGELOG.md"
- "AGENTS.md"
- "ROADMAP.md"
- "website/**"
- "docs/**"
- "assets/**"
- "deploy/**/README.md"
- "**/*.md"
- "**/*.mdx"
workflow_dispatch:

# Cancel in-flight PR runs when a force-push lands. Keep push runs to
Expand All @@ -42,7 +18,29 @@ permissions:
contents: read

jobs:
quality:
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.changes.outputs.run_tests }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 22
- id: changes
run: node scripts/ci-changes.mjs
- run: npm install --legacy-peer-deps --no-audit --no-fund
- run: npm run typecheck
- run: npm run skills:check
- run: npm run docs:check
- run: npm run env:check

test:
needs: quality
if: needs.quality.outputs.run_tests == 'true'
runs-on: ${{ matrix.os }}
strategy:
# Don't bail the whole matrix on one cell's failure — we want to
Expand Down Expand Up @@ -73,4 +71,4 @@ jobs:
- run: npm run build
- run: npm run skills:check
- run: npx tsc --noEmit --project tsconfig.eval.json
- run: npm test
- run: npm run test:ci
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).
- 147 REST endpoints
- 6 MCP resources, 3 MCP prompts
- 12 hooks, 17 skills
- 322+ iii functions
- 323 iii functions
- 4,900+ tests
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ Six PRs landed since v0.9.12 — `.env.example` discovery shipped (#372), CJK BM

- **`agentmemory init` command**. Copies the bundled `.env.example` to `~/.agentmemory/.env` if that file doesn't already exist; refuses to overwrite an existing config and prints a diff command pointing at the latest template. Wired into the CLI help block alongside `status` / `doctor` / `demo` / `upgrade` / `mcp` / `import-jsonl`.

- **CI sync-checker for `.env.example`** (`scripts/check-env-example.mjs`). Walks every `.ts` / `.mts` / `.mjs` / `.js` file under `src/`, extracts `process.env["KEY"]` / `env["KEY"]` / `getMergedEnv()["KEY"]` / `getEnvVar("KEY")` references, and fails CI when `src/` reads an env var the template doesn't document (or vice versa). Plugged into `.github/workflows/ci.yml` after `npm test`. Initial bootstrap: 60 keys in sync.
- **CI sync-checker for `.env.example`** (`scripts/check-env-example.mjs`). Walks every `.ts` / `.mts` / `.mjs` / `.js` file under `src/`, extracts `process.env["KEY"]` / `env["KEY"]` / `getMergedEnv()["KEY"]` / `getEnvVar("KEY")` references, and fails CI when `src/` reads an env var the template doesn't document (or vice versa). Runs as `npm run env:check` in the always-on `quality` job of `.github/workflows/ci.yml`, before the conditional test matrix. Initial bootstrap: 60 keys in sync.

- **CJK tokenizer for BM25 search** ([#344](https://github.com/rohitg00/agentmemory/issues/344), PR [#362](https://github.com/rohitg00/agentmemory/pull/362)). New `src/state/cjk-segmenter.ts` detects CJK input by Unicode block and routes to `@node-rs/jieba` (Chinese, native, no model download), `tiny-segmenter` (Japanese, pure JS, ~25 KB), or rule-based syllable-block split (Korean). Both segmenters declared in `optionalDependencies` so the base install stays lean; soft-fail with a one-time stderr hint when the dep is missing. Order-preserving single-pass tokenization across mixed CJK + non-CJK runs (regression test for `"abc 메모리 def 项目 ghi"` returns `["abc","메모리","def","项目","ghi"]`).

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"migrate": "node dist/functions/migrate.js",
"pretest": "npm run build",
"test": "vitest run --exclude test/integration.test.ts",
"test:ci": "vitest run --exclude test/integration.test.ts",
"typecheck": "tsc --noEmit --project tsconfig.json",
"env:check": "node scripts/check-env-example.mjs",
"test:watch": "vitest --exclude test/integration.test.ts",
"test:integration": "vitest run test/integration.test.ts",
"test:all": "vitest run",
Expand Down
Loading