supermem 0.3.0__tar.gz
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.
- supermem-0.3.0/.dockerignore +36 -0
- supermem-0.3.0/.env.example +164 -0
- supermem-0.3.0/.github/ISSUE_TEMPLATE/bug_report.md +57 -0
- supermem-0.3.0/.github/ISSUE_TEMPLATE/feature_request.md +30 -0
- supermem-0.3.0/.github/PULL_REQUEST_TEMPLATE.md +41 -0
- supermem-0.3.0/.github/workflows/ci.yml +121 -0
- supermem-0.3.0/.gitignore +48 -0
- supermem-0.3.0/CHANGELOG.md +35 -0
- supermem-0.3.0/CLAUDE.md +169 -0
- supermem-0.3.0/CONTRIBUTING.md +223 -0
- supermem-0.3.0/Dockerfile +50 -0
- supermem-0.3.0/LICENSE +202 -0
- supermem-0.3.0/Makefile +244 -0
- supermem-0.3.0/PKG-INFO +276 -0
- supermem-0.3.0/README.md +217 -0
- supermem-0.3.0/WARP.md +279 -0
- supermem-0.3.0/agent/__init__.py +15 -0
- supermem-0.3.0/agent/agent.py +203 -0
- supermem-0.3.0/agent/engine.py +332 -0
- supermem-0.3.0/agent/model.py +101 -0
- supermem-0.3.0/agent/pyproject.toml +34 -0
- supermem-0.3.0/agent/schemas.py +154 -0
- supermem-0.3.0/agent/settings.py +32 -0
- supermem-0.3.0/agent/system_prompt.txt +305 -0
- supermem-0.3.0/agent/tools.py +384 -0
- supermem-0.3.0/agent/utils.py +229 -0
- supermem-0.3.0/chat_cli.py +253 -0
- supermem-0.3.0/docker-compose.yml +43 -0
- supermem-0.3.0/docs/audit-2026-06-10.md +131 -0
- supermem-0.3.0/examples/mem_agent_cli.py +783 -0
- supermem-0.3.0/mcp_server/__init__.py +0 -0
- supermem-0.3.0/mcp_server/http_server.py +172 -0
- supermem-0.3.0/mcp_server/mcp_http_server.py +313 -0
- supermem-0.3.0/mcp_server/mcp_sse_server.py +330 -0
- supermem-0.3.0/mcp_server/pyproject.toml +31 -0
- supermem-0.3.0/mcp_server/scripts/filters.py +54 -0
- supermem-0.3.0/mcp_server/scripts/install_lms.sh +8 -0
- supermem-0.3.0/mcp_server/scripts/memory_setup.py +131 -0
- supermem-0.3.0/mcp_server/scripts/memory_setup_cli.py +116 -0
- supermem-0.3.0/mcp_server/scripts/setup_scripts_and_json.py +99 -0
- supermem-0.3.0/mcp_server/server.py +484 -0
- supermem-0.3.0/mcp_server/settings.py +8 -0
- supermem-0.3.0/memories/client_success/entities/account_playbook.md +40 -0
- supermem-0.3.0/memories/client_success/entities/client_health_check.md +23 -0
- supermem-0.3.0/memories/client_success/entities/client_northwind.md +18 -0
- supermem-0.3.0/memories/client_success/entities/client_orbitbank.md +19 -0
- supermem-0.3.0/memories/client_success/entities/client_photonics.md +18 -0
- supermem-0.3.0/memories/client_success/entities/escalation_matrix.md +29 -0
- supermem-0.3.0/memories/client_success/entities/onboarding_process.md +27 -0
- supermem-0.3.0/memories/client_success/entities/renewal_plan_orbitbank.md +46 -0
- supermem-0.3.0/memories/client_success/entities/renewal_strategy.md +23 -0
- supermem-0.3.0/memories/client_success/entities/team_lead.md +18 -0
- supermem-0.3.0/memories/client_success/meta.json +4 -0
- supermem-0.3.0/memories/client_success/user.md +37 -0
- supermem-0.3.0/memories/healthcare/entities/clinic/care_team.md +9 -0
- supermem-0.3.0/memories/healthcare/entities/clinic/redaction_protocol.md +7 -0
- supermem-0.3.0/memories/healthcare/entities/malik_abiola.md +14 -0
- supermem-0.3.0/memories/healthcare/entities/patients/james_rivera/behavior_insights.md +22 -0
- supermem-0.3.0/memories/healthcare/entities/patients/james_rivera/care_plan.md +11 -0
- supermem-0.3.0/memories/healthcare/entities/patients/james_rivera/clinical/2024-05-31_clinical_note.md +15 -0
- supermem-0.3.0/memories/healthcare/entities/patients/james_rivera/clinical/2024-06-28_clinical_note.md +21 -0
- supermem-0.3.0/memories/healthcare/entities/patients/james_rivera/labs_and_vitals.md +14 -0
- supermem-0.3.0/memories/healthcare/entities/patients/james_rivera/wearable_snapshot_2024-07-09.md +12 -0
- supermem-0.3.0/memories/healthcare/entities/patients/james_rivera.md +31 -0
- supermem-0.3.0/memories/healthcare/entities/patients/linda_chan/behavior_insights.md +22 -0
- supermem-0.3.0/memories/healthcare/entities/patients/linda_chan/care_plan.md +11 -0
- supermem-0.3.0/memories/healthcare/entities/patients/linda_chan/clinical/2024-05-13_clinical_note.md +15 -0
- supermem-0.3.0/memories/healthcare/entities/patients/linda_chan/clinical/2024-06-24_clinical_note.md +22 -0
- supermem-0.3.0/memories/healthcare/entities/patients/linda_chan/labs_and_vitals.md +15 -0
- supermem-0.3.0/memories/healthcare/entities/patients/linda_chan/wearable_snapshot_2024-07-05.md +10 -0
- supermem-0.3.0/memories/healthcare/entities/patients/linda_chan.md +32 -0
- supermem-0.3.0/memories/healthcare/entities/patients/malik_abiola/behavior_insights.md +18 -0
- supermem-0.3.0/memories/healthcare/entities/patients/malik_abiola/care_plan.md +11 -0
- supermem-0.3.0/memories/healthcare/entities/patients/malik_abiola/clinical/2024-04-19_clinical_note.md +16 -0
- supermem-0.3.0/memories/healthcare/entities/patients/malik_abiola/clinical/2024-05-17_clinical_note.md +35 -0
- supermem-0.3.0/memories/healthcare/entities/patients/malik_abiola/labs_and_vitals.md +14 -0
- supermem-0.3.0/memories/healthcare/entities/patients/malik_abiola/wearable_snapshot_2024-06-10.md +10 -0
- supermem-0.3.0/memories/healthcare/entities/patients/malik_abiola.md +29 -0
- supermem-0.3.0/memories/healthcare/entities/patients/sanjay_patel/behavior_insights.md +22 -0
- supermem-0.3.0/memories/healthcare/entities/patients/sanjay_patel/care_plan.md +14 -0
- supermem-0.3.0/memories/healthcare/entities/patients/sanjay_patel/clinical/2024-05-02_clinical_note.md +25 -0
- supermem-0.3.0/memories/healthcare/entities/patients/sanjay_patel/clinical/2024-05-23_clinical_note.md +23 -0
- supermem-0.3.0/memories/healthcare/entities/patients/sanjay_patel/labs_and_vitals.md +16 -0
- supermem-0.3.0/memories/healthcare/entities/patients/sanjay_patel/wearable_snapshot_2024-06-14.md +10 -0
- supermem-0.3.0/memories/healthcare/entities/patients/sanjay_patel.md +29 -0
- supermem-0.3.0/memories/healthcare/entities/patients/victor_nguyen/behavior_insights.md +18 -0
- supermem-0.3.0/memories/healthcare/entities/patients/victor_nguyen/care_plan.md +14 -0
- supermem-0.3.0/memories/healthcare/entities/patients/victor_nguyen/clinical/2024-05-08_clinical_note.md +15 -0
- supermem-0.3.0/memories/healthcare/entities/patients/victor_nguyen/clinical/2024-05-29_clinical_note.md +18 -0
- supermem-0.3.0/memories/healthcare/entities/patients/victor_nguyen/labs_and_vitals.md +15 -0
- supermem-0.3.0/memories/healthcare/entities/patients/victor_nguyen/wearable_snapshot_2024-07-03.md +12 -0
- supermem-0.3.0/memories/healthcare/entities/patients/victor_nguyen.md +30 -0
- supermem-0.3.0/memories/healthcare/entities/sanjay_patel.md +9 -0
- supermem-0.3.0/memories/healthcare/manifest.json +15 -0
- supermem-0.3.0/memories/healthcare/meta.json +4 -0
- supermem-0.3.0/memories/healthcare/user.md +19 -0
- supermem-0.3.0/memory_connectors/__init__.py +18 -0
- supermem-0.3.0/memory_connectors/base.py +105 -0
- supermem-0.3.0/memory_connectors/chatgpt_history/__init__.py +21 -0
- supermem-0.3.0/memory_connectors/chatgpt_history/connector.py +431 -0
- supermem-0.3.0/memory_connectors/chatgpt_history/converter.py +371 -0
- supermem-0.3.0/memory_connectors/chatgpt_history/embedding_connector.py +786 -0
- supermem-0.3.0/memory_connectors/chatgpt_history/parser.py +300 -0
- supermem-0.3.0/memory_connectors/chatgpt_history/types.py +81 -0
- supermem-0.3.0/memory_connectors/github_live/__init__.py +3 -0
- supermem-0.3.0/memory_connectors/github_live/connector.py +1093 -0
- supermem-0.3.0/memory_connectors/google_docs_live/__init__.py +3 -0
- supermem-0.3.0/memory_connectors/google_docs_live/connector.py +594 -0
- supermem-0.3.0/memory_connectors/memory_connect.py +657 -0
- supermem-0.3.0/memory_connectors/memory_wizard.py +593 -0
- supermem-0.3.0/memory_connectors/notion/__init__.py +5 -0
- supermem-0.3.0/memory_connectors/notion/connector.py +415 -0
- supermem-0.3.0/memory_connectors/notion/parser.py +321 -0
- supermem-0.3.0/memory_connectors/notion/types.py +132 -0
- supermem-0.3.0/memory_connectors/nuclino/__init__.py +5 -0
- supermem-0.3.0/memory_connectors/nuclino/connector.py +446 -0
- supermem-0.3.0/memory_connectors/nuclino/parser.py +456 -0
- supermem-0.3.0/memory_connectors/nuclino/types.py +106 -0
- supermem-0.3.0/pyproject.toml +97 -0
- supermem-0.3.0/supermem/__init__.py +3 -0
- supermem-0.3.0/supermem/__main__.py +232 -0
- supermem-0.3.0/supermem/capture/__init__.py +8 -0
- supermem-0.3.0/supermem/capture/compressor.py +99 -0
- supermem-0.3.0/supermem/capture/observation.py +72 -0
- supermem-0.3.0/supermem/capture/session.py +69 -0
- supermem-0.3.0/supermem/capture/timeline.py +37 -0
- supermem-0.3.0/supermem/config.py +109 -0
- supermem-0.3.0/supermem/core/__init__.py +14 -0
- supermem-0.3.0/supermem/core/connector.py +50 -0
- supermem-0.3.0/supermem/core/model_client.py +53 -0
- supermem-0.3.0/supermem/core/retriever.py +58 -0
- supermem-0.3.0/supermem/core/storage.py +34 -0
- supermem-0.3.0/supermem/errors.py +103 -0
- supermem-0.3.0/supermem/hooks/__init__.py +1 -0
- supermem-0.3.0/supermem/hooks/inject.py +121 -0
- supermem-0.3.0/supermem/hooks/learn.py +95 -0
- supermem-0.3.0/supermem/indexer/__init__.py +5 -0
- supermem-0.3.0/supermem/indexer/vault.py +197 -0
- supermem-0.3.0/supermem/logging.py +77 -0
- supermem-0.3.0/supermem/model/__init__.py +5 -0
- supermem-0.3.0/supermem/model/base.py +255 -0
- supermem-0.3.0/supermem/privacy/__init__.py +5 -0
- supermem-0.3.0/supermem/privacy/filter.py +41 -0
- supermem-0.3.0/supermem/pyproject.toml +38 -0
- supermem-0.3.0/supermem/retrieval/__init__.py +15 -0
- supermem-0.3.0/supermem/retrieval/agent.py +91 -0
- supermem-0.3.0/supermem/retrieval/fts.py +55 -0
- supermem-0.3.0/supermem/retrieval/graph.py +102 -0
- supermem-0.3.0/supermem/retrieval/hybrid.py +168 -0
- supermem-0.3.0/supermem/retrieval/vector.py +59 -0
- supermem-0.3.0/supermem/storage/__init__.py +7 -0
- supermem-0.3.0/supermem/storage/database.py +452 -0
- supermem-0.3.0/supermem/storage/graph.py +175 -0
- supermem-0.3.0/supermem/storage/vector.py +108 -0
- supermem-0.3.0/tests/__init__.py +0 -0
- supermem-0.3.0/tests/conftest.py +43 -0
- supermem-0.3.0/tests/integration/__init__.py +0 -0
- supermem-0.3.0/tests/integration/test_full_query.py +222 -0
- supermem-0.3.0/tests/test_agent.py +188 -0
- supermem-0.3.0/tests/test_engine.py +123 -0
- supermem-0.3.0/tests/test_tools.py +262 -0
- supermem-0.3.0/tests/unit/__init__.py +0 -0
- supermem-0.3.0/tests/unit/test_agent_retriever.py +96 -0
- supermem-0.3.0/tests/unit/test_cli.py +192 -0
- supermem-0.3.0/tests/unit/test_compressor.py +99 -0
- supermem-0.3.0/tests/unit/test_database.py +231 -0
- supermem-0.3.0/tests/unit/test_graph.py +117 -0
- supermem-0.3.0/tests/unit/test_hybrid.py +107 -0
- supermem-0.3.0/tests/unit/test_mcp_server.py +522 -0
- supermem-0.3.0/tests/unit/test_model_clients.py +181 -0
- supermem-0.3.0/tests/unit/test_observation.py +63 -0
- supermem-0.3.0/tests/unit/test_privacy.py +71 -0
- supermem-0.3.0/tests/unit/test_session.py +88 -0
- supermem-0.3.0/tests/unit/test_vault_indexer.py +113 -0
- supermem-0.3.0/uv.lock +5347 -0
- supermem-0.3.0/worker/__init__.py +1 -0
- supermem-0.3.0/worker/app.py +304 -0
- supermem-0.3.0/worker/static/index.html +166 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Git
|
|
2
|
+
.git/
|
|
3
|
+
.gitignore
|
|
4
|
+
.gitattributes
|
|
5
|
+
|
|
6
|
+
# Python
|
|
7
|
+
__pycache__/
|
|
8
|
+
*.pyc
|
|
9
|
+
*.pyo
|
|
10
|
+
.venv/
|
|
11
|
+
*.egg-info/
|
|
12
|
+
dist/
|
|
13
|
+
build/
|
|
14
|
+
|
|
15
|
+
# Tests
|
|
16
|
+
tests/
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.coverage
|
|
19
|
+
coverage.xml
|
|
20
|
+
|
|
21
|
+
# CI
|
|
22
|
+
.github/
|
|
23
|
+
|
|
24
|
+
# Docs
|
|
25
|
+
docs/
|
|
26
|
+
|
|
27
|
+
# Dev
|
|
28
|
+
.memory_path
|
|
29
|
+
.filters
|
|
30
|
+
.mlx_model_name
|
|
31
|
+
mcp.json
|
|
32
|
+
debug/
|
|
33
|
+
tmp_work/
|
|
34
|
+
|
|
35
|
+
# OS
|
|
36
|
+
.DS_Store
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# supermem — Environment Variables
|
|
2
|
+
# ==============================================================================
|
|
3
|
+
# Copy this file to .env and fill in values as needed.
|
|
4
|
+
# .env is gitignored and will never be committed.
|
|
5
|
+
#
|
|
6
|
+
# Quick start (3 vars minimum):
|
|
7
|
+
# SUPERMEM_VAULT_PATH=~/notes
|
|
8
|
+
# SUPERMEM_LLM_PROVIDER=openrouter
|
|
9
|
+
# OPENROUTER_API_KEY=sk-or-...
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
13
|
+
# 1. Core Setup (required)
|
|
14
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
15
|
+
|
|
16
|
+
# LLM provider backend. Controls which API / server supermem uses for tier-4
|
|
17
|
+
# agent fallback and compression.
|
|
18
|
+
# openrouter → cloud (OpenRouter, no GPU needed)
|
|
19
|
+
# claude → cloud (Anthropic direct)
|
|
20
|
+
# ollama → local (Ollama server)
|
|
21
|
+
# vllm → local (vLLM server with GPU)
|
|
22
|
+
# lmstudio → local (LM Studio)
|
|
23
|
+
SUPERMEM_LLM_PROVIDER=openrouter
|
|
24
|
+
|
|
25
|
+
# Model string passed to the provider above. Leave blank to use each
|
|
26
|
+
# provider's default (claude-sonnet-4 for OpenRouter, llama3.2 for Ollama,
|
|
27
|
+
# driaforall/mem-agent for vLLM, claude-sonnet-4-5 for Anthropic).
|
|
28
|
+
# Examples: openai/gpt-4o-mini, llama3.2, claude-opus-4-5
|
|
29
|
+
SUPERMEM_LLM_MODEL=
|
|
30
|
+
|
|
31
|
+
# Absolute path to your markdown vault directory. This is where supermem
|
|
32
|
+
# reads and indexes your notes.
|
|
33
|
+
# Default: reads .memory_path file in the repo root, falls back to ./memory/mcp-server
|
|
34
|
+
SUPERMEM_VAULT_PATH=
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
38
|
+
# 2. Provider-specific API keys & hosts
|
|
39
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
40
|
+
|
|
41
|
+
# ── OpenRouter (required when SUPERMEM_LLM_PROVIDER=openrouter) ──────────────
|
|
42
|
+
# Get a key at https://openrouter.ai/keys
|
|
43
|
+
OPENROUTER_API_KEY=
|
|
44
|
+
# Optional: custom base URL for proxies/gateways (default: https://openrouter.ai/api/v1)
|
|
45
|
+
# OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
|
|
46
|
+
|
|
47
|
+
# ── Anthropic (required when SUPERMEM_LLM_PROVIDER=claude) ──────────────────
|
|
48
|
+
# Get a key at https://console.anthropic.com/
|
|
49
|
+
ANTHROPIC_API_KEY=
|
|
50
|
+
|
|
51
|
+
# ── Ollama (used when SUPERMEM_LLM_PROVIDER=ollama) ─────────────────────────
|
|
52
|
+
OLLAMA_HOST=http://localhost:11434
|
|
53
|
+
|
|
54
|
+
# ── vLLM (used when SUPERMEM_LLM_PROVIDER=vllm) ─────────────────────────────
|
|
55
|
+
VLLM_HOST=0.0.0.0
|
|
56
|
+
VLLM_PORT=8000
|
|
57
|
+
|
|
58
|
+
# ── LM Studio (used when SUPERMEM_LLM_PROVIDER=lmstudio) ────────────────────
|
|
59
|
+
LMSTUDIO_HOST=http://localhost:1234
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
63
|
+
# 3. Storage paths
|
|
64
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
65
|
+
|
|
66
|
+
# SQLite database path (default: ~/.supermem/supermem.db)
|
|
67
|
+
# SUPERMEM_DB_PATH=~/.supermem/supermem.db
|
|
68
|
+
|
|
69
|
+
# Kuzu embedded graph database path (default: ~/.supermem/graph)
|
|
70
|
+
# Tier 2 — optional. Install with: pip install kuzu
|
|
71
|
+
# SUPERMEM_KUZU_PATH=~/.supermem/graph
|
|
72
|
+
|
|
73
|
+
# ChromaDB vector store path (default: ~/.supermem/chroma)
|
|
74
|
+
# Tier 3 — requires SUPERMEM_VECTOR=true below
|
|
75
|
+
# SUPERMEM_CHROMA_PATH=~/.supermem/chroma
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
79
|
+
# 4. Feature flags
|
|
80
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
81
|
+
|
|
82
|
+
# Enable ChromaDB vector similarity tier (tier 3). Requires:
|
|
83
|
+
# pip install chromadb sentence-transformers
|
|
84
|
+
# Default: false
|
|
85
|
+
SUPERMEM_VECTOR=false
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
89
|
+
# 5. Retrieval tuning
|
|
90
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
91
|
+
|
|
92
|
+
# Minimum results before short-circuiting. If tier 1 (FTS5) returns at least
|
|
93
|
+
# this many matches, tiers 2–4 are skipped entirely.
|
|
94
|
+
# Default: 3
|
|
95
|
+
# SUPERMEM_MIN_RESULTS=3
|
|
96
|
+
|
|
97
|
+
# Default tier limit for hybrid search (1–4). Lower = faster but less thorough.
|
|
98
|
+
# Default: 4
|
|
99
|
+
# SUPERMEM_DEFAULT_TIER_LIMIT=4
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
103
|
+
# 6. Agent / sandbox limits
|
|
104
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
105
|
+
|
|
106
|
+
# Max tool-calling turns the LLM agent can take before giving up.
|
|
107
|
+
# Default: 20
|
|
108
|
+
# SUPERMEM_MAX_TOOL_TURNS=20
|
|
109
|
+
|
|
110
|
+
# Timeout in seconds for the agent's Python sandbox execution.
|
|
111
|
+
# Default: 20
|
|
112
|
+
# SUPERMEM_SANDBOX_TIMEOUT=20
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
116
|
+
# 7. Compression & expiry
|
|
117
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
118
|
+
|
|
119
|
+
# Number of observations written before the LLM compression pass runs.
|
|
120
|
+
# Default: 50
|
|
121
|
+
# SUPERMEM_COMPRESS_EVERY=50
|
|
122
|
+
|
|
123
|
+
# TTL for regular observations in days (0 = never expire).
|
|
124
|
+
# Default: 90
|
|
125
|
+
# SUPERMEM_OBS_TTL_DAYS=90
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
129
|
+
# 8. HTTP dashboard & API (optional — requires supmem serve --worker)
|
|
130
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
131
|
+
|
|
132
|
+
# Port for the HTTP dashboard and REST API. Access at http://localhost:37777
|
|
133
|
+
# Default: 37777
|
|
134
|
+
# SUPERMEM_WORKER_PORT=37777
|
|
135
|
+
|
|
136
|
+
# Bind address for the HTTP worker.
|
|
137
|
+
# Default: 127.0.0.1
|
|
138
|
+
# SUPERMEM_WORKER_HOST=127.0.0.1
|
|
139
|
+
|
|
140
|
+
# Bearer token for HTTP API authentication. When set, all endpoints require:
|
|
141
|
+
# Authorization: Bearer <SUPERMEM_API_KEY>
|
|
142
|
+
# When left empty, auth is disabled (convenient for local use).
|
|
143
|
+
# SUPERMEM_API_KEY=
|
|
144
|
+
|
|
145
|
+
# Rate limit in requests per minute for the HTTP API.
|
|
146
|
+
# Default: 60
|
|
147
|
+
# SUPERMEM_RATE_LIMIT=60
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
151
|
+
# 9. Logging & transport
|
|
152
|
+
# ══════════════════════════════════════════════════════════════════════════════
|
|
153
|
+
|
|
154
|
+
# FastMCP log level. Set to DEBUG for verbose output when troubleshooting.
|
|
155
|
+
# Options: DEBUG, INFO, WARNING, ERROR
|
|
156
|
+
# Default: INFO
|
|
157
|
+
FASTMCP_LOG_LEVEL=INFO
|
|
158
|
+
|
|
159
|
+
# MCP transport protocol. Only relevant when running supmem serve.
|
|
160
|
+
# stdio → Claude Desktop and other stdio-based MCP clients
|
|
161
|
+
# http → ChatGPT and HTTP-based MCP clients
|
|
162
|
+
# sse → Server-Sent Events transport
|
|
163
|
+
# Default: stdio
|
|
164
|
+
MCP_TRANSPORT=stdio
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Something is broken
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Describe the bug
|
|
10
|
+
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
## To reproduce
|
|
14
|
+
|
|
15
|
+
Steps to reproduce:
|
|
16
|
+
1. Run `...`
|
|
17
|
+
2. Ask `...`
|
|
18
|
+
3. See error
|
|
19
|
+
|
|
20
|
+
## Expected behaviour
|
|
21
|
+
|
|
22
|
+
What you expected to happen.
|
|
23
|
+
|
|
24
|
+
## Actual behaviour
|
|
25
|
+
|
|
26
|
+
What actually happened. Include the full error message or unexpected output.
|
|
27
|
+
|
|
28
|
+
## Logs
|
|
29
|
+
|
|
30
|
+
Enable debug logging and paste the relevant output:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
FASTMCP_LOG_LEVEL=DEBUG make serve-mcp
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
[paste logs here]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Environment
|
|
41
|
+
|
|
42
|
+
- OS: [e.g. macOS 14.5, Ubuntu 22.04]
|
|
43
|
+
- Python version: `python --version`
|
|
44
|
+
- uv version: `uv --version`
|
|
45
|
+
- Model used: [e.g. mem-agent-mlx-4bit, vLLM]
|
|
46
|
+
- AI client: [e.g. Claude Desktop 1.x, LM Studio 0.x, ChatGPT]
|
|
47
|
+
- Transport: [stdio / http / sse]
|
|
48
|
+
|
|
49
|
+
## Memory setup
|
|
50
|
+
|
|
51
|
+
- Memory directory size (approx):
|
|
52
|
+
- Number of files in memory:
|
|
53
|
+
- Connector used to import (if any):
|
|
54
|
+
|
|
55
|
+
## Additional context
|
|
56
|
+
|
|
57
|
+
Any other context about the problem.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest a new connector, integration, or capability
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What problem does this solve?
|
|
10
|
+
|
|
11
|
+
A clear description of the problem or gap this feature addresses.
|
|
12
|
+
|
|
13
|
+
Example: *"I want to import my Obsidian vault directly, but there's no connector for it."*
|
|
14
|
+
|
|
15
|
+
## Proposed solution
|
|
16
|
+
|
|
17
|
+
Describe what you'd like to see added.
|
|
18
|
+
|
|
19
|
+
## Alternatives considered
|
|
20
|
+
|
|
21
|
+
Any other approaches you considered and why you ruled them out.
|
|
22
|
+
|
|
23
|
+
## Are you willing to implement this?
|
|
24
|
+
|
|
25
|
+
- [ ] Yes, I can open a PR
|
|
26
|
+
- [ ] No, I'm requesting it from maintainers
|
|
27
|
+
|
|
28
|
+
## Additional context
|
|
29
|
+
|
|
30
|
+
Any screenshots, links, or context that would help.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
What does this PR do? (1–3 sentences)
|
|
4
|
+
|
|
5
|
+
## Type of change
|
|
6
|
+
|
|
7
|
+
- [ ] Bug fix
|
|
8
|
+
- [ ] New feature (new connector, integration, or agent capability)
|
|
9
|
+
- [ ] Refactor / cleanup
|
|
10
|
+
- [ ] Documentation
|
|
11
|
+
- [ ] Tests only
|
|
12
|
+
|
|
13
|
+
## Changes
|
|
14
|
+
|
|
15
|
+
-
|
|
16
|
+
-
|
|
17
|
+
-
|
|
18
|
+
|
|
19
|
+
## Testing
|
|
20
|
+
|
|
21
|
+
How did you test this?
|
|
22
|
+
|
|
23
|
+
- [ ] Added / updated unit tests in `tests/`
|
|
24
|
+
- [ ] Tested manually with Claude Desktop
|
|
25
|
+
- [ ] Tested manually with LM Studio
|
|
26
|
+
- [ ] Tested manually with ChatGPT
|
|
27
|
+
- [ ] Tested the CLI (`make chat-cli`)
|
|
28
|
+
|
|
29
|
+
## For new connectors
|
|
30
|
+
|
|
31
|
+
- [ ] Inherits from `BaseMemoryConnector`
|
|
32
|
+
- [ ] Implements `extract_data()`, `organize_data()`, `generate_memory_files()`
|
|
33
|
+
- [ ] Registered in `memory_connect.py`
|
|
34
|
+
- [ ] README updated with usage examples
|
|
35
|
+
- [ ] At least one test in `tests/`
|
|
36
|
+
|
|
37
|
+
## Checklist
|
|
38
|
+
|
|
39
|
+
- [ ] `uv run pytest tests/ -v` passes
|
|
40
|
+
- [ ] `uv run black .` applied
|
|
41
|
+
- [ ] No secrets or personal data committed
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
tags: ["v*"]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
# ── Lint + type-check + test ───────────────────────────────────────────────
|
|
11
|
+
check:
|
|
12
|
+
name: Lint, type-check, test
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v3
|
|
19
|
+
with:
|
|
20
|
+
version: "latest"
|
|
21
|
+
|
|
22
|
+
- name: Set up Python 3.11
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.11"
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync --frozen
|
|
29
|
+
|
|
30
|
+
- name: Ruff lint
|
|
31
|
+
run: uv run ruff check supermem/ agent/ mcp_server/ --output-format=github || true
|
|
32
|
+
|
|
33
|
+
- name: Check formatting (black)
|
|
34
|
+
run: uv run black --check .
|
|
35
|
+
|
|
36
|
+
- name: mypy type-check
|
|
37
|
+
run: uv run mypy supermem/ --ignore-missing-imports --no-error-summary
|
|
38
|
+
continue-on-error: true
|
|
39
|
+
|
|
40
|
+
- name: pytest with coverage
|
|
41
|
+
run: |
|
|
42
|
+
uv run pytest tests/ \
|
|
43
|
+
--cov=supermem \
|
|
44
|
+
--cov=agent \
|
|
45
|
+
--cov-report=term-missing \
|
|
46
|
+
--cov-report=xml \
|
|
47
|
+
--cov-fail-under=60
|
|
48
|
+
|
|
49
|
+
- name: Upload coverage report
|
|
50
|
+
uses: codecov/codecov-action@v4
|
|
51
|
+
if: always()
|
|
52
|
+
with:
|
|
53
|
+
file: coverage.xml
|
|
54
|
+
fail_ci_if_error: false
|
|
55
|
+
|
|
56
|
+
# ── Docker build (on tag push only) ───────────────────────────────────────
|
|
57
|
+
docker:
|
|
58
|
+
name: Build and push Docker image
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
needs: check
|
|
61
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
62
|
+
permissions:
|
|
63
|
+
contents: read
|
|
64
|
+
packages: write
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v4
|
|
67
|
+
|
|
68
|
+
- name: Set up Docker Buildx
|
|
69
|
+
uses: docker/setup-buildx-action@v3
|
|
70
|
+
|
|
71
|
+
- name: Log in to GitHub Container Registry
|
|
72
|
+
uses: docker/login-action@v3
|
|
73
|
+
with:
|
|
74
|
+
registry: ghcr.io
|
|
75
|
+
username: ${{ github.actor }}
|
|
76
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
77
|
+
|
|
78
|
+
- name: Extract metadata
|
|
79
|
+
id: meta
|
|
80
|
+
uses: docker/metadata-action@v5
|
|
81
|
+
with:
|
|
82
|
+
images: ghcr.io/${{ github.repository }}
|
|
83
|
+
tags: |
|
|
84
|
+
type=semver,pattern={{version}}
|
|
85
|
+
type=semver,pattern={{major}}.{{minor}}
|
|
86
|
+
|
|
87
|
+
- name: Build and push
|
|
88
|
+
uses: docker/build-push-action@v5
|
|
89
|
+
with:
|
|
90
|
+
context: .
|
|
91
|
+
push: true
|
|
92
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
93
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
94
|
+
|
|
95
|
+
# ── PyPI publish (on tag push only) ────────────────────────────────────────
|
|
96
|
+
pypi:
|
|
97
|
+
name: Publish to PyPI
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
needs: check
|
|
100
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
101
|
+
permissions:
|
|
102
|
+
contents: read
|
|
103
|
+
id-token: write
|
|
104
|
+
steps:
|
|
105
|
+
- uses: actions/checkout@v4
|
|
106
|
+
|
|
107
|
+
- name: Install uv
|
|
108
|
+
uses: astral-sh/setup-uv@v3
|
|
109
|
+
with:
|
|
110
|
+
version: "latest"
|
|
111
|
+
|
|
112
|
+
- name: Set up Python 3.11
|
|
113
|
+
uses: actions/setup-python@v5
|
|
114
|
+
with:
|
|
115
|
+
python-version: "3.11"
|
|
116
|
+
|
|
117
|
+
- name: Build
|
|
118
|
+
run: uv build
|
|
119
|
+
|
|
120
|
+
- name: Publish
|
|
121
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Python-generated files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[oc]
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
wheels/
|
|
7
|
+
*.egg-info
|
|
8
|
+
data_gen/instances/
|
|
9
|
+
|
|
10
|
+
# Virtual environments
|
|
11
|
+
.venv
|
|
12
|
+
|
|
13
|
+
# .env
|
|
14
|
+
.env
|
|
15
|
+
|
|
16
|
+
# debug
|
|
17
|
+
debug/
|
|
18
|
+
|
|
19
|
+
# lock files (keep uv.lock committed for reproducibility)
|
|
20
|
+
*.lock
|
|
21
|
+
!uv.lock
|
|
22
|
+
|
|
23
|
+
# memory (generated, contains personal data)
|
|
24
|
+
memory/
|
|
25
|
+
local-memory/
|
|
26
|
+
|
|
27
|
+
# tmp
|
|
28
|
+
tmp_work/
|
|
29
|
+
|
|
30
|
+
# .DS_Store
|
|
31
|
+
.DS_Store
|
|
32
|
+
**/.DS_Store
|
|
33
|
+
|
|
34
|
+
# mcp.json
|
|
35
|
+
mcp.json
|
|
36
|
+
|
|
37
|
+
# .memory_path
|
|
38
|
+
.memory_path
|
|
39
|
+
|
|
40
|
+
# .filters
|
|
41
|
+
.filters
|
|
42
|
+
|
|
43
|
+
# .mlx_model_name
|
|
44
|
+
.mlx_model_name
|
|
45
|
+
|
|
46
|
+
## start_server.sh
|
|
47
|
+
**/start_server.sh
|
|
48
|
+
.coverage
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.0] - 2026-04-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Ambient memory injection** via Claude Code hook system — automatically surfaces relevant observations during user prompts without requiring explicit memory queries
|
|
12
|
+
- **TTL-based observation expiry** — configure retention via `SUPERMEM_OBS_TTL_DAYS` (default: 90 days); automatic cleanup on startup and via worker API
|
|
13
|
+
- **Parallel retrieval tiers** — hybrid retrieval (FTS5 → graph → vector → agent) now runs in parallel for sub-100ms queries
|
|
14
|
+
- **New hooks system** (`supermem/hooks/`) — `inject.py` reads user prompts from stdin, searches local SQLite, injects observations as system context
|
|
15
|
+
- **ServerContext extraction** — refactored MCP server to isolate initialization and startup failure handling
|
|
16
|
+
- **Comprehensive test coverage** — 522 new lines of MCP server tests, database tests, vault indexer tests; all observation expiry paths covered
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **Rate limiter** — split per-user and per-endpoint limits for better control and clearer semantics
|
|
20
|
+
- **Vault indexer** — mtime-skip optimization to reduce redundant indexing; `get_entity_last_indexed` now cached
|
|
21
|
+
- **Startup robustness** — clear separation of startup failures (auth, db, config) vs. runtime errors
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- Black formatting alignment across all Python files
|
|
25
|
+
|
|
26
|
+
## [0.1.0] - 2025-02-25
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- Initial release: supermem v2 — four-tier retrieval architecture (FTS5 → graph → vector → agent)
|
|
30
|
+
- MCP server (stdio + HTTP transports) exposing agent as memory tool
|
|
31
|
+
- Hybrid storage: SQLite (FTS5), Kuzu (graph), Chroma (vector)
|
|
32
|
+
- Session tracking and observation recording
|
|
33
|
+
- Memory import connectors (ChatGPT, Notion, Nuclino, GitHub, Google Docs)
|
|
34
|
+
- `supermem` CLI with serve, chat, backup, restore, connect commands
|
|
35
|
+
- Worker HTTP API (`:37777`) for search, indexing, health checks
|