@bcmyguest/openmem 0.0.0-stage → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +136 -2
- package/bin/hindsight-project-index +530 -0
- package/cli/coding-agent/access-policy.mjs +38 -0
- package/cli/coding-agent/agents.mjs +34 -0
- package/cli/coding-agent/bank-from-cwd.mjs +140 -0
- package/cli/coding-agent/capabilities.mjs +23 -0
- package/cli/coding-agent/hook-harnesses.mjs +87 -0
- package/cli/coding-agent/hook-runner.mjs +260 -0
- package/cli/coding-agent/install-access.mjs +93 -0
- package/cli/coding-agent/install-shim.mjs +97 -0
- package/cli/coding-agent/opencode-config.mjs +91 -0
- package/cli/coding-agent/opencode-plugin.mjs +96 -0
- package/cli/coding-agent/runtime.mjs +39 -0
- package/cli/coding-agent/session-facade.mjs +62 -0
- package/cli/cognee-mcp.mjs +260 -0
- package/cli/feed-sync.mjs +11 -0
- package/cli/install-coding-agent.mjs +165 -0
- package/cli/install-memory-mcp.mjs +426 -0
- package/cli/is-main.mjs +18 -0
- package/cli/mcp/context.mjs +61 -0
- package/cli/mcp/export/cognee-dataset-name.mjs +12 -0
- package/cli/mcp/export/cognee.mjs +119 -0
- package/cli/mcp/export/hindsight.mjs +48 -0
- package/cli/mcp/export/index.mjs +26 -0
- package/cli/mcp/export/mem0.mjs +31 -0
- package/cli/mcp/llm-synthesize.mjs +50 -0
- package/cli/mcp/mem0-scope-id.mjs +22 -0
- package/cli/mcp/memory-facade.mjs +455 -0
- package/cli/mcp/memory-reflect-consolidate.mjs +120 -0
- package/cli/mcp/notebooklm-banks.mjs +21 -0
- package/cli/mcp/notebooklm-hindsight-rest.mjs +45 -0
- package/cli/mcp/notebooklm-provider.mjs +225 -0
- package/cli/mcp/pmm-records.mjs +23 -0
- package/cli/mcp/portability.mjs +158 -0
- package/cli/mcp/stdio.mjs +65 -0
- package/cli/mcp/unified-mcp-install.mjs +65 -0
- package/cli/mem0-mcp.mjs +108 -0
- package/cli/notebooklm-mcp.mjs +236 -0
- package/cli/openmem-mcp.mjs +35 -0
- package/cli/openmem.mjs +205 -0
- package/cli/roots.mjs +85 -0
- package/cli/stack.mjs +436 -0
- package/cli/switch-memory-provider.mjs +358 -0
- package/cli/wiring-report.mjs +125 -0
- package/compose.bench.yaml +12 -0
- package/compose.yaml +164 -0
- package/config/coding-agent.json +13 -0
- package/config/hindsight.env.example +24 -0
- package/config/index.yml +54 -0
- package/config/litellm.lemond.yaml +40 -0
- package/config/litellm.ollama.yaml +33 -0
- package/config/notebooklm.yml +33 -0
- package/config/openmem.toml.example +62 -0
- package/docs/OPENMEM.md +23 -0
- package/docs/architecture.md +219 -0
- package/docs/assets/README.md +10 -0
- package/docs/assets/setup-demo.gif +0 -0
- package/docs/coding-agent-hooks.md +51 -0
- package/docs/coding-agent-scopes.md +22 -0
- package/docs/coding-agents.md +51 -0
- package/docs/cognee.md +37 -0
- package/docs/concepts.md +112 -0
- package/docs/hindsight.md +74 -0
- package/docs/index-sources-roadmap.md +38 -0
- package/docs/index-sources.md +39 -0
- package/docs/indexer-sinks.md +122 -0
- package/docs/indexing.md +57 -0
- package/docs/manual-stack-setup.md +74 -0
- package/docs/mcp-install-guide.md +4 -0
- package/docs/mcp-setup.md +101 -0
- package/docs/mem0.md +103 -0
- package/docs/memory-portability.md +73 -0
- package/docs/memory-providers.md +246 -0
- package/docs/model-configuration.md +84 -0
- package/docs/notebooklm.md +83 -0
- package/docs/npx-install.md +170 -0
- package/docs/openmem-config.md +194 -0
- package/docs/provider-wizard-hooks.md +222 -0
- package/docs/quickstart.md +101 -0
- package/docs/setup-wizard.md +116 -0
- package/docs/sources-feeds.md +52 -0
- package/docs/sources-readwise.md +23 -0
- package/docs/sources-zotero.md +22 -0
- package/glama.json +4 -0
- package/indexer/Dockerfile +38 -0
- package/indexer/code_outline.py +146 -0
- package/indexer/feed_sync.py +107 -0
- package/indexer/index_config.py +290 -0
- package/indexer/pytest.ini +5 -0
- package/indexer/sinks/__init__.py +148 -0
- package/indexer/sinks/_http.py +44 -0
- package/indexer/sinks/cognee.py +329 -0
- package/indexer/sinks/hindsight.py +107 -0
- package/indexer/sinks/mem0.py +247 -0
- package/indexer/watch.py +240 -0
- package/package.json +95 -4
- package/providers/_template/compose.yaml +52 -0
- package/providers/cognee/OPERATOR.md +82 -0
- package/providers/cognee/compose.yaml +89 -0
- package/providers/cognee/lib/clack.mjs +157 -0
- package/providers/cognee/lib/coding-agent.mjs +26 -0
- package/providers/cognee/lib/cognee-mcp-install.mjs +153 -0
- package/providers/cognee/lib/config.mjs +98 -0
- package/providers/cognee/lib/env-file.mjs +194 -0
- package/providers/cognee/lib/env-setup.mjs +83 -0
- package/providers/cognee/lib/llm-env.mjs +382 -0
- package/providers/cognee/lib/ports.mjs +25 -0
- package/providers/cognee/lib/smoke.mjs +246 -0
- package/providers/cognee/lib/stack-env.mjs +134 -0
- package/providers/cognee/lib/state.mjs +101 -0
- package/providers/cognee/lib/summary.mjs +56 -0
- package/providers/cognee/lib/validate.mjs +97 -0
- package/providers/cognee/manifest.json +56 -0
- package/providers/cognee/wizard.mjs +134 -0
- package/providers/graphiti/manifest.json +15 -0
- package/providers/hindsight/lib/clack.mjs +245 -0
- package/providers/hindsight/lib/coding-agent.mjs +204 -0
- package/providers/hindsight/lib/config.mjs +73 -0
- package/providers/hindsight/lib/env-setup.mjs +71 -0
- package/providers/hindsight/lib/litellm-routes.mjs +187 -0
- package/providers/hindsight/lib/model-backend.mjs +214 -0
- package/providers/hindsight/lib/notebooklm-mcp-install.mjs +127 -0
- package/providers/hindsight/lib/ollama-compose.mjs +51 -0
- package/providers/hindsight/lib/ports.mjs +30 -0
- package/providers/hindsight/lib/probe.mjs +33 -0
- package/providers/hindsight/lib/stack-env.mjs +132 -0
- package/providers/hindsight/lib/state.mjs +75 -0
- package/providers/hindsight/lib/summary.mjs +43 -0
- package/providers/hindsight/lib/validate.mjs +75 -0
- package/providers/hindsight/manifest.json +58 -0
- package/providers/hindsight/wizard.mjs +149 -0
- package/providers/letta/manifest.json +29 -0
- package/providers/mem0/OPERATOR.md +124 -0
- package/providers/mem0/compose.yaml +57 -0
- package/providers/mem0/lib/coding-agent.mjs +58 -0
- package/providers/mem0/lib/config.mjs +45 -0
- package/providers/mem0/lib/configure.mjs +135 -0
- package/providers/mem0/lib/dotenv.mjs +71 -0
- package/providers/mem0/lib/env-file.mjs +110 -0
- package/providers/mem0/lib/http.mjs +69 -0
- package/providers/mem0/lib/mcp-install.mjs +165 -0
- package/providers/mem0/lib/secret.mjs +30 -0
- package/providers/mem0/lib/smoke.mjs +179 -0
- package/providers/mem0/lib/stack-env.mjs +216 -0
- package/providers/mem0/lib/state.mjs +67 -0
- package/providers/mem0/lib/summary.mjs +60 -0
- package/providers/mem0/lib/url.mjs +106 -0
- package/providers/mem0/lib/validate.mjs +158 -0
- package/providers/mem0/manifest.json +47 -0
- package/providers/mem0/wizard.mjs +133 -0
- package/providers/zep/manifest.json +29 -0
- package/scripts/check-pack.mjs +218 -0
- package/scripts/gen-masks.mjs +83 -0
- package/scripts/gen-masks.sh +4 -0
- package/scripts/promotion-provider-smoke.mjs +34 -0
- package/scripts/run-setup.sh +30 -0
- package/scripts/setup.mjs +94 -0
- package/scripts/setup.sh +5 -0
- package/scripts/spin-up.sh +45 -0
- package/scripts/wizard.sh +5 -0
- package/server.json +34 -0
- package/skills/openmem/SKILL.md +29 -0
- package/sync/Dockerfile +27 -0
- package/sync/memory_backend.py +87 -0
- package/sync/notebooklm_sync.py +664 -0
- package/wizard/bin/pm.mjs +97 -0
- package/wizard/bin/setup.mjs +33 -0
- package/wizard/lib/compose-version.mjs +32 -0
- package/wizard/lib/compose.mjs +70 -0
- package/wizard/lib/curl.mjs +103 -0
- package/wizard/lib/docker-build.mjs +148 -0
- package/wizard/lib/exec.mjs +41 -0
- package/wizard/lib/indexer.mjs +6 -0
- package/wizard/lib/load-machine-env.mjs +4 -0
- package/wizard/lib/log.mjs +32 -0
- package/wizard/lib/notebooklm-agent-access.mjs +92 -0
- package/wizard/lib/notebooklm.mjs +214 -0
- package/wizard/lib/parse-args.mjs +87 -0
- package/wizard/lib/paths.mjs +39 -0
- package/wizard/lib/pm-config.mjs +163 -0
- package/wizard/lib/ports.mjs +94 -0
- package/wizard/lib/prompts.mjs +57 -0
- package/wizard/lib/provider-wizard/helpers.mjs +98 -0
- package/wizard/lib/provider-wizard/run-steps.mjs +129 -0
- package/wizard/lib/providers/registry.mjs +262 -0
- package/wizard/lib/run-clack.mjs +108 -0
- package/wizard/lib/run-wizard.mjs +755 -0
- package/wizard/lib/validate-setup.mjs +62 -0
- package/wizard/lib/wizard-action.mjs +34 -0
- package/wizard/lib/wizard-conf.mjs +71 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Copy to ~/.config/hindsight/hindsight.env and edit. The real file lives outside the repository;
|
|
2
|
+
# compose.yaml reads it from there (or $HINDSIGHT_ENV_FILE).
|
|
3
|
+
# Docker reaches host services at host.docker.internal.
|
|
4
|
+
# All LLM calls go to the LiteLLM proxy (compose service `litellm`). Models are chosen in config/litellm.*.yaml.
|
|
5
|
+
# scripts/setup.sh --migrate-env writes HINDSIGHT_API_LLM_API_KEY from ~/.config/hindsight/litellm.env.
|
|
6
|
+
HINDSIGHT_API_LLM_PROVIDER=openai
|
|
7
|
+
HINDSIGHT_API_LLM_BASE_URL=http://litellm:4000/v1
|
|
8
|
+
HINDSIGHT_API_LLM_MODEL=memory-reflect
|
|
9
|
+
HINDSIGHT_API_RETAIN_LLM_MODEL=memory-retain
|
|
10
|
+
HINDSIGHT_API_REFLECT_LLM_MODEL=memory-reflect
|
|
11
|
+
HINDSIGHT_API_CONSOLIDATION_LLM_MODEL=memory-consolidate
|
|
12
|
+
HINDSIGHT_API_MENTAL_MODEL_REFRESH_LLM_MODEL=memory-reflect
|
|
13
|
+
HINDSIGHT_API_LLM_API_KEY=replace-me
|
|
14
|
+
HINDSIGHT_API_EMBEDDINGS_PROVIDER=local
|
|
15
|
+
HINDSIGHT_API_RERANKER_PROVIDER=local
|
|
16
|
+
HINDSIGHT_API_WORKER_ID=hindsight-personal
|
|
17
|
+
HINDSIGHT_API_SKIP_LLM_VERIFICATION=true
|
|
18
|
+
HINDSIGHT_API_LLM_MAX_CONCURRENT=1
|
|
19
|
+
HINDSIGHT_API_LLM_TIMEOUT=300
|
|
20
|
+
HINDSIGHT_API_LLM_MAX_RETRIES=1
|
|
21
|
+
|
|
22
|
+
HINDSIGHT_API_RETAIN_MAX_COMPLETION_TOKENS=16384
|
|
23
|
+
HINDSIGHT_API_REFLECT_MAX_COMPLETION_TOKENS=2048
|
|
24
|
+
HINDSIGHT_API_CONSOLIDATION_MAX_COMPLETION_TOKENS=2048
|
package/config/index.yml
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Project indexer config. The indexer reads the first of: --config PATH, $HINDSIGHT_INDEX_CONFIG,
|
|
2
|
+
# ~/.config/hindsight/index.yml, this file. A per-machine file replaces this one entirely; keys it omits
|
|
3
|
+
# take the built-in values, which match this file. Paths are absolute or start with ~ (a bare ~ is null
|
|
4
|
+
# in YAML, which also means home under roots[].path).
|
|
5
|
+
|
|
6
|
+
# Git repositories: walk each root to `depth` levels and index the outermost repositories found.
|
|
7
|
+
roots:
|
|
8
|
+
- path: ~
|
|
9
|
+
depth: 3
|
|
10
|
+
|
|
11
|
+
# Extra repositories, indexed even when no root reaches them.
|
|
12
|
+
repos:
|
|
13
|
+
- ~/.config/nvim
|
|
14
|
+
|
|
15
|
+
vaults:
|
|
16
|
+
auto: true # any folder within a root's depth that contains .obsidian/
|
|
17
|
+
paths: [] # extra vault folders
|
|
18
|
+
|
|
19
|
+
# Markdown folders without .obsidian (watched like vaults; banks default to <kind>::<slug>).
|
|
20
|
+
notes:
|
|
21
|
+
paths: []
|
|
22
|
+
papers:
|
|
23
|
+
paths: [] # e.g. Zotero Better BibTeX markdown export, arXiv notes, PDF-adjacent .md
|
|
24
|
+
bookmarks:
|
|
25
|
+
paths: [] # e.g. browser export (Linkwarden, Karakeep, manual markdown dumps)
|
|
26
|
+
|
|
27
|
+
# Optional: pull RSS/arXiv/OpenAlex into out_dir; indexer watches out_dir as kind `feed`.
|
|
28
|
+
feeds:
|
|
29
|
+
out_dir: ~/.local/share/personal-memory/feeds
|
|
30
|
+
rss: []
|
|
31
|
+
openalex_queries: []
|
|
32
|
+
|
|
33
|
+
# Glob patterns on absolute paths. A source that matches is skipped.
|
|
34
|
+
exclude: []
|
|
35
|
+
|
|
36
|
+
# Absolute path prefix -> Hindsight bank id. The longest matching prefix wins; applies to repos and vaults.
|
|
37
|
+
# Unmatched repositories fall back to ~/.config/personal-memory/coding-agent.json mapPathToBank,
|
|
38
|
+
# then the legacy ~/.hindsight/coding-agent.json mapping, then coding-agent::<repository-name>.
|
|
39
|
+
banks:
|
|
40
|
+
~/Documents/sample-project: coding-agent::documents-sample-project
|
|
41
|
+
# ~/Zotero/export-md: papers::zotero
|
|
42
|
+
# ~/Readwise/Full-Sync: readwise::full-sync
|
|
43
|
+
# ~/.local/share/personal-memory/feeds: feed::cache
|
|
44
|
+
|
|
45
|
+
# Largest file indexed, in kilobytes (1 KB = 1000 bytes).
|
|
46
|
+
max_file_kb: 128
|
|
47
|
+
|
|
48
|
+
# Directory names never descended into (dot-prefixed directories are always skipped).
|
|
49
|
+
skip_dirs: [.cache, .codegraph, .decision, .git, .next, .tasks, .venv, build, dist, node_modules, target, vendor]
|
|
50
|
+
|
|
51
|
+
# Watcher timings, in seconds. Environment variables POLL_SECONDS, VAULT_QUIET_SECONDS and RELIST_SECONDS override them.
|
|
52
|
+
poll_seconds: 60
|
|
53
|
+
vault_quiet_seconds: 30
|
|
54
|
+
relist_seconds: 600
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# LiteLLM routes for Hindsight, backend: lemond on this machine (llama.cpp).
|
|
2
|
+
# Selected by scripts/setup.sh when MEMORY_BACKEND=lemond (the default). See README "Model configuration".
|
|
3
|
+
# Hindsight asks for the fixed aliases below; change the model behind an alias here, not in Hindsight.
|
|
4
|
+
# Every alias runs Nemotron 3.5 Bolt E4B (JSON output and tool calls checked 2026-10-23) with thinking disabled:
|
|
5
|
+
# thinking adds tokens before the answer, and at max_tokens 200 can leave content empty.
|
|
6
|
+
# Passed through to lemond's chat template. Hindsight's per-request reasoning_effort cannot override it.
|
|
7
|
+
model_list:
|
|
8
|
+
- model_name: memory-retain
|
|
9
|
+
litellm_params:
|
|
10
|
+
model: openai/Nemotron-3.5-Bolt-E4B-GGUF
|
|
11
|
+
api_base: http://host.docker.internal:13305/v1
|
|
12
|
+
max_tokens: 4096
|
|
13
|
+
timeout: 300
|
|
14
|
+
api_key: os.environ/LEMOND_API_KEY
|
|
15
|
+
extra_body:
|
|
16
|
+
chat_template_kwargs:
|
|
17
|
+
enable_thinking: false
|
|
18
|
+
- model_name: memory-reflect
|
|
19
|
+
litellm_params:
|
|
20
|
+
model: openai/Nemotron-3.5-Bolt-E4B-GGUF
|
|
21
|
+
api_base: http://host.docker.internal:13305/v1
|
|
22
|
+
max_tokens: 4096
|
|
23
|
+
timeout: 300
|
|
24
|
+
api_key: os.environ/LEMOND_API_KEY
|
|
25
|
+
extra_body:
|
|
26
|
+
chat_template_kwargs:
|
|
27
|
+
enable_thinking: false
|
|
28
|
+
- model_name: memory-consolidate
|
|
29
|
+
litellm_params:
|
|
30
|
+
model: openai/Nemotron-3.5-Bolt-E4B-GGUF
|
|
31
|
+
api_base: http://host.docker.internal:13305/v1
|
|
32
|
+
max_tokens: 4096
|
|
33
|
+
timeout: 300
|
|
34
|
+
api_key: os.environ/LEMOND_API_KEY
|
|
35
|
+
extra_body:
|
|
36
|
+
chat_template_kwargs:
|
|
37
|
+
enable_thinking: false
|
|
38
|
+
|
|
39
|
+
general_settings:
|
|
40
|
+
master_key: os.environ/LITELLM_MASTER_KEY
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# LiteLLM routes for Hindsight, backend: Ollama on a laptop.
|
|
2
|
+
# Selected by scripts/setup.sh when MEMORY_BACKEND=ollama. See README "Model configuration".
|
|
3
|
+
# Hindsight asks for the fixed aliases below; change the model behind an alias here, not in Hindsight.
|
|
4
|
+
# Every alias disables Gemma thinking: thinking adds tokens before the answer, and at max_tokens 200 can leave content empty.
|
|
5
|
+
# Sent as Ollama's top-level "think": false. Overrides Hindsight's per-request reasoning_effort.
|
|
6
|
+
model_list:
|
|
7
|
+
- model_name: memory-retain
|
|
8
|
+
litellm_params:
|
|
9
|
+
model: ollama_chat/gemma4:e2b
|
|
10
|
+
api_base: http://host.docker.internal:11434
|
|
11
|
+
max_tokens: 4096
|
|
12
|
+
timeout: 300
|
|
13
|
+
extra_body:
|
|
14
|
+
think: false
|
|
15
|
+
- model_name: memory-reflect
|
|
16
|
+
litellm_params:
|
|
17
|
+
model: ollama_chat/gemma4:e4b
|
|
18
|
+
api_base: http://host.docker.internal:11434
|
|
19
|
+
max_tokens: 4096
|
|
20
|
+
timeout: 300
|
|
21
|
+
extra_body:
|
|
22
|
+
think: false
|
|
23
|
+
- model_name: memory-consolidate
|
|
24
|
+
litellm_params:
|
|
25
|
+
model: ollama_chat/gemma4:e2b
|
|
26
|
+
api_base: http://host.docker.internal:11434
|
|
27
|
+
max_tokens: 4096
|
|
28
|
+
timeout: 300
|
|
29
|
+
extra_body:
|
|
30
|
+
think: false
|
|
31
|
+
|
|
32
|
+
general_settings:
|
|
33
|
+
master_key: os.environ/LITELLM_MASTER_KEY
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# NotebookLM sync (opt-in: docker compose --profile notebooklm up -d notebooklm).
|
|
2
|
+
# Per-machine override: ~/.config/hindsight/notebooklm.yml. Put only the keys you change there;
|
|
3
|
+
# mappings merge key by key, lists and scalars replace the shipped value.
|
|
4
|
+
|
|
5
|
+
enabled: false
|
|
6
|
+
|
|
7
|
+
# client: unofficial notebooklm-py client, uses the browser login stored in ~/.config/notebooklm.
|
|
8
|
+
# enterprise: documented NotebookLM Enterprise REST API (notebook list only; see README).
|
|
9
|
+
backend: client
|
|
10
|
+
|
|
11
|
+
interval_minutes: 60
|
|
12
|
+
|
|
13
|
+
# Hindsight bank per notebook: <bank_prefix>::<slug of notebook title>.
|
|
14
|
+
bank_prefix: notebooklm
|
|
15
|
+
|
|
16
|
+
# Title globs (fnmatch, case-insensitive). include empty means every notebook.
|
|
17
|
+
include_notebooks: []
|
|
18
|
+
exclude_notebooks: []
|
|
19
|
+
|
|
20
|
+
include:
|
|
21
|
+
notes: true
|
|
22
|
+
sources: true # source list, URLs, full text and guide summary where the client returns them
|
|
23
|
+
chats: false # saved chat question/answer history
|
|
24
|
+
|
|
25
|
+
client:
|
|
26
|
+
# Empty uses NOTEBOOKLM_HOME (set to /data/notebooklm in the container).
|
|
27
|
+
storage_path: ""
|
|
28
|
+
|
|
29
|
+
enterprise:
|
|
30
|
+
project_number: "" # numeric project number, required for backend: enterprise
|
|
31
|
+
location: global # global | us | eu
|
|
32
|
+
service_account_file: "" # path inside the container; empty uses Application Default Credentials
|
|
33
|
+
notebook_limit: 500 # listRecentlyViewed page size, 1..500
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Mise-like declarative config for the openmem meta wizard.
|
|
2
|
+
#
|
|
3
|
+
# mkdir -p ~/.config/personal-memory
|
|
4
|
+
# cp config/openmem.toml.example ~/.config/personal-memory/config.toml
|
|
5
|
+
# $EDITOR ~/.config/personal-memory/config.toml
|
|
6
|
+
# ./setup --yes
|
|
7
|
+
#
|
|
8
|
+
# Precedence (highest wins): CLI flags → environment variables →
|
|
9
|
+
# ~/.config/personal-memory/config.toml → ./personal-memory.toml (stack root) →
|
|
10
|
+
# ~/.config/hindsight/wizard.conf (last configure run).
|
|
11
|
+
#
|
|
12
|
+
# Provider-native settings (mem0 cloud, Hindsight product UI, etc.) stay in those tools;
|
|
13
|
+
# this file only describes how this machine runs the shared stack.
|
|
14
|
+
|
|
15
|
+
[memory]
|
|
16
|
+
provider = "hindsight"
|
|
17
|
+
|
|
18
|
+
[stack]
|
|
19
|
+
project = "openmem"
|
|
20
|
+
api_port = 8888
|
|
21
|
+
control_plane_port = 9999
|
|
22
|
+
|
|
23
|
+
# Default wizard action when ./setup runs non-interactively without --up/--down
|
|
24
|
+
[wizard]
|
|
25
|
+
action = "configure" # configure | up | down
|
|
26
|
+
|
|
27
|
+
# LLM routing for Hindsight (LiteLLM → lemond/Ollama/custom). Not lemond's own config.
|
|
28
|
+
[model]
|
|
29
|
+
backend = "lemond" # lemond | ollama | custom
|
|
30
|
+
retain = "Gemma-4-E2B-it-GGUF"
|
|
31
|
+
reflect = "" # empty = shipped memory-reflect route
|
|
32
|
+
api_base = "" # custom backend only
|
|
33
|
+
|
|
34
|
+
[model.lemond]
|
|
35
|
+
host = "http://127.0.0.1:13305"
|
|
36
|
+
|
|
37
|
+
[model.ollama]
|
|
38
|
+
host = "http://127.0.0.1:11434"
|
|
39
|
+
|
|
40
|
+
# Optional indexer defaults (wizard may still prompt interactively)
|
|
41
|
+
# [[index.roots]]
|
|
42
|
+
# path = "~"
|
|
43
|
+
# depth = 3
|
|
44
|
+
|
|
45
|
+
# Mise-style named tasks (run via ./pm <name>)
|
|
46
|
+
[tasks.configure]
|
|
47
|
+
description = "Secrets, index sources, build images, compose up"
|
|
48
|
+
|
|
49
|
+
[tasks.up]
|
|
50
|
+
description = "Start stack using existing config"
|
|
51
|
+
|
|
52
|
+
[tasks.down]
|
|
53
|
+
description = "docker compose down for this project"
|
|
54
|
+
|
|
55
|
+
[tasks.doctor]
|
|
56
|
+
description = "Validate memory setup on this machine"
|
|
57
|
+
|
|
58
|
+
# Provider-native options live in their own tables, not under [model].
|
|
59
|
+
# mem0 is URL-only: point at a self-hosted REST server (not https://api.mem0.ai).
|
|
60
|
+
# [memory.mem0]
|
|
61
|
+
# api_url = "http://127.0.0.1:18888"
|
|
62
|
+
# env_file = "~/.config/personal-memory/mem0.env"
|
package/docs/OPENMEM.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenMem
|
|
2
|
+
|
|
3
|
+
**OpenMem** is the product name for this repository (formerly *personal-memory*).
|
|
4
|
+
|
|
5
|
+
For the product idea — memory interface for coding agents, providers, `memory_*`, banks, formats — start with **[Concepts](https://bcmyguest.github.io/openmem/docs/concepts/)**.
|
|
6
|
+
|
|
7
|
+
## CLI
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx @bcmyguest/openmem
|
|
11
|
+
openmem setup
|
|
12
|
+
openmem doctor
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Bins: `openmem`, `openmem-setup`, `openmem-mcp`, `openmem-install-mcp`, `openmem-install-coding-agent`, `openmem-switch-provider`, `openmem-notebooklm-mcp`, `openmem-cognee-mcp`.
|
|
16
|
+
|
|
17
|
+
Machine config paths under `~/.config/personal-memory/` and `~/.config/hindsight/` stay as-is for now so existing installs keep working. Installers rewrite leftover `personal-memory` MCP server entries to `openmem`.
|
|
18
|
+
|
|
19
|
+
## Repo
|
|
20
|
+
|
|
21
|
+
- GitHub: [bcmyguest/openmem](https://github.com/bcmyguest/openmem)
|
|
22
|
+
- Docs: [site](https://bcmyguest.github.io/openmem/) · [Concepts](https://bcmyguest.github.io/openmem/docs/concepts/) · [Quickstart](https://bcmyguest.github.io/openmem/docs/getting-started/)
|
|
23
|
+
- npm: `openmem` (package formerly `personal-memory`)
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
openmem’s job is **not** to be the memory — it is to let you run **whichever memory system you choose** on one machine with shared indexing and setup. A **shared indexer** writes into the active **provider**; **coding agents** reach that API through unified `memory_*` MCP, in-repo **session hooks**, and optional native paths (Hindsight plugin, mem0/Cognee MCP). Only one provider is active at a time; `npx @bcmyguest/openmem switch` rewires the stack without pretending to migrate your data. Setup (`npx @bcmyguest/openmem`) is install plumbing only — not part of the runtime data path.
|
|
4
|
+
|
|
5
|
+
## Runtime data flow
|
|
6
|
+
|
|
7
|
+
Two paths share one **active provider API** (Hindsight, mem0, or Cognee — never more than one). Setup (`npx @bcmyguest/openmem`) is not on this diagram; see [How openmem interfaces with providers](#how-openmem-interfaces-with-providers).
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
flowchart TB
|
|
11
|
+
subgraph disk["Sources on disk"]
|
|
12
|
+
GIT[Git repos]
|
|
13
|
+
OBS[Obsidian vaults]
|
|
14
|
+
MD[notes · papers · bookmarks]
|
|
15
|
+
FEED[Feed cache]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
subgraph compose["Docker Compose"]
|
|
19
|
+
IDX[indexer]
|
|
20
|
+
PROV[(Active provider API)]
|
|
21
|
+
IDX -->|retain / update via sink| PROV
|
|
22
|
+
LIT[LiteLLM]
|
|
23
|
+
NLM[NotebookLM sync]
|
|
24
|
+
LIT -.->|Hindsight stack only| PROV
|
|
25
|
+
NLM -.->|opt-in profile| PROV
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
LIT --> LLM[(Local or cloud LLM)]
|
|
29
|
+
|
|
30
|
+
subgraph host["Host — IDE / coding agents"]
|
|
31
|
+
AG[Coding agents]
|
|
32
|
+
UMCP["openmem MCP\n(memory_*)"]
|
|
33
|
+
SHIM["Session hooks\n(all providers)"]
|
|
34
|
+
PLG["Hindsight plugin\n(optional --hindsight-plugin)"]
|
|
35
|
+
PMCP["Provider MCP\nmem0 or Cognee, optional"]
|
|
36
|
+
NLMCP["NotebookLM MCP\noptional, separate server"]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
GIT --> IDX
|
|
40
|
+
OBS --> IDX
|
|
41
|
+
MD --> IDX
|
|
42
|
+
FEED --> IDX
|
|
43
|
+
AG <-->|stdio| UMCP
|
|
44
|
+
AG <-->|hooks| SHIM
|
|
45
|
+
AG <-->|optional| PLG
|
|
46
|
+
SHIM -->|memory_*| UMCP
|
|
47
|
+
AG <-->|stdio| PMCP
|
|
48
|
+
AG <-->|stdio| NLMCP
|
|
49
|
+
UMCP -->|loopback HTTP| PROV
|
|
50
|
+
PLG -->|loopback HTTP| PROV
|
|
51
|
+
PMCP -->|loopback HTTP| PROV
|
|
52
|
+
NLMCP -->|loopback HTTP| PROV
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Path | What moves |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| **Indexing** | Git, Obsidian, markdown trees, feed cache → indexer → provider HTTP sink (`MEMORY_SINK` from manifest) |
|
|
58
|
+
| **Agents** | Cursor/Claude/Codex → session hooks and/or MCP → same provider API |
|
|
59
|
+
| **Unified MCP** | `install-mcp` registers `openmem` on the host; tools delegate to the active provider |
|
|
60
|
+
| **LiteLLM** | Optional sidecar on Hindsight stacks; also used for **cross-provider reflect synthesis** when `PM_LLM_URL` / stack LiteLLM is reachable (`memory_reflect` on mem0/Cognee) |
|
|
61
|
+
| **NotebookLM sync** | **Opt-in, any active provider.** Background sync writes into `notebooklm::*` via the same indexer sinks (Hindsight / mem0 / Cognee); not the same as the NotebookLM MCP |
|
|
62
|
+
| **Provider MCP** | Native mem0 or Cognee tool names (`install-mcp --provider-only`); same API as unified MCP, different stdio server |
|
|
63
|
+
| **NotebookLM MCP** | Read-only list/search over synced notebooks; separate entry in `mcp.json`, not a memory provider |
|
|
64
|
+
|
|
65
|
+
Only **one provider** is active at a time (`MEMORY_PROVIDER`). The indexer uses that provider’s HTTP sink (`MEMORY_SINK` / manifest).
|
|
66
|
+
|
|
67
|
+
## How openmem interfaces with providers
|
|
68
|
+
|
|
69
|
+
Product framing: [Concepts](concepts.md).
|
|
70
|
+
|
|
71
|
+
openmem is a **meta layer**: it does not replace provider APIs. It wires the same plumbing (indexer, compose, wizard, MCP) to **different backends** through manifests and thin adapters.
|
|
72
|
+
|
|
73
|
+
```mermaid
|
|
74
|
+
flowchart TB
|
|
75
|
+
MAN["providers/*/manifest.json"]
|
|
76
|
+
HOOK["providers/*/wizard.mjs"]
|
|
77
|
+
|
|
78
|
+
subgraph cli["openmem CLI"]
|
|
79
|
+
W[setup / switch / doctor]
|
|
80
|
+
IM[install-mcp]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
subgraph compose["Compose runtime"]
|
|
84
|
+
IDX[indexer container]
|
|
85
|
+
API[(Active provider HTTP API)]
|
|
86
|
+
IDX -->|sink driver| API
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
subgraph host["Host runtime"]
|
|
90
|
+
MCPJ["~/.cursor/mcp.json"]
|
|
91
|
+
UMCP[openmem-mcp\nmemory-facade]
|
|
92
|
+
AG[Agents]
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
MAN --> W
|
|
96
|
+
MAN --> IDX
|
|
97
|
+
HOOK --> W
|
|
98
|
+
W -->|env · compose up| compose
|
|
99
|
+
IM -->|merge server entry| MCPJ
|
|
100
|
+
MCPJ --> UMCP
|
|
101
|
+
AG <-->|stdio| UMCP
|
|
102
|
+
UMCP -->|fetch active provider| API
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Integration layers
|
|
106
|
+
|
|
107
|
+
| Layer | What it is | Repo location |
|
|
108
|
+
| --- | --- | --- |
|
|
109
|
+
| **Manifest** | Status, compose services, ports, indexer sink id, smoke HTTP templates | `providers/<id>/manifest.json` |
|
|
110
|
+
| **Wizard hooks** | Provider-specific env, keys, smoke, coding-agent notes | `providers/<id>/wizard.mjs` |
|
|
111
|
+
| **Indexer sink** | Poll/vault → retain/update/delete on the provider API | `indexer/` (driver id in manifest, e.g. `hindsight-rest-v1`, `mem0-rest`) |
|
|
112
|
+
| **Unified MCP** | Stable `memory_*` tools → provider HTTP | `cli/mcp/memory-facade.mjs`, `cli/openmem-mcp.mjs` |
|
|
113
|
+
| **Native agent paths** | Session hooks + optional plugin/MCP | `cli/coding-agent/hook-runner.mjs`; optional Hindsight plugin; `cli/mem0-mcp.mjs`, `cli/cognee-mcp.mjs`, NotebookLM |
|
|
114
|
+
|
|
115
|
+
Adding a provider means a new manifest + hooks + sink driver; agents can keep using **`memory_*`** once the facade implements that backend.
|
|
116
|
+
|
|
117
|
+
### Runtime wiring (env and config)
|
|
118
|
+
|
|
119
|
+
| Input | Resolves |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| `MEMORY_PROVIDER` | Active backend (`wizard.conf`, optional `config.toml`) |
|
|
122
|
+
| Stack `.env` | API URLs, ports, `MEMORY_SINK`, indexer → provider URL |
|
|
123
|
+
| Provider secret files | e.g. `~/.config/personal-memory/mem0.env` (never committed; not written to `mcp.json`) |
|
|
124
|
+
| `~/.config/hindsight/index.yml` | What the indexer watches |
|
|
125
|
+
|
|
126
|
+
`npx @bcmyguest/openmem switch <id>` updates provider selection and restarts compose; it does **not** migrate memories ([export/import](memory-portability.md) is for that).
|
|
127
|
+
|
|
128
|
+
### Example: unified MCP on mem0
|
|
129
|
+
|
|
130
|
+
1. `npx @bcmyguest/openmem switch mem0 --yes` — compose and env point the indexer and unified MCP at `MEM0_API_URL`.
|
|
131
|
+
2. `npx @bcmyguest/openmem install-mcp --yes` — merges the `openmem` server into `~/.cursor/mcp.json` (NotebookLM MCP only if you enabled sync or pass `--notebooklm`).
|
|
132
|
+
3. The agent calls `memory_add` with `{ content: "…", bank: "my-project" }`. The facade sends `POST /memories` with `user_id=my-project` and `infer: false`.
|
|
133
|
+
|
|
134
|
+
`install-mcp --provider-only` is a **different** stdio server: same mem0 API, but upstream mem0 tool names from `@yeyuan98/mem0-mcp`. NotebookLM MCP is **different again** — search over notebooks synced into Hindsight, not a substitute for mem0/Cognee/Hindsight memory.
|
|
135
|
+
|
|
136
|
+
### Unified MCP → provider HTTP
|
|
137
|
+
|
|
138
|
+
The `openmem` MCP server delegates each tool to the **active** provider:
|
|
139
|
+
|
|
140
|
+
| Unified tool | Hindsight (`HINDSIGHT_URL`) | mem0 (`MEM0_API_URL` + key file) | Cognee (`COGNEE_API_URL`) |
|
|
141
|
+
| --- | --- | --- | --- |
|
|
142
|
+
| `memory_add` | `POST /v1/default/banks/{bank}/memories` | `POST /memories` (`infer: false`, `user_id` from `bank` arg) | `POST /api/v1/add` |
|
|
143
|
+
| `memory_search` / `memory_recall` | `POST /v1/default/banks/{bank}/memories/recall` | `POST /search` with `filters.user_id` | `POST /api/v1/search` |
|
|
144
|
+
| `memory_reflect` | Same recall path | Search + optional LiteLLM synthesis | Search + optional LiteLLM synthesis |
|
|
145
|
+
| `memory_consolidate` | LiteLLM / Hindsight consolidate routes | Skipped (no equivalent) | `POST /api/v1/cognify` |
|
|
146
|
+
| `memory_forget` | `DELETE /v1/default/banks/{bank}` (bank scope) | `DELETE /memories/{id}` | Not exposed yet |
|
|
147
|
+
| `memory_provider_status` | Returns provider id + loopback URL | Same | Same |
|
|
148
|
+
| `memory_export` / `memory_import` | PMM envelope; mem0 list/add — see [Portable memory (PMM)](memory-portability.md) | | |
|
|
149
|
+
|
|
150
|
+
Default scope key for MCP-created rows: bank / `user_id` **`openmem-mcp`** unless the tool passes `bank`.
|
|
151
|
+
|
|
152
|
+
### Native agent paths (optional, alongside unified MCP)
|
|
153
|
+
|
|
154
|
+
| Provider | Session / tools | Install |
|
|
155
|
+
| --- | --- | --- |
|
|
156
|
+
| **All providers** | In-repo session hooks → unified `memory_*` | `install-coding-agent --yes` |
|
|
157
|
+
| **Hindsight (optional)** | `@vectorize-io/hindsight-coding-agents` plugin | `install-coding-agent --hindsight-plugin` |
|
|
158
|
+
| **mem0** | `@yeyuan98/mem0-mcp` tools | `install-mcp --provider-only` |
|
|
159
|
+
| **Cognee** | `cognee_health`, `cognee_search` | `install-mcp --provider-only` |
|
|
160
|
+
| **NotebookLM** | `notebooklm_list_banks`, `notebooklm_search` | `install-mcp` when sync enabled or `--notebooklm` |
|
|
161
|
+
|
|
162
|
+
`install-mcp` merges the **unified** `openmem` server by default (`--no-unified-mcp` to skip).
|
|
163
|
+
|
|
164
|
+
## How file changes become memory
|
|
165
|
+
|
|
166
|
+
The indexer does not watch your editor — it watches **configured sources** on disk (poll, inotify, or periodic re-list).
|
|
167
|
+
|
|
168
|
+
| Source | Detection | What gets sent to the provider |
|
|
169
|
+
| --- | --- | --- |
|
|
170
|
+
| Git repo | Poll every `poll_seconds` (default 60): `HEAD` + tracked-file status | Tree-sitter outlines + text for changed files → **retain** on the active sink |
|
|
171
|
+
| Obsidian vault | inotify; re-index after `vault_quiet_seconds` (default 30) without edits | Vault documents → provider-specific banks |
|
|
172
|
+
| Notes / papers / bookmarks | `notes.paths`, `papers.paths`, `bookmarks.paths`; inotify on `.md` (bookmarks also `.html`, `.txt`) | Markdown (and bookmark exports) → `notes::`, `papers::`, `bookmarks::` banks |
|
|
173
|
+
| Feed cache | `feeds.out_dir` after `npx @bcmyguest/openmem feed-sync` (RSS / OpenAlex) | Generated markdown → `feed::` banks |
|
|
174
|
+
| New sources under scan roots | Re-list every `relist_seconds` (default 600) | Picked up without restarting the stack |
|
|
175
|
+
|
|
176
|
+
Configuration: `~/.config/hindsight/index.yml` (wizard writes this on first setup). Full source list and examples: [index-sources.md](index-sources.md) · [sources-feeds.md](sources-feeds.md) · [sources-zotero.md](sources-zotero.md) · [sources-readwise.md](sources-readwise.md). Filters such as `optInPaths` in `~/.hindsight/coding-agent.json` can limit which discovered sources are indexed.
|
|
177
|
+
|
|
178
|
+
Bank prefixes include `coding-agent::`, `obsidian::`, `notes::`, `papers::`, `bookmarks::`, `feed::`, and optional `notebooklm::*`. mem0 uses `user_id` / `agent_id` / `run_id`; Cognee uses **datasets** mapped from indexer banks.
|
|
179
|
+
|
|
180
|
+
## Industry context
|
|
181
|
+
|
|
182
|
+
There is **no** cross-vendor standard for agent memory APIs. MCP standardizes tool transport, not memory semantics — each product exposes different tool names and shapes. openmem’s answer is a **stable facade** on your chosen backend so agents keep the same verbs when you switch providers.
|
|
183
|
+
|
|
184
|
+
## Unified openmem MCP (beta)
|
|
185
|
+
|
|
186
|
+
`cli/openmem-mcp.mjs` registers as the `openmem` server in `~/.cursor/mcp.json` when you run `install-mcp` (unless `--no-unified-mcp`). It delegates to the active provider:
|
|
187
|
+
|
|
188
|
+
| Tool | Purpose |
|
|
189
|
+
| --- | --- |
|
|
190
|
+
| `memory_add` | Store text (Hindsight bank, mem0 user scope, Cognee dataset add) |
|
|
191
|
+
| `memory_search` / `memory_recall` | Query memories on the active backend |
|
|
192
|
+
| `memory_reflect` | Session-style context (recall or search + optional LiteLLM) |
|
|
193
|
+
| `memory_consolidate` | Cognee cognify; Hindsight notes; mem0 skip |
|
|
194
|
+
| `memory_forget` | Delete by id (mem0) or drop a Hindsight bank |
|
|
195
|
+
| `memory_provider_status` | Active provider and loopback URL (no secrets) |
|
|
196
|
+
| `memory_export` / `memory_import` | PMM portable format — [Portable memory (PMM)](memory-portability.md) |
|
|
197
|
+
|
|
198
|
+
**Session hooks** (all providers) call the unified MCP via `cli/coding-agent/hook-runner.mjs`. Optional [`@vectorize-io/hindsight-coding-agents`](https://www.npmjs.com/package/@vectorize-io/hindsight-coding-agents) with `--hindsight-plugin` adds a second hook set on Hindsight stacks.
|
|
199
|
+
|
|
200
|
+
### Other MCP integrations
|
|
201
|
+
|
|
202
|
+
| Integration | Tools / path | Role |
|
|
203
|
+
| --- | --- | --- |
|
|
204
|
+
| Session hooks | SessionStart / prompt / Stop → `memory_*` | Default in-IDE session memory (all providers) |
|
|
205
|
+
| Hindsight plugin (optional) | Upstream retain / recall / reflect | `--hindsight-plugin` only |
|
|
206
|
+
| `notebooklm` (`install-mcp`) | `notebooklm_list_banks`, `notebooklm_search` | Opt-in synced notebooks |
|
|
207
|
+
| `mem0` (`--provider-only`) | mem0 REST tools via `@yeyuan98/mem0-mcp` | Native mem0 tool names |
|
|
208
|
+
| `cognee` (`--provider-only`) | `cognee_health`, `cognee_search` | Native Cognee read-only MCP |
|
|
209
|
+
|
|
210
|
+
## Related
|
|
211
|
+
|
|
212
|
+
- [Portable memory (PMM)](memory-portability.md) — export/import
|
|
213
|
+
- [MCP setup](mcp-setup.md) — unified and provider-native MCP
|
|
214
|
+
- [Provider status](provider-status.md) — manifest status and ports
|
|
215
|
+
- [mem0 operator guide](mem0.md) — URL-only mem0 setup
|
|
216
|
+
- [Cognee operator guide](cognee.md) — loopback container + LLM env
|
|
217
|
+
- [Configuration file](openmem-config.md) — `config.toml` for provider and stack defaults
|
|
218
|
+
|
|
219
|
+
Contributor-only guides (wizard phases, hooks, manual compose, [indexer sinks](indexer-sinks.md), [pluggable providers](memory-providers.md)) live under `docs/` in git and are not all published on the site. Day-to-day MCP install is on [MCP setup](mcp-setup.md).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Docs assets
|
|
2
|
+
|
|
3
|
+
Regenerate the setup demo GIF after wizard output changes:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
uv run --with pillow python scripts/render-setup-gif.py
|
|
7
|
+
cp docs/assets/setup-demo.gif site/public/setup-demo.gif
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
The capture uses stubbed `docker`/`curl` and `npx @bcmyguest/openmem setup --dry-run` (via `wizard/bin/setup.mjs`).
|
|
Binary file
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Coding-agent session hooks (parity)
|
|
2
|
+
|
|
3
|
+
Hindsight ships session retain/recall/reflect through
|
|
4
|
+
[`@vectorize-io/hindsight-coding-agents`](https://www.npmjs.com/package/@vectorize-io/hindsight-coding-agents).
|
|
5
|
+
openmem routes session work through the **unified MCP** (`memory_*`) for all three backends.
|
|
6
|
+
|
|
7
|
+
## Capability matrix
|
|
8
|
+
|
|
9
|
+
| Capability | Hindsight (default shim) | mem0 (session shim) | Cognee (session shim) |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| retain | yes for supported agent transcripts | yes for supported agent transcripts (`memory_add`) | yes for supported agent transcripts |
|
|
12
|
+
| recall / search | yes | yes (prompt hook → `memory_recall`) | yes |
|
|
13
|
+
| reflect | yes (`memory_reflect` → Hindsight reflect) | search + optional LiteLLM synthesis | search + optional LiteLLM synthesis; raw hits if unavailable |
|
|
14
|
+
| consolidate | yes (Hindsight/LiteLLM routes) | no | yes (`memory_consolidate` → cognify) |
|
|
15
|
+
| bank / scope | Hindsight banks | mem0 `user_id` | Cognee dataset |
|
|
16
|
+
|
|
17
|
+
Flags live in `cli/coding-agent/capabilities.mjs`; `doctor wiring` and
|
|
18
|
+
`install-coding-agent` read the same table. `npx @bcmyguest/openmem wiring` prints
|
|
19
|
+
which session features work for the active provider.
|
|
20
|
+
|
|
21
|
+
## Install per agent
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npx @bcmyguest/openmem install-coding-agent --yes
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- **All providers:** unified MCP and [shared skill](../skills/openmem/SKILL.md), plus session hooks (`cli/coding-agent/hook-runner.mjs`) for Claude Code, Codex, Cursor Agent, and a JavaScript OpenCode plugin (`cli/coding-agent/opencode-plugin.mjs`).
|
|
28
|
+
- **Optional:** `--hindsight-plugin` with `MEMORY_PROVIDER=hindsight` also runs `@vectorize-io/hindsight-coding-agents install` (legacy/alternate hook set).
|
|
29
|
+
|
|
30
|
+
See [MCP setup](mcp-setup.md) and [coding agents](coding-agents.md).
|
|
31
|
+
|
|
32
|
+
Claude Code Stop retention parses ordinary message and tool-use rows. Codex Stop retention is best effort because Codex does not guarantee a stable transcript format. Cursor Stop retention has a bounded adapter for the observed local agent-transcripts JSONL shape (top-level user/assistant role and `message.content` parts). Live Cursor Hook `transcript_path` linkage to that format remains unverified; unknown row shapes are skipped. Cursor recall and explicit `memory_add` remain available. OpenCode retention uses its plugin's session messages API.
|
|
33
|
+
|
|
34
|
+
Hindsight Stop hooks submit retains with `async: true` so model extraction runs after the hook returns. A successful queue response advances the transcript cursor; later extraction failures must be checked through Hindsight operations. MCP `memory_add` defaults to async; pass `async: false` to wait for extraction.
|
|
35
|
+
SessionStart hooks use recall instead of reflect. Hindsight startup recall requests `budget: low` and `max_tokens: 1200`; all hook recall output is limited to eight hits and 8000 characters. Explicit `memory_reflect` remains available through the MCP.
|
|
36
|
+
|
|
37
|
+
## Session scopes
|
|
38
|
+
|
|
39
|
+
Indexer banks map to provider scopes (`coding-agent::repo`, `obsidian::vault`, mem0 `user_id`, Cognee dataset names). Default MCP scope key: `openmem-mcp`. See [coding-agent-scopes.md](coding-agent-scopes.md).
|
|
40
|
+
|
|
41
|
+
Hook access is configured in `~/.config/personal-memory/coding-agent.json`. With no file,
|
|
42
|
+
hooks are enabled for all workspaces and use the bank derived from the workspace name. A
|
|
43
|
+
malformed or unreadable config denies hook access, as does an event with no workspace path.
|
|
44
|
+
Set `disabled: true` to turn hooks off, or set `optInOnly: true` and list allowed absolute
|
|
45
|
+
workspace prefixes in `optInPaths`. Project banks resolve in this order: longest matching
|
|
46
|
+
prefix in active `index.yml` `banks`, longest matching prefix in this openmem
|
|
47
|
+
config, then the legacy Hindsight `~/.hindsight/coding-agent.json` mapping. Without
|
|
48
|
+
a match, the literal repository directory name is used in `coding-agent::<name>` (case
|
|
49
|
+
preserved). Nested workspace paths resolve to their Git repository root, and linked
|
|
50
|
+
worktrees share the common repository identity. The openmem config owns current
|
|
51
|
+
access and mapping policy; the legacy mapping remains supported for compatibility.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Session scopes (banks, user_id, datasets)
|
|
2
|
+
|
|
3
|
+
One **scope key** is reused across indexer, unified MCP, and (where supported) the coding-agent path.
|
|
4
|
+
|
|
5
|
+
| Provider | Indexer bank example | MCP `bank` argument | Notes |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| Hindsight | `coding-agent::my-repo` | same bank string | Personal-memory hooks and MCP use Hindsight banks |
|
|
8
|
+
| mem0 | same bank string | maps to `user_id` | `memory_add` sets `user_id=bank` |
|
|
9
|
+
| Cognee | same bank string | maps to dataset name | See `cognee-dataset-name` in export code |
|
|
10
|
+
|
|
11
|
+
Default when tools omit `bank`: **`openmem-mcp`**.
|
|
12
|
+
|
|
13
|
+
Configure what gets indexed in `~/.config/hindsight/index.yml`. Optional filters in
|
|
14
|
+
`~/.hindsight/coding-agent.json` (`optInPaths`) limit which discovered sources are indexed.
|
|
15
|
+
Project bank routing is shared by the indexer and session integrations: the longest
|
|
16
|
+
matching `banks` prefix in the active index config wins, followed by
|
|
17
|
+
`~/.config/personal-memory/coding-agent.json` `mapPathToBank`, then the legacy
|
|
18
|
+
`~/.hindsight/coding-agent.json` mapping. The fallback uses the literal repository
|
|
19
|
+
directory name, preserving case; nested paths resolve to the repository root, and linked
|
|
20
|
+
worktrees use their common repository identity.
|
|
21
|
+
|
|
22
|
+
Future: `[session]` section in `~/.config/personal-memory/config.toml` may pin a default scope per repo; not required today.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Coding agents and MCP
|
|
2
|
+
|
|
3
|
+
One entry point for session wiring on **every** provider (unified MCP + in-repo session hooks):
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npx @bcmyguest/openmem install-coding-agent --yes
|
|
7
|
+
# optional: --hindsight-plugin (also run @vectorize-io/hindsight-coding-agents on Hindsight stacks)
|
|
8
|
+
# same flags: --dry-run, --agents claude-code,codex,opencode,cursor-cli,hermes,gemini-cli,amp,cline
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This stages a persistent runtime under `~/.local/share/personal-memory/agent-runtime`, registers the unified MCP globally in Claude Code, Codex, Cursor Agent, and OpenCode, and installs their session hooks. It also copies the [openmem skill](../skills/openmem/SKILL.md) into each agent's global skill directory. The runtime path stays valid after an `npx` cache cleanup. Re-run the command after upgrading this package to refresh the runtime and skill. See [hook parity](coding-agent-hooks.md).
|
|
12
|
+
|
|
13
|
+
For Codex, installation enables `features.hooks` when unset and preserves an explicit `false`. For OpenCode, the plugin and MCP entry go into the existing `opencode.jsonc` or `opencode.json`; unrelated settings and JSONC comments outside the updated fields are retained.
|
|
14
|
+
|
|
15
|
+
Codex requires review of new or changed non-managed hooks in `/hooks` before they run. [Codex hook documentation](https://developers.openai.com/codex/hooks) describes this trust step.
|
|
16
|
+
|
|
17
|
+
The command keeps existing agent settings and other MCP servers. It does not remove the optional Hindsight plugin; after checking the new MCP and hooks, remove the old plugin through its own uninstaller if you no longer want both integrations running.
|
|
18
|
+
|
|
19
|
+
The wizard coding-agent step follows the same idea for Hindsight-first flows.
|
|
20
|
+
|
|
21
|
+
Use a **real** `~/.hindsight/coding-agent.json` on disk (seed from `config/coding-agent.json`). Do not symlink into the repo — machine fields such as `optInPaths` and `notebooklmAccess` must not live in the checkout. The indexer reads this file through the `$HOME` mount. If it is missing, the indexer logs a warning and still indexes everything under `$HOME`.
|
|
22
|
+
|
|
23
|
+
### Memory MCP servers (`~/.cursor/mcp.json`)
|
|
24
|
+
|
|
25
|
+
To register **only** Cursor's memory-related MCP entries (NotebookLM, mem0, Cognee, and unified `openmem`) without re-running full setup:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npx @bcmyguest/openmem install-mcp --yes
|
|
29
|
+
# checkout: npx . install-mcp --yes
|
|
30
|
+
|
|
31
|
+
# mem0 self-hosted REST → @yeyuan98/mem0-mcp via cli/mem0-mcp.mjs
|
|
32
|
+
MEMORY_PROVIDER=mem0 npx @bcmyguest/openmem install-mcp --yes --provider-only
|
|
33
|
+
|
|
34
|
+
# Cognee read-only health/search → cli/cognee-mcp.mjs
|
|
35
|
+
MEMORY_PROVIDER=cognee npx @bcmyguest/openmem install-mcp --yes --provider-only
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Provider comes from `MEMORY_PROVIDER`, else `~/.config/hindsight/wizard.conf`, else `hindsight`. NotebookLM MCP is installed when `~/.config/hindsight/notebooklm.yml` has `enabled: true`, or with `--notebooklm`. Flags: `--dry-run`, `--notebooklm-only`, `--provider-only`. Existing `hindsight` / `codegraph` / `notebooklm` / sibling provider entries are merged, not clobbered. For mem0, `mcp.json` gets `MEM0_API_URL` / `MEM0_BASE_URL` and the path to `mem0.env` — never the API key ([mem0 operator guide](https://github.com/bcmyguest/openmem/blob/main/providers/mem0/OPERATOR.md)). For Cognee, `mcp.json` gets `COGNEE_API_URL` only — never `COGNEE_API_KEY` ([Cognee operator guide](https://github.com/bcmyguest/openmem/blob/main/providers/cognee/OPERATOR.md); tools `cognee_health` / `cognee_search`). Manual JSON edits remain a fallback.
|
|
39
|
+
|
|
40
|
+
Restart the Cursor Agent (or other coding agent) after install so it loads the new wiring. With `optInOnly: true`, only paths listed in `optInPaths` get memory — `/tmp` workspaces and other unlisted directories stay opted out.
|
|
41
|
+
|
|
42
|
+
### Switch memory provider
|
|
43
|
+
|
|
44
|
+
To change `MEMORY_PROVIDER` (updates `~/.config/hindsight/wizard.conf`, optionally restarts the stack and refreshes provider MCP) without a full interactive setup:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npx @bcmyguest/openmem switch mem0 --yes
|
|
48
|
+
# checkout: npx . switch cognee --yes
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Flags: `--dry-run`, `--no-stack` (skip compose down/up), `--no-mcp` (skip `install-mcp --provider-only`). Switching does **not** migrate memories between backends. After a switch: restart Cursor Agent, then `npx @bcmyguest/openmem doctor`.
|