@pentatonic-ai/ai-agent-sdk 0.9.5 → 0.10.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 +3 -3
- package/bin/cli.js +1 -1
- package/bin/commands/config.js +1 -1
- package/dist/index.cjs +39 -72
- package/dist/index.js +36 -69
- package/package.json +10 -3
- package/packages/doctor/src/checks/local-memory.js +2 -2
- package/packages/memory/README.md +2 -2
- package/packages/memory/openclaw-plugin/README.md +2 -2
- package/packages/memory/openclaw-plugin/openclaw.plugin.json +1 -1
- package/packages/memory/package-lock.json +49 -33
- package/packages/memory/package.json +4 -1
- package/packages/memory/src/__tests__/engine.test.js +40 -5
- package/packages/memory/src/engine.js +38 -3
- package/packages/memory/src/server.js +2 -2
- package/packages/memory-engine-v2/.env.example +30 -0
- package/packages/memory-engine-v2/README.md +125 -0
- package/packages/memory-engine-v2/compat/Dockerfile +11 -0
- package/packages/memory-engine-v2/compat/requirements.txt +6 -0
- package/packages/memory-engine-v2/compat/server.py +1047 -0
- package/packages/memory-engine-v2/docker-compose.aws.yml +78 -0
- package/packages/memory-engine-v2/docker-compose.yml +206 -0
- package/packages/memory-engine-v2/extractor-async/Dockerfile +14 -0
- package/packages/memory-engine-v2/extractor-async/confidence.py +62 -0
- package/packages/memory-engine-v2/extractor-async/noise_filter.py +144 -0
- package/packages/memory-engine-v2/extractor-async/requirements.txt +2 -0
- package/packages/memory-engine-v2/extractor-async/test_confidence.py +76 -0
- package/packages/memory-engine-v2/extractor-async/test_noise_filter.py +177 -0
- package/packages/memory-engine-v2/extractor-async/worker.py +797 -0
- package/packages/memory-engine-v2/extractor-sync/Dockerfile +11 -0
- package/packages/memory-engine-v2/extractor-sync/requirements.txt +4 -0
- package/packages/memory-engine-v2/extractor-sync/server.py +424 -0
- package/packages/memory-engine-v2/org-model/migrations/001_init.sql +390 -0
- package/packages/memory-engine-v2/tests/e2e_smoke.py +356 -0
- package/packages/memory-engine-v2/tests/fixtures/generate_synthetic_corpus.py +758 -0
- package/packages/memory-engine/.env.example +0 -13
- package/packages/memory-engine/MIGRATION.md +0 -219
- package/packages/memory-engine/README.md +0 -145
- package/packages/memory-engine/bench/README.md +0 -99
- package/packages/memory-engine/bench/scorecards-engine/agent-coding__pentatonic-baseline__20260427-142523.json +0 -1115
- package/packages/memory-engine/bench/scorecards-engine/chat-recall__pentatonic-baseline__20260427-142648.json +0 -819
- package/packages/memory-engine/bench/scorecards-engine/circular-economy__pentatonic-baseline__20260427-142757.json +0 -1278
- package/packages/memory-engine/bench/scorecards-engine/customer-support__pentatonic-baseline__20260427-142900.json +0 -1018
- package/packages/memory-engine/bench/scorecards-engine/marketplace-ops__pentatonic-baseline__20260427-142957.json +0 -1038
- package/packages/memory-engine/bench/scorecards-engine/product-catalogue__pentatonic-baseline__20260427-143122.json +0 -961
- package/packages/memory-engine/bench/scorecards-engine-via-docker/agent-coding__pentatonic-memory__20260427-161812.json +0 -1115
- package/packages/memory-engine/bench/scorecards-engine-via-docker/chat-recall__pentatonic-memory__20260427-161701.json +0 -819
- package/packages/memory-engine/bench/scorecards-engine-via-docker/circular-economy__pentatonic-memory__20260427-161713.json +0 -1278
- package/packages/memory-engine/bench/scorecards-engine-via-docker/customer-support__pentatonic-memory__20260427-161723.json +0 -1018
- package/packages/memory-engine/bench/scorecards-engine-via-docker/marketplace-ops__pentatonic-memory__20260427-161732.json +0 -1038
- package/packages/memory-engine/bench/scorecards-engine-via-docker/product-catalogue__pentatonic-memory__20260427-161741.json +0 -937
- package/packages/memory-engine/bench/scorecards-engine-via-l2-7-layer-populated/agent-coding__pentatonic-memory__20260427-184718.json +0 -1115
- package/packages/memory-engine/bench/scorecards-engine-via-l2-7-layer-populated/chat-recall__pentatonic-memory__20260427-184614.json +0 -819
- package/packages/memory-engine/bench/scorecards-engine-via-l2-7-layer-populated/circular-economy__pentatonic-memory__20260427-184809.json +0 -1278
- package/packages/memory-engine/bench/scorecards-engine-via-l2-7-layer-populated/customer-support__pentatonic-memory__20260427-184854.json +0 -1018
- package/packages/memory-engine/bench/scorecards-engine-via-l2-7-layer-populated/marketplace-ops__pentatonic-memory__20260427-184929.json +0 -1038
- package/packages/memory-engine/bench/scorecards-engine-via-l2-7-layer-populated/product-catalogue__pentatonic-memory__20260427-185015.json +0 -961
- package/packages/memory-engine/bench/scorecards-engine-via-l2-empty-layers/agent-coding__pentatonic-memory__20260427-175252.json +0 -1115
- package/packages/memory-engine/bench/scorecards-engine-via-l2-empty-layers/chat-recall__pentatonic-memory__20260427-175312.json +0 -819
- package/packages/memory-engine/bench/scorecards-engine-via-l2-empty-layers/circular-economy__pentatonic-memory__20260427-175335.json +0 -1278
- package/packages/memory-engine/bench/scorecards-engine-via-l2-empty-layers/customer-support__pentatonic-memory__20260427-175355.json +0 -1018
- package/packages/memory-engine/bench/scorecards-engine-via-l2-empty-layers/marketplace-ops__pentatonic-memory__20260427-175413.json +0 -1038
- package/packages/memory-engine/bench/scorecards-engine-via-l2-empty-layers/product-catalogue__pentatonic-memory__20260427-175430.json +0 -883
- package/packages/memory-engine/bench/scorecards-engine-via-shim/agent-coding__pentatonic-memory__20260427-155409.json +0 -1115
- package/packages/memory-engine/bench/scorecards-engine-via-shim/chat-recall__pentatonic-memory__20260427-155421.json +0 -819
- package/packages/memory-engine/bench/scorecards-engine-via-shim/circular-economy__pentatonic-memory__20260427-155433.json +0 -1278
- package/packages/memory-engine/bench/scorecards-engine-via-shim/customer-support__pentatonic-memory__20260427-155443.json +0 -1018
- package/packages/memory-engine/bench/scorecards-engine-via-shim/marketplace-ops__pentatonic-memory__20260427-155453.json +0 -1038
- package/packages/memory-engine/bench/scorecards-engine-via-shim/product-catalogue__pentatonic-memory__20260427-155503.json +0 -937
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/agent-coding__pentatonic-memory-latest__20260427-145103.json +0 -1115
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/agent-coding__pentatonic-memory__20260427-144909.json +0 -1115
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/chat-recall__pentatonic-memory-latest__20260427-145153.json +0 -819
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/chat-recall__pentatonic-memory__20260427-145120.json +0 -542
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/circular-economy__pentatonic-memory-latest__20260427-145313.json +0 -1278
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/circular-economy__pentatonic-memory__20260427-145207.json +0 -894
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/customer-support__pentatonic-memory-latest__20260427-145412.json +0 -1018
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/customer-support__pentatonic-memory__20260427-145327.json +0 -680
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/marketplace-ops__pentatonic-memory-latest__20260427-145517.json +0 -1038
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/marketplace-ops__pentatonic-memory__20260427-145422.json +0 -693
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/product-catalogue__pentatonic-memory-latest__20260427-145616.json +0 -961
- package/packages/memory-engine/bench/scorecards-pentatonic-baseline/product-catalogue__pentatonic-memory__20260427-145528.json +0 -727
- package/packages/memory-engine/compat/Dockerfile +0 -22
- package/packages/memory-engine/compat/server.py +0 -1255
- package/packages/memory-engine/docker-compose.test.yml +0 -59
- package/packages/memory-engine/docker-compose.yml +0 -240
- package/packages/memory-engine/engine/README.md +0 -52
- package/packages/memory-engine/engine/l2-hybridrag-proxy.py +0 -1543
- package/packages/memory-engine/engine/l5-comms-layer.py +0 -663
- package/packages/memory-engine/engine/l6-document-store.py +0 -1018
- package/packages/memory-engine/engine/services/_shared/__init__.py +0 -1
- package/packages/memory-engine/engine/services/_shared/embed_provider.py +0 -468
- package/packages/memory-engine/engine/services/l2/Dockerfile +0 -50
- package/packages/memory-engine/engine/services/l2/init_databases.py +0 -81
- package/packages/memory-engine/engine/services/l2/l2-hybridrag-proxy.py +0 -2721
- package/packages/memory-engine/engine/services/l5/Dockerfile +0 -11
- package/packages/memory-engine/engine/services/l5/l5-comms-layer.py +0 -808
- package/packages/memory-engine/engine/services/l6/Dockerfile +0 -30
- package/packages/memory-engine/engine/services/l6/l6-document-store.py +0 -1221
- package/packages/memory-engine/engine/services/nv-embed/Dockerfile +0 -28
- package/packages/memory-engine/engine/services/nv-embed/server.py +0 -152
- package/packages/memory-engine/pme_memory/__init__.py +0 -0
- package/packages/memory-engine/pme_memory/__main__.py +0 -129
- package/packages/memory-engine/pme_memory/artifacts.py +0 -95
- package/packages/memory-engine/pme_memory/embed.py +0 -74
- package/packages/memory-engine/pme_memory/health.py +0 -36
- package/packages/memory-engine/pme_memory/hygiene.py +0 -159
- package/packages/memory-engine/pme_memory/indexer.py +0 -200
- package/packages/memory-engine/pme_memory/needs.py +0 -55
- package/packages/memory-engine/pme_memory/provenance.py +0 -80
- package/packages/memory-engine/pme_memory/scoring.py +0 -168
- package/packages/memory-engine/pme_memory/search.py +0 -52
- package/packages/memory-engine/pme_memory/store.py +0 -86
- package/packages/memory-engine/pme_memory/synthesis.py +0 -114
- package/packages/memory-engine/pyproject.toml +0 -65
- package/packages/memory-engine/scripts/kg-extractor.py +0 -557
- package/packages/memory-engine/scripts/kg-preflexor-v2.py +0 -738
- package/packages/memory-engine/scripts/wipe-legacy-l3-entities.py +0 -128
- package/packages/memory-engine/tests/e2e_arena.sh +0 -259
- package/packages/memory-engine/tests/embed_stub/Dockerfile +0 -13
- package/packages/memory-engine/tests/embed_stub/server.py +0 -80
- package/packages/memory-engine/tests/test_aggregate.py +0 -333
- package/packages/memory-engine/tests/test_api_contract.sh +0 -57
- package/packages/memory-engine/tests/test_arena_safety.py +0 -232
- package/packages/memory-engine/tests/test_channel_stat_reader.py +0 -437
- package/packages/memory-engine/tests/test_channel_stat_rollups.py +0 -308
- package/packages/memory-engine/tests/test_compat_nv_embed_probe.py +0 -48
- package/packages/memory-engine/tests/test_embed_provider.py +0 -492
- package/packages/memory-engine/tests/test_l2_qmd_vec_search.py +0 -280
- package/packages/memory-engine/tests/test_l3_arena_isolation.py +0 -412
- package/packages/memory-engine/tests/test_l6_module_load.py +0 -84
- package/packages/memory-engine/tests/test_people_list_reader.py +0 -432
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# docker-compose.test.yml — overlay for hermetic CI runs.
|
|
2
|
-
#
|
|
3
|
-
# Replaces the nv-embed GPU service with a deterministic embedding
|
|
4
|
-
# stub that mimics both the OpenAI /v1/embeddings shape and the
|
|
5
|
-
# lambda-gateway /v1/embed shape. Lets CI exercise every layer's
|
|
6
|
-
# vector path without an actual model.
|
|
7
|
-
#
|
|
8
|
-
# Usage:
|
|
9
|
-
# docker compose -f docker-compose.yml -f docker-compose.test.yml \
|
|
10
|
-
# up -d --wait l3 l4 l5 l6 l2 compat embed-stub
|
|
11
|
-
#
|
|
12
|
-
# The base nv-embed service is intentionally NOT started in CI
|
|
13
|
-
# (requires a GPU). l4/l5/l6 are pointed at embed-stub via env.
|
|
14
|
-
|
|
15
|
-
services:
|
|
16
|
-
embed-stub:
|
|
17
|
-
build:
|
|
18
|
-
context: ./tests/embed_stub
|
|
19
|
-
dockerfile: Dockerfile
|
|
20
|
-
container_name: pme-embed-stub
|
|
21
|
-
networks:
|
|
22
|
-
- engine-net
|
|
23
|
-
environment:
|
|
24
|
-
EMBED_DIM: "4096"
|
|
25
|
-
healthcheck:
|
|
26
|
-
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8041/health',timeout=3)"]
|
|
27
|
-
interval: 5s
|
|
28
|
-
timeout: 3s
|
|
29
|
-
retries: 20
|
|
30
|
-
start_period: 5s
|
|
31
|
-
|
|
32
|
-
# Pin the embedding dim explicitly across layers, independent of any
|
|
33
|
-
# developer-local .env (which may set EMBED_DIM=768 for Ollama-based
|
|
34
|
-
# local dev). The stub returns 4096; layers must agree.
|
|
35
|
-
l5:
|
|
36
|
-
environment:
|
|
37
|
-
L5_NV_EMBED_URL: http://embed-stub:8041/v1/embeddings
|
|
38
|
-
L5_EMBED_API_KEY: ""
|
|
39
|
-
L5_EMBED_DIM: "4096"
|
|
40
|
-
|
|
41
|
-
l6:
|
|
42
|
-
environment:
|
|
43
|
-
L6_NV_EMBED_URL: http://embed-stub:8041/v1/embeddings
|
|
44
|
-
L6_EMBED_API_KEY: ""
|
|
45
|
-
L6_EMBED_DIM: "4096"
|
|
46
|
-
|
|
47
|
-
l2:
|
|
48
|
-
environment:
|
|
49
|
-
PME_NV_EMBED_URL: http://embed-stub:8041/v1/embeddings
|
|
50
|
-
|
|
51
|
-
compat:
|
|
52
|
-
environment:
|
|
53
|
-
NV_EMBED_URL: http://embed-stub:8041/v1/embeddings
|
|
54
|
-
depends_on:
|
|
55
|
-
embed-stub:
|
|
56
|
-
condition: service_healthy
|
|
57
|
-
l2: { condition: service_started }
|
|
58
|
-
l5: { condition: service_started }
|
|
59
|
-
l6: { condition: service_started }
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
name: pentatonic-memory-engine
|
|
2
|
-
|
|
3
|
-
# pentatonic-memory-engine v0.1
|
|
4
|
-
#
|
|
5
|
-
# Drop-in HTTP-compatible replacement for `pentatonic-memory` v0.5,
|
|
6
|
-
# backed by the 7-layer hybrid retrieval engine.
|
|
7
|
-
#
|
|
8
|
-
# Bring up: docker compose up -d
|
|
9
|
-
# API surface: http://localhost:8099 (matches pentatonic-memory v0.5)
|
|
10
|
-
# Health: curl http://localhost:8099/health
|
|
11
|
-
#
|
|
12
|
-
# Layers:
|
|
13
|
-
# l0 (in-process) — BM25 over SQLite FTS5 (inside L2 + L6)
|
|
14
|
-
# l1 (in-process) — Always-loaded core files (inside L2)
|
|
15
|
-
# l2 :8031 — HybridRAG proxy (RRF fusion)
|
|
16
|
-
# l3 :7474 — Knowledge Graph (Neo4j Community)
|
|
17
|
-
# l4 :8042 — sqlite-vec vector index
|
|
18
|
-
# l5 :8034 — Milvus comms layer
|
|
19
|
-
# l6 :8037 — Document store + cross-encoder reranker
|
|
20
|
-
# compat :8099 — pentatonic-memory v0.5 API translation shim
|
|
21
|
-
#
|
|
22
|
-
# nv-embed :8041 — NV-Embed-v2 4096d embedding service
|
|
23
|
-
#
|
|
24
|
-
# The nv-embed service requires a GPU. If running without GPU,
|
|
25
|
-
# override NV_EMBED_URL to point at an external embedding endpoint:
|
|
26
|
-
# - OpenAI's /v1/embeddings (text-embedding-3-large)
|
|
27
|
-
# - the Pentatonic AI Gateway
|
|
28
|
-
# - any OpenAI-compat embedding endpoint
|
|
29
|
-
|
|
30
|
-
x-engine-base: &engine-base
|
|
31
|
-
restart: unless-stopped
|
|
32
|
-
networks:
|
|
33
|
-
- engine-net
|
|
34
|
-
|
|
35
|
-
services:
|
|
36
|
-
# --------------------------------------------------------------------
|
|
37
|
-
# NV-Embed-v2 — 4096-dim embedding service (GPU required)
|
|
38
|
-
# --------------------------------------------------------------------
|
|
39
|
-
nv-embed:
|
|
40
|
-
<<: *engine-base
|
|
41
|
-
build:
|
|
42
|
-
context: ./engine/services/nv-embed
|
|
43
|
-
dockerfile: Dockerfile
|
|
44
|
-
container_name: pme-nv-embed
|
|
45
|
-
ports: ["127.0.0.1:${PME_NV_EMBED_PORT:-8041}:8041"]
|
|
46
|
-
volumes:
|
|
47
|
-
- pme-nv-embed-cache:/cache
|
|
48
|
-
deploy:
|
|
49
|
-
resources:
|
|
50
|
-
reservations:
|
|
51
|
-
devices:
|
|
52
|
-
- driver: nvidia
|
|
53
|
-
count: 1
|
|
54
|
-
capabilities: [gpu]
|
|
55
|
-
healthcheck:
|
|
56
|
-
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8041/health',timeout=3)"]
|
|
57
|
-
interval: 15s
|
|
58
|
-
timeout: 10s
|
|
59
|
-
retries: 20
|
|
60
|
-
start_period: 120s
|
|
61
|
-
|
|
62
|
-
# --------------------------------------------------------------------
|
|
63
|
-
# L3 — Knowledge Graph (Neo4j Community)
|
|
64
|
-
# --------------------------------------------------------------------
|
|
65
|
-
l3:
|
|
66
|
-
<<: *engine-base
|
|
67
|
-
image: neo4j:5-community
|
|
68
|
-
container_name: pme-l3
|
|
69
|
-
ports:
|
|
70
|
-
- "127.0.0.1:${PME_L3_HTTP_PORT:-7475}:7474" # HTTP browser
|
|
71
|
-
- "127.0.0.1:${PME_L3_BOLT_PORT:-7688}:7687" # bolt protocol
|
|
72
|
-
environment:
|
|
73
|
-
NEO4J_AUTH: ${NEO4J_AUTH:-neo4j/local-dev-pw}
|
|
74
|
-
NEO4J_PLUGINS: '["apoc"]'
|
|
75
|
-
NEO4J_dbms_memory_heap_max__size: 512m
|
|
76
|
-
volumes:
|
|
77
|
-
- pme-l3-data:/data
|
|
78
|
-
healthcheck:
|
|
79
|
-
test: ["CMD-SHELL", "wget -qO- http://localhost:7474 >/dev/null 2>&1 || exit 1"]
|
|
80
|
-
interval: 10s
|
|
81
|
-
timeout: 5s
|
|
82
|
-
retries: 30
|
|
83
|
-
start_period: 30s
|
|
84
|
-
|
|
85
|
-
# --------------------------------------------------------------------
|
|
86
|
-
# L5 — Qdrant comms layer
|
|
87
|
-
# --------------------------------------------------------------------
|
|
88
|
-
l5:
|
|
89
|
-
<<: *engine-base
|
|
90
|
-
build:
|
|
91
|
-
context: ./engine/services
|
|
92
|
-
dockerfile: l5/Dockerfile
|
|
93
|
-
container_name: pme-l5
|
|
94
|
-
# Default 18034 to avoid port collisions on 8034.
|
|
95
|
-
# Override via PME_L5_PORT for bench setups that intentionally replace it.
|
|
96
|
-
ports: ["127.0.0.1:${PME_L5_PORT:-18034}:8034"]
|
|
97
|
-
environment:
|
|
98
|
-
L5_NV_EMBED_URL: ${NV_EMBED_URL:-http://host.docker.internal:8041/v1/embeddings}
|
|
99
|
-
L5_EMBED_MODEL: ${EMBED_MODEL_NAME:-nv-embed-v2}
|
|
100
|
-
L5_EMBED_API_KEY: ${EMBED_API_KEY:-}
|
|
101
|
-
L5_EMBED_PROVIDER: ${EMBED_PROVIDER:-openai}
|
|
102
|
-
L5_EMBED_AUTODETECT: ${EMBED_AUTODETECT:-true}
|
|
103
|
-
L5_EMBED_DIM: ${EMBED_DIM:-4096}
|
|
104
|
-
L5_OLLAMA_DIM: ${OLLAMA_DIM:-768}
|
|
105
|
-
L5_OLLAMA_EMBED_URL: ${L5_OLLAMA_EMBED_URL:-http://host.docker.internal:11434/api/embed}
|
|
106
|
-
L5_OLLAMA_EMBED_MODEL: ${L5_OLLAMA_EMBED_MODEL:-nomic-embed-text}
|
|
107
|
-
L5_DB_PATH: /data/comms.db
|
|
108
|
-
PME_WORKSPACE: /data/workspace
|
|
109
|
-
extra_hosts:
|
|
110
|
-
- "host.docker.internal:host-gateway"
|
|
111
|
-
volumes:
|
|
112
|
-
- pme-l5-data:/data
|
|
113
|
-
|
|
114
|
-
# --------------------------------------------------------------------
|
|
115
|
-
# L6 — Document store + cross-encoder reranker
|
|
116
|
-
# --------------------------------------------------------------------
|
|
117
|
-
l6:
|
|
118
|
-
<<: *engine-base
|
|
119
|
-
build:
|
|
120
|
-
context: ./engine/services
|
|
121
|
-
dockerfile: l6/Dockerfile
|
|
122
|
-
container_name: pme-l6
|
|
123
|
-
# Default 18037 to avoid colliding with Spark Core L6 doc-store on 8037.
|
|
124
|
-
# Override via PME_L6_PORT for bench setups that intentionally replace it.
|
|
125
|
-
ports: ["127.0.0.1:${PME_L6_PORT:-18037}:8037"]
|
|
126
|
-
environment:
|
|
127
|
-
L6_NV_EMBED_URL: ${NV_EMBED_URL:-http://host.docker.internal:8041/v1/embeddings}
|
|
128
|
-
L6_EMBED_MODEL: ${EMBED_MODEL_NAME:-nv-embed-v2}
|
|
129
|
-
L6_EMBED_API_KEY: ${EMBED_API_KEY:-}
|
|
130
|
-
L6_EMBED_PROVIDER: ${EMBED_PROVIDER:-openai}
|
|
131
|
-
L6_EMBED_AUTODETECT: ${EMBED_AUTODETECT:-true}
|
|
132
|
-
L6_EMBED_DIM: ${EMBED_DIM:-4096}
|
|
133
|
-
L6_DATA_DIR: /data
|
|
134
|
-
extra_hosts:
|
|
135
|
-
- "host.docker.internal:host-gateway"
|
|
136
|
-
volumes:
|
|
137
|
-
- pme-l6-data:/data
|
|
138
|
-
|
|
139
|
-
# --------------------------------------------------------------------
|
|
140
|
-
# L2 — HybridRAG orchestrator (RRF fusion across all layers)
|
|
141
|
-
# --------------------------------------------------------------------
|
|
142
|
-
l2:
|
|
143
|
-
<<: *engine-base
|
|
144
|
-
build:
|
|
145
|
-
context: ./engine/services
|
|
146
|
-
dockerfile: l2/Dockerfile
|
|
147
|
-
container_name: pme-l2
|
|
148
|
-
ports: ["127.0.0.1:${PME_L2_PORT:-8131}:8031"]
|
|
149
|
-
environment:
|
|
150
|
-
PME_NV_EMBED_URL: ${NV_EMBED_URL:-http://host.docker.internal:8041/v1/embeddings}
|
|
151
|
-
PME_EMBED_API_KEY: ${EMBED_API_KEY:-}
|
|
152
|
-
PME_EMBED_PROVIDER: ${EMBED_PROVIDER:-openai}
|
|
153
|
-
PME_EMBED_AUTODETECT: ${EMBED_AUTODETECT:-true}
|
|
154
|
-
PME_NV_EMBED_MODEL: ${EMBED_MODEL_NAME:-nv-embed-v2}
|
|
155
|
-
PME_NEO4J_URI: bolt://l3:7687
|
|
156
|
-
PME_NEO4J_PASSWORD: ${NEO4J_PASSWORD:-local-dev-pw}
|
|
157
|
-
NEO4J_PASSWORD: ${NEO4J_PASSWORD:-local-dev-pw}
|
|
158
|
-
PME_L5_URL: http://l5:8034
|
|
159
|
-
PME_L6_URL: http://l6:8037
|
|
160
|
-
# HyDE off (deliberate — hurts precision on retrieval-graded benches)
|
|
161
|
-
PME_HYDE_ENABLED: "false"
|
|
162
|
-
# Cross-encoder reranker on (boosts top-K precision)
|
|
163
|
-
PME_RERANK_ENABLED: "true"
|
|
164
|
-
PME_WORKSPACE: /data/workspace
|
|
165
|
-
PME_QMD_DB: /data/qmd.sqlite
|
|
166
|
-
PME_MEMORY_DB: /data/workspace.db
|
|
167
|
-
extra_hosts:
|
|
168
|
-
- "host.docker.internal:host-gateway"
|
|
169
|
-
volumes:
|
|
170
|
-
- pme-l2-data:/data
|
|
171
|
-
depends_on:
|
|
172
|
-
l3: { condition: service_healthy }
|
|
173
|
-
l5: { condition: service_started }
|
|
174
|
-
l6: { condition: service_started }
|
|
175
|
-
|
|
176
|
-
# --------------------------------------------------------------------
|
|
177
|
-
# Compat shim — exposes pentatonic-memory v0.5 API on :8099
|
|
178
|
-
#
|
|
179
|
-
# Now routes /search through the L2 7-layer proxy by default. L6-only
|
|
180
|
-
# bypass (BYPASS_L2_PROXY=1) is still available for isolated testing.
|
|
181
|
-
# --------------------------------------------------------------------
|
|
182
|
-
compat:
|
|
183
|
-
<<: *engine-base
|
|
184
|
-
build:
|
|
185
|
-
# Build context is the memory-engine root so the Dockerfile can
|
|
186
|
-
# COPY both compat/server.py and engine/services/_shared (shared
|
|
187
|
-
# EmbedClient for /store-batch dedup).
|
|
188
|
-
context: .
|
|
189
|
-
dockerfile: compat/Dockerfile
|
|
190
|
-
container_name: pme-compat
|
|
191
|
-
ports:
|
|
192
|
-
- "127.0.0.1:${PME_PORT:-8099}:8099"
|
|
193
|
-
environment:
|
|
194
|
-
L0_URL: http://l2:8031
|
|
195
|
-
L2_PROXY_URL: http://l2:8031
|
|
196
|
-
L3_KG_URL: http://l3:7474
|
|
197
|
-
L5_MILVUS_URL: http://l5:8034
|
|
198
|
-
L6_DOC_URL: http://l6:8037
|
|
199
|
-
NV_EMBED_URL: ${NV_EMBED_URL:-http://host.docker.internal:8041/v1/embeddings}
|
|
200
|
-
# PME_ prefix vars feed the shim's EmbedClient for shared-embed
|
|
201
|
-
# mode on /store-batch (one embed call across all 3 indexers vs
|
|
202
|
-
# 3 redundant calls). Match the L2 config block so both clients
|
|
203
|
-
# hit the same gateway with the same model. Set
|
|
204
|
-
# PME_SHARE_EMBEDDINGS=false to revert to per-layer embedding.
|
|
205
|
-
PME_NV_EMBED_URL: ${NV_EMBED_URL:-http://host.docker.internal:8041/v1/embeddings}
|
|
206
|
-
PME_EMBED_API_KEY: ${EMBED_API_KEY:-}
|
|
207
|
-
PME_EMBED_PROVIDER: ${EMBED_PROVIDER:-openai}
|
|
208
|
-
PME_EMBED_AUTODETECT: ${EMBED_AUTODETECT:-true}
|
|
209
|
-
PME_NV_EMBED_MODEL: ${EMBED_MODEL_NAME:-nv-embed-v2}
|
|
210
|
-
PME_SHARE_EMBEDDINGS: ${PME_SHARE_EMBEDDINGS:-true}
|
|
211
|
-
BYPASS_L2_PROXY: ${BYPASS_L2_PROXY:-0}
|
|
212
|
-
extra_hosts:
|
|
213
|
-
- "host.docker.internal:host-gateway"
|
|
214
|
-
depends_on:
|
|
215
|
-
l2: { condition: service_started }
|
|
216
|
-
l5: { condition: service_started }
|
|
217
|
-
l6: { condition: service_started }
|
|
218
|
-
healthcheck:
|
|
219
|
-
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8099/health',timeout=3)"]
|
|
220
|
-
interval: 10s
|
|
221
|
-
timeout: 5s
|
|
222
|
-
retries: 30
|
|
223
|
-
# 180s gives L2 enough time to finish Neo4j schema + index creation
|
|
224
|
-
# on a cold start before compat's healthcheck starts counting failures.
|
|
225
|
-
# Observed concretely on the v0.9.4 deploy (2026-05-14): L2 took
|
|
226
|
-
# ~90s to warm up; with start_period: 60s, compat went unhealthy
|
|
227
|
-
# mid-startup, cloudflared's `depends_on: condition: service_healthy`
|
|
228
|
-
# failed, and `docker compose up` errored out before wait_for_health
|
|
229
|
-
# could observe the eventual recovery.
|
|
230
|
-
start_period: 180s
|
|
231
|
-
|
|
232
|
-
networks:
|
|
233
|
-
engine-net:
|
|
234
|
-
|
|
235
|
-
volumes:
|
|
236
|
-
pme-nv-embed-cache:
|
|
237
|
-
pme-l2-data:
|
|
238
|
-
pme-l3-data:
|
|
239
|
-
pme-l5-data:
|
|
240
|
-
pme-l6-data:
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# engine/
|
|
2
|
-
|
|
3
|
-
Bundled engine layers for the Pentatonic Memory Engine.
|
|
4
|
-
|
|
5
|
-
| File | Layer | LOC | Purpose |
|
|
6
|
-
|---|---|---|---|
|
|
7
|
-
| `l2-hybridrag-proxy.py` | L2 | ~1.5k | RRF fusion across all layers, exposed on `:8031` |
|
|
8
|
-
| `l5-comms-layer.py` | L5 | ~0.7k | Milvus comms layer for chat/email/contact/memory collections, exposed on `:8034` |
|
|
9
|
-
| `l6-document-store.py` | L6 | ~1.5k | Document store + cross-encoder reranker, exposed on `:8037` |
|
|
10
|
-
| `services/nv-embed/server.py` | — | ~150 | NV-Embed-v2 4096-dim embedding service, exposed on `:8041` |
|
|
11
|
-
|
|
12
|
-
## pme_memory SDK
|
|
13
|
-
|
|
14
|
-
The `pme_memory/` package at the repo root is an installable Python SDK for the L5 communications layer. It provides:
|
|
15
|
-
|
|
16
|
-
- **store.py** — Milvus client and collection management (chats, emails, contacts, memory)
|
|
17
|
-
- **search.py** — Semantic search across collections
|
|
18
|
-
- **embed.py** — Dual-stack embedding (NV-Embed-v2 primary, Ollama fallback)
|
|
19
|
-
- **indexer.py** — Data ingestion pipeline (JSONL chats, email archives, contacts, memory files)
|
|
20
|
-
- **scoring.py** — Pressure scoring for need signals (recency, novelty, centrality, priority)
|
|
21
|
-
- **synthesis.py** — Deterministic multi-parent artifact merge
|
|
22
|
-
- **artifacts.py** — Append-only artifact DAG store (JSONL)
|
|
23
|
-
- **hygiene.py** — DAG maintenance (dedup, conflict detection, orphan pruning)
|
|
24
|
-
- **health.py** — L5 health check
|
|
25
|
-
- **needs.py** — Need signal indexing
|
|
26
|
-
- **provenance.py** — Lineage visualization
|
|
27
|
-
|
|
28
|
-
Install: `pip install -e ".[full]"` — CLI: `pme-memory health|stats|index|search|serve`
|
|
29
|
-
|
|
30
|
-
## KG Extraction Scripts
|
|
31
|
-
|
|
32
|
-
The `scripts/` directory contains Knowledge Graph population tools:
|
|
33
|
-
|
|
34
|
-
- **kg-extractor.py** — spaCy + regex entity/relationship extraction from memory files → Neo4j
|
|
35
|
-
- **kg-preflexor-v2.py** — 2-pass concurrent LLM-based extraction via Ollama (14 structured entity types + native graph discovery)
|
|
36
|
-
|
|
37
|
-
## Where L0, L3 and the embedding service live
|
|
38
|
-
|
|
39
|
-
- **L0 BM25** — provided by SQLite FTS5; the L2 proxy queries it directly via `sqlite3`. No separate service binary.
|
|
40
|
-
- **L3 Knowledge Graph** — provided by Neo4j Community (free, OSS) running in a sibling container. The proxy queries it via the bolt protocol on `:7687`.
|
|
41
|
-
- **NV-Embed-v2 embedding service** — see `services/nv-embed/` for the Docker context. Exposes the OpenAI-compatible `/v1/embeddings` endpoint on `:8041`.
|
|
42
|
-
|
|
43
|
-
## Dependencies
|
|
44
|
-
|
|
45
|
-
Each service has its own `requirements.txt` in `services/<layer>/`. Common heavy deps:
|
|
46
|
-
|
|
47
|
-
- `pymilvus>=2.6.12` (L5)
|
|
48
|
-
- `sentence-transformers` (L6 reranker, NV-Embed)
|
|
49
|
-
- `httpx`, `fastapi`, `uvicorn` (all)
|
|
50
|
-
- `spacy` (L6 entity extraction)
|
|
51
|
-
|
|
52
|
-
NV-Embed needs Torch + the model weights (auto-downloaded on first run from Hugging Face).
|