@lh8ppl/claude-memory-kit 0.2.3 → 0.3.0
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/README.md +13 -10
- package/bin/cmk-capture-prompt.mjs +21 -1
- package/package.json +2 -1
- package/src/auto-extract.mjs +68 -11
- package/src/capture-prompt.mjs +33 -1
- package/src/capture-turn.mjs +64 -6
- package/src/conflict-queue.mjs +20 -3
- package/src/doctor.mjs +52 -125
- package/src/forget.mjs +13 -0
- package/src/frontmatter.mjs +4 -1
- package/src/import-anthropic-memory.mjs +25 -1
- package/src/index-db.mjs +39 -0
- package/src/index-rebuild.mjs +42 -2
- package/src/inject-context.mjs +49 -6
- package/src/install.mjs +107 -1
- package/src/mcp-server.mjs +57 -7
- package/src/merge-facts.mjs +12 -0
- package/src/provenance.mjs +4 -0
- package/src/result-shapes.mjs +2 -2
- package/src/scratchpad.mjs +5 -3
- package/src/search.mjs +100 -12
- package/src/semantic-backend.mjs +485 -0
- package/src/settings-hooks.mjs +4 -1
- package/src/spawn-bin.mjs +7 -2
- package/src/subcommands.mjs +95 -18
- package/src/transcript-index.mjs +162 -0
- package/src/turn-tools.mjs +179 -0
- package/template/.claude/skills/memory-search/SKILL.md +86 -0
- package/template/CLAUDE.md.template +2 -0
- package/template/support/cron-jobs/nightly-memsearch-index.md +0 -17
- package/template/support/milvus-deploy/README.md +0 -57
- package/template/support/milvus-deploy/docker-compose.yml +0 -66
- package/template/support/scripts/memsearch-index-with-flush.sh +0 -59
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Milvus deployment (Windows + optional)
|
|
2
|
-
|
|
3
|
-
This compose stack runs Milvus v2.6.16 plus its required dependencies (etcd, MinIO) as three local containers. It's used by **Layer 5** (memsearch vector search) of the memory system.
|
|
4
|
-
|
|
5
|
-
## When you need this
|
|
6
|
-
|
|
7
|
-
- **Windows**: required. `milvus-lite` (the default embedded vector store memsearch ships) has no Windows wheels on PyPI. Use this Docker stack instead.
|
|
8
|
-
- **Linux / macOS**: optional. memsearch auto-installs milvus-lite and uses it at `~/.memsearch/milvus.db`. Skip this directory entirely unless you specifically want a remote Milvus.
|
|
9
|
-
|
|
10
|
-
## Bring it up
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
cd milvus-deploy
|
|
14
|
-
docker compose up -d
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Wait ~30-60 seconds for all three containers to report `(healthy)`:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
docker compose ps
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
You should see `milvus-etcd`, `milvus-minio`, `milvus-standalone` all `Up (healthy)`.
|
|
24
|
-
|
|
25
|
-
## Configure memsearch to use it
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
memsearch config set milvus.uri "http://localhost:19530"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Bring it down
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
docker compose down
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Volumes persist in `./volumes/` — re-running `up -d` reuses the same data.
|
|
38
|
-
|
|
39
|
-
## Why a multi-container stack and not just `milvus-standalone`?
|
|
40
|
-
|
|
41
|
-
Milvus standalone needs etcd (metadata store) and MinIO (object storage for segments and index data). On Linux/macOS, `milvus-lite` bundles all of that into one Python wheel; on Windows there's no equivalent wheel, so the three services run as separate containers.
|
|
42
|
-
|
|
43
|
-
The single-container `docker run milvusdb/milvus:latest standalone` pattern referenced in some older docs is no longer supported — `latest` is `v3.0-beta` whose entrypoint doesn't accept `standalone` as a command. Use this compose file with the pinned versions instead.
|
|
44
|
-
|
|
45
|
-
## Known quirk: memsearch index without flush
|
|
46
|
-
|
|
47
|
-
memsearch v0.4.x doesn't call `flush()` after `MilvusStore.upsert()`. On Milvus v2.6+ (Woodpecker WAL), this means `memsearch index` reports success but the data isn't searchable until a flush forces the growing segment to seal.
|
|
48
|
-
|
|
49
|
-
Use `scripts/memsearch-index-with-flush.sh` instead of raw `memsearch index` until upstream ships a fix. Tracked as [memsearch issue #534](https://github.com/zilliztech/memsearch/issues/534).
|
|
50
|
-
|
|
51
|
-
## Pinned versions
|
|
52
|
-
|
|
53
|
-
| Image | Version | Why pinned |
|
|
54
|
-
|---|---|---|
|
|
55
|
-
| `milvusdb/milvus` | `v2.6.16` | Latest stable v2.6 line. `latest` tag is v3.0-beta and crashes. |
|
|
56
|
-
| `quay.io/coreos/etcd` | `v3.5.25` | Compatible with milvus v2.6. |
|
|
57
|
-
| `minio/minio` | `RELEASE.2024-12-18T13-15-44Z` | Recent stable RELEASE tag. |
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
version: '3.5'
|
|
2
|
-
|
|
3
|
-
services:
|
|
4
|
-
etcd:
|
|
5
|
-
container_name: milvus-etcd
|
|
6
|
-
image: quay.io/coreos/etcd:v3.5.25
|
|
7
|
-
environment:
|
|
8
|
-
- ETCD_AUTO_COMPACTION_MODE=revision
|
|
9
|
-
- ETCD_AUTO_COMPACTION_RETENTION=1000
|
|
10
|
-
- ETCD_QUOTA_BACKEND_BYTES=4294967296
|
|
11
|
-
- ETCD_SNAPSHOT_COUNT=50000
|
|
12
|
-
volumes:
|
|
13
|
-
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd
|
|
14
|
-
command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
|
|
15
|
-
healthcheck:
|
|
16
|
-
test: ["CMD", "etcdctl", "endpoint", "health"]
|
|
17
|
-
interval: 30s
|
|
18
|
-
timeout: 20s
|
|
19
|
-
retries: 3
|
|
20
|
-
|
|
21
|
-
minio:
|
|
22
|
-
container_name: milvus-minio
|
|
23
|
-
image: minio/minio:RELEASE.2024-12-18T13-15-44Z
|
|
24
|
-
environment:
|
|
25
|
-
MINIO_ACCESS_KEY: minioadmin
|
|
26
|
-
MINIO_SECRET_KEY: minioadmin
|
|
27
|
-
ports:
|
|
28
|
-
- "9001:9001"
|
|
29
|
-
- "9000:9000"
|
|
30
|
-
volumes:
|
|
31
|
-
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/minio_data
|
|
32
|
-
command: minio server /minio_data --console-address ":9001"
|
|
33
|
-
healthcheck:
|
|
34
|
-
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
|
35
|
-
interval: 30s
|
|
36
|
-
timeout: 20s
|
|
37
|
-
retries: 3
|
|
38
|
-
|
|
39
|
-
standalone:
|
|
40
|
-
container_name: milvus-standalone
|
|
41
|
-
image: milvusdb/milvus:v2.6.16
|
|
42
|
-
command: ["milvus", "run", "standalone"]
|
|
43
|
-
security_opt:
|
|
44
|
-
- seccomp:unconfined
|
|
45
|
-
environment:
|
|
46
|
-
ETCD_ENDPOINTS: etcd:2379
|
|
47
|
-
MINIO_ADDRESS: minio:9000
|
|
48
|
-
MQ_TYPE: woodpecker
|
|
49
|
-
volumes:
|
|
50
|
-
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
|
|
51
|
-
healthcheck:
|
|
52
|
-
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
|
|
53
|
-
interval: 30s
|
|
54
|
-
start_period: 90s
|
|
55
|
-
timeout: 20s
|
|
56
|
-
retries: 3
|
|
57
|
-
ports:
|
|
58
|
-
- "19530:19530"
|
|
59
|
-
- "9091:9091"
|
|
60
|
-
depends_on:
|
|
61
|
-
- "etcd"
|
|
62
|
-
- "minio"
|
|
63
|
-
|
|
64
|
-
networks:
|
|
65
|
-
default:
|
|
66
|
-
name: milvus
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# Wraps `memsearch index` to also force a Milvus flush afterward.
|
|
4
|
-
#
|
|
5
|
-
# Why: Milvus v2.6+ uses the Woodpecker WAL backend, which (unlike v2.5's
|
|
6
|
-
# Pulsar) does not auto-flush growing segments on a short timer. As a result,
|
|
7
|
-
# `memsearch index` reports "Indexed N chunks" successfully but
|
|
8
|
-
# `get_collection_stats` returns 0 rows and search returns no results until
|
|
9
|
-
# a manual flush forces the growing segment to seal.
|
|
10
|
-
#
|
|
11
|
-
# This wrapper runs the index, then issues a flush via pymilvus.
|
|
12
|
-
#
|
|
13
|
-
# Usage:
|
|
14
|
-
# bash scripts/memsearch-index-with-flush.sh context/memory context/sessions context/transcripts
|
|
15
|
-
#
|
|
16
|
-
# Reads MILVUS_URI from env (falls back to the memsearch config value, then localhost).
|
|
17
|
-
# Reads MILVUS_COLLECTION from env (falls back to memsearch config, then "memsearch_chunks").
|
|
18
|
-
|
|
19
|
-
# Task Scheduler / launchd / unattended cron contexts don't always inherit
|
|
20
|
-
# the user's PATH. Set it up explicitly for the common locations.
|
|
21
|
-
case ":$PATH:" in
|
|
22
|
-
*":/usr/bin:"*) ;;
|
|
23
|
-
*) export PATH="/usr/bin:/usr/local/bin:/opt/homebrew/bin:/c/Program Files/Git/usr/bin:$PATH" ;;
|
|
24
|
-
esac
|
|
25
|
-
|
|
26
|
-
# On Windows, also add the Python Scripts dir where `memsearch.exe` lands.
|
|
27
|
-
if [ -d "/c/Users/$USERNAME/AppData/Local/Programs/Python" ]; then
|
|
28
|
-
for d in /c/Users/$USERNAME/AppData/Local/Programs/Python/Python*/Scripts \
|
|
29
|
-
/c/Users/$USERNAME/AppData/Local/Programs/Python/Python*; do
|
|
30
|
-
[ -d "$d" ] && export PATH="$d:$PATH"
|
|
31
|
-
done
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
set -euo pipefail
|
|
35
|
-
|
|
36
|
-
# Step 1 — index. Pass through all args.
|
|
37
|
-
memsearch index "$@"
|
|
38
|
-
|
|
39
|
-
# Step 2 — flush.
|
|
40
|
-
MILVUS_URI="${MILVUS_URI:-$(memsearch config get milvus.uri 2>/dev/null | tail -n1 | tr -d '\r')}"
|
|
41
|
-
MILVUS_COLLECTION="${MILVUS_COLLECTION:-$(memsearch config get milvus.collection 2>/dev/null | tail -n1 | tr -d '\r')}"
|
|
42
|
-
MILVUS_URI="${MILVUS_URI:-http://localhost:19530}"
|
|
43
|
-
MILVUS_COLLECTION="${MILVUS_COLLECTION:-memsearch_chunks}"
|
|
44
|
-
|
|
45
|
-
# Flush only if we're using a remote Milvus (milvus-lite auto-flushes).
|
|
46
|
-
case "$MILVUS_URI" in
|
|
47
|
-
http://*|https://*|tcp://*)
|
|
48
|
-
python -c "
|
|
49
|
-
from pymilvus import MilvusClient
|
|
50
|
-
client = MilvusClient(uri='${MILVUS_URI}')
|
|
51
|
-
client.flush('${MILVUS_COLLECTION}')
|
|
52
|
-
stats = client.get_collection_stats('${MILVUS_COLLECTION}')
|
|
53
|
-
print(f'Flushed. Collection {stats!r}')
|
|
54
|
-
"
|
|
55
|
-
;;
|
|
56
|
-
*)
|
|
57
|
-
echo "Local milvus-lite detected (${MILVUS_URI}); skipping flush (auto-flush)."
|
|
58
|
-
;;
|
|
59
|
-
esac
|