zaxy-memory 0.1.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.
- zaxy_memory-0.1.0/.gitignore +88 -0
- zaxy_memory-0.1.0/AGENTS.md +332 -0
- zaxy_memory-0.1.0/Dockerfile +53 -0
- zaxy_memory-0.1.0/PKG-INFO +235 -0
- zaxy_memory-0.1.0/README.md +182 -0
- zaxy_memory-0.1.0/docker-compose.prod.yml +95 -0
- zaxy_memory-0.1.0/docker-compose.yml +110 -0
- zaxy_memory-0.1.0/docs/agent-events.md +270 -0
- zaxy_memory-0.1.0/docs/api.md +270 -0
- zaxy_memory-0.1.0/docs/architecture.md +56 -0
- zaxy_memory-0.1.0/docs/benchmark-review.md +277 -0
- zaxy_memory-0.1.0/docs/codebase.md +99 -0
- zaxy_memory-0.1.0/docs/competitive-positioning.md +49 -0
- zaxy_memory-0.1.0/docs/configuration.md +87 -0
- zaxy_memory-0.1.0/docs/consolidation.md +196 -0
- zaxy_memory-0.1.0/docs/deployment.md +57 -0
- zaxy_memory-0.1.0/docs/embeddings.md +57 -0
- zaxy_memory-0.1.0/docs/eventloom.md +108 -0
- zaxy_memory-0.1.0/docs/getting-started.md +199 -0
- zaxy_memory-0.1.0/docs/graph-schema.md +65 -0
- zaxy_memory-0.1.0/docs/hooks.md +192 -0
- zaxy_memory-0.1.0/docs/integrations.md +108 -0
- zaxy_memory-0.1.0/docs/mcp-install-targets.md +96 -0
- zaxy_memory-0.1.0/docs/mcp.md +235 -0
- zaxy_memory-0.1.0/docs/operations.md +61 -0
- zaxy_memory-0.1.0/docs/packet-analyzer.md +109 -0
- zaxy_memory-0.1.0/docs/retrieval.md +153 -0
- zaxy_memory-0.1.0/docs/runbook.md +529 -0
- zaxy_memory-0.1.0/docs/security.md +85 -0
- zaxy_memory-0.1.0/docs/superpowers/plans/2026-05-08-codebase-file-map.md +116 -0
- zaxy_memory-0.1.0/docs/superpowers/plans/2026-05-08-domain-separated-defaults.md +56 -0
- zaxy_memory-0.1.0/docs/superpowers/plans/2026-05-08-local-first-retrieval.md +140 -0
- zaxy_memory-0.1.0/docs/superpowers/plans/2026-05-08-remote-mcp-rate-limit-audit.md +115 -0
- zaxy_memory-0.1.0/docs/superpowers/plans/2026-05-09-agent-integration-templates.md +60 -0
- zaxy_memory-0.1.0/docs/superpowers/plans/2026-05-09-retention-metadata-extraction.md +53 -0
- zaxy_memory-0.1.0/docs/superpowers/plans/2026-05-09-retrieval-feedback-events.md +47 -0
- zaxy_memory-0.1.0/docs/superpowers/plans/2026-05-10-merge-sprint.md +188 -0
- zaxy_memory-0.1.0/docs/superpowers/specs/2026-05-08-codebase-file-map-design.md +52 -0
- zaxy_memory-0.1.0/docs/superpowers/specs/2026-05-08-domain-separated-defaults-design.md +28 -0
- zaxy_memory-0.1.0/docs/superpowers/specs/2026-05-08-local-first-retrieval-design.md +40 -0
- zaxy_memory-0.1.0/docs/superpowers/specs/2026-05-08-remote-mcp-rate-limit-audit-design.md +46 -0
- zaxy_memory-0.1.0/docs/testing.md +163 -0
- zaxy_memory-0.1.0/docs/workspace-genesis.md +36 -0
- zaxy_memory-0.1.0/examples/langgraph_memory.py +80 -0
- zaxy_memory-0.1.0/pyproject.toml +163 -0
- zaxy_memory-0.1.0/scripts/backup.sh +86 -0
- zaxy_memory-0.1.0/scripts/build-dist.sh +55 -0
- zaxy_memory-0.1.0/scripts/generate-certs.sh +58 -0
- zaxy_memory-0.1.0/scripts/integration-check.sh +147 -0
- zaxy_memory-0.1.0/scripts/live-benchmark.sh +136 -0
- zaxy_memory-0.1.0/scripts/mcp_smoke_test.py +118 -0
- zaxy_memory-0.1.0/scripts/release-check.sh +79 -0
- zaxy_memory-0.1.0/scripts/restore.sh +89 -0
- zaxy_memory-0.1.0/scripts/rotate-logs.sh +91 -0
- zaxy_memory-0.1.0/scripts/setup.sh +147 -0
- zaxy_memory-0.1.0/scripts/setup_neo4j_indexes.cypher +55 -0
- zaxy_memory-0.1.0/scripts/validate-deployment.sh +134 -0
- zaxy_memory-0.1.0/scripts/validate-docs.sh +135 -0
- zaxy_memory-0.1.0/site/assets/graph.png +0 -0
- zaxy_memory-0.1.0/site/index.html +231 -0
- zaxy_memory-0.1.0/site/style.css +337 -0
- zaxy_memory-0.1.0/src/zaxy/__init__.py +34 -0
- zaxy_memory-0.1.0/src/zaxy/__main__.py +1563 -0
- zaxy_memory-0.1.0/src/zaxy/adapters/__init__.py +8 -0
- zaxy_memory-0.1.0/src/zaxy/adapters/langgraph.py +211 -0
- zaxy_memory-0.1.0/src/zaxy/benchmark.py +248 -0
- zaxy_memory-0.1.0/src/zaxy/capabilities.py +160 -0
- zaxy_memory-0.1.0/src/zaxy/codebase.py +1142 -0
- zaxy_memory-0.1.0/src/zaxy/compaction.py +468 -0
- zaxy_memory-0.1.0/src/zaxy/config.py +400 -0
- zaxy_memory-0.1.0/src/zaxy/context.py +143 -0
- zaxy_memory-0.1.0/src/zaxy/core.py +1274 -0
- zaxy_memory-0.1.0/src/zaxy/doctor.py +463 -0
- zaxy_memory-0.1.0/src/zaxy/documents.py +76 -0
- zaxy_memory-0.1.0/src/zaxy/domain.py +24 -0
- zaxy_memory-0.1.0/src/zaxy/embedding.py +205 -0
- zaxy_memory-0.1.0/src/zaxy/event.py +291 -0
- zaxy_memory-0.1.0/src/zaxy/extract.py +1370 -0
- zaxy_memory-0.1.0/src/zaxy/extract_templates.py +96 -0
- zaxy_memory-0.1.0/src/zaxy/graph.py +723 -0
- zaxy_memory-0.1.0/src/zaxy/hooks.py +457 -0
- zaxy_memory-0.1.0/src/zaxy/install.py +17 -0
- zaxy_memory-0.1.0/src/zaxy/integrations.py +514 -0
- zaxy_memory-0.1.0/src/zaxy/lifecycle.py +159 -0
- zaxy_memory-0.1.0/src/zaxy/live_benchmark.py +1692 -0
- zaxy_memory-0.1.0/src/zaxy/local_profile.py +69 -0
- zaxy_memory-0.1.0/src/zaxy/log.py +56 -0
- zaxy_memory-0.1.0/src/zaxy/mcp_server.py +1636 -0
- zaxy_memory-0.1.0/src/zaxy/memory_status.py +274 -0
- zaxy_memory-0.1.0/src/zaxy/metrics.py +110 -0
- zaxy_memory-0.1.0/src/zaxy/observation.py +131 -0
- zaxy_memory-0.1.0/src/zaxy/onboarding.py +431 -0
- zaxy_memory-0.1.0/src/zaxy/packet_analyzer.py +345 -0
- zaxy_memory-0.1.0/src/zaxy/packet_guidance.py +59 -0
- zaxy_memory-0.1.0/src/zaxy/packet_projection.py +312 -0
- zaxy_memory-0.1.0/src/zaxy/py.typed +1 -0
- zaxy_memory-0.1.0/src/zaxy/query.py +1000 -0
- zaxy_memory-0.1.0/src/zaxy/refs.py +123 -0
- zaxy_memory-0.1.0/src/zaxy/remote_security.py +98 -0
- zaxy_memory-0.1.0/src/zaxy/runtime.py +180 -0
- zaxy_memory-0.1.0/src/zaxy/schema.py +150 -0
- zaxy_memory-0.1.0/src/zaxy/security.py +158 -0
- zaxy_memory-0.1.0/src/zaxy/session.py +68 -0
- zaxy_memory-0.1.0/src/zaxy/trace.py +133 -0
- zaxy_memory-0.1.0/src/zaxy/transcripts.py +40 -0
- zaxy_memory-0.1.0/src/zaxy/verbatim.py +256 -0
- zaxy_memory-0.1.0/src/zaxy/viewer.py +362 -0
- zaxy_memory-0.1.0/src/zaxy/working_set.py +162 -0
- zaxy_memory-0.1.0/src/zaxy/workspace.py +264 -0
- zaxy_memory-0.1.0/tests/conftest.py +42 -0
- zaxy_memory-0.1.0/tests/test_benchmarks.py +175 -0
- zaxy_memory-0.1.0/tests/test_capabilities.py +54 -0
- zaxy_memory-0.1.0/tests/test_cli.py +1904 -0
- zaxy_memory-0.1.0/tests/test_codebase.py +579 -0
- zaxy_memory-0.1.0/tests/test_compaction.py +267 -0
- zaxy_memory-0.1.0/tests/test_competitive_benchmarks.py +128 -0
- zaxy_memory-0.1.0/tests/test_compose.py +74 -0
- zaxy_memory-0.1.0/tests/test_config.py +264 -0
- zaxy_memory-0.1.0/tests/test_context.py +80 -0
- zaxy_memory-0.1.0/tests/test_core.py +1482 -0
- zaxy_memory-0.1.0/tests/test_docs_site.py +187 -0
- zaxy_memory-0.1.0/tests/test_doctor.py +309 -0
- zaxy_memory-0.1.0/tests/test_documents.py +41 -0
- zaxy_memory-0.1.0/tests/test_domain.py +22 -0
- zaxy_memory-0.1.0/tests/test_embedding.py +362 -0
- zaxy_memory-0.1.0/tests/test_event.py +426 -0
- zaxy_memory-0.1.0/tests/test_extract.py +1117 -0
- zaxy_memory-0.1.0/tests/test_extract_templates.py +63 -0
- zaxy_memory-0.1.0/tests/test_graph.py +772 -0
- zaxy_memory-0.1.0/tests/test_install.py +26 -0
- zaxy_memory-0.1.0/tests/test_integration_check_script.py +61 -0
- zaxy_memory-0.1.0/tests/test_integrations.py +381 -0
- zaxy_memory-0.1.0/tests/test_langgraph_adapter.py +154 -0
- zaxy_memory-0.1.0/tests/test_lifecycle.py +143 -0
- zaxy_memory-0.1.0/tests/test_live_benchmark.py +634 -0
- zaxy_memory-0.1.0/tests/test_local_profile.py +44 -0
- zaxy_memory-0.1.0/tests/test_mcp.py +1389 -0
- zaxy_memory-0.1.0/tests/test_memory_status.py +186 -0
- zaxy_memory-0.1.0/tests/test_metrics.py +168 -0
- zaxy_memory-0.1.0/tests/test_observation.py +109 -0
- zaxy_memory-0.1.0/tests/test_onboarding.py +372 -0
- zaxy_memory-0.1.0/tests/test_ops_scripts.py +500 -0
- zaxy_memory-0.1.0/tests/test_packaging.py +179 -0
- zaxy_memory-0.1.0/tests/test_packet_analyzer.py +164 -0
- zaxy_memory-0.1.0/tests/test_packet_memory_e2e.py +96 -0
- zaxy_memory-0.1.0/tests/test_packet_projection.py +212 -0
- zaxy_memory-0.1.0/tests/test_query.py +1146 -0
- zaxy_memory-0.1.0/tests/test_refs.py +50 -0
- zaxy_memory-0.1.0/tests/test_remote_security.py +89 -0
- zaxy_memory-0.1.0/tests/test_runtime.py +157 -0
- zaxy_memory-0.1.0/tests/test_schema_migrations.py +106 -0
- zaxy_memory-0.1.0/tests/test_security.py +94 -0
- zaxy_memory-0.1.0/tests/test_session.py +132 -0
- zaxy_memory-0.1.0/tests/test_setup_script.py +48 -0
- zaxy_memory-0.1.0/tests/test_statistical_benchmark.py +100 -0
- zaxy_memory-0.1.0/tests/test_trace.py +254 -0
- zaxy_memory-0.1.0/tests/test_transcripts.py +40 -0
- zaxy_memory-0.1.0/tests/test_verbatim.py +139 -0
- zaxy_memory-0.1.0/tests/test_viewer.py +100 -0
- zaxy_memory-0.1.0/tests/test_working_set.py +154 -0
- zaxy_memory-0.1.0/tests/test_workspace.py +153 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
*.manifest
|
|
30
|
+
*.spec
|
|
31
|
+
|
|
32
|
+
# Installer logs
|
|
33
|
+
pip-log.txt
|
|
34
|
+
pip-delete-this-directory.txt
|
|
35
|
+
|
|
36
|
+
# Unit test / coverage reports
|
|
37
|
+
htmlcov/
|
|
38
|
+
.tox/
|
|
39
|
+
.nox/
|
|
40
|
+
.coverage
|
|
41
|
+
.coverage.*
|
|
42
|
+
.cache
|
|
43
|
+
nosetests.xml
|
|
44
|
+
coverage.xml
|
|
45
|
+
*.cover
|
|
46
|
+
*.py,cover
|
|
47
|
+
.hypothesis/
|
|
48
|
+
.pytest_cache/
|
|
49
|
+
cover/
|
|
50
|
+
|
|
51
|
+
# Type checking
|
|
52
|
+
.mypy_cache/
|
|
53
|
+
.dmypy.json
|
|
54
|
+
dmypy.json
|
|
55
|
+
|
|
56
|
+
# Ruff
|
|
57
|
+
.ruff_cache/
|
|
58
|
+
|
|
59
|
+
# Environments
|
|
60
|
+
.env
|
|
61
|
+
.venv
|
|
62
|
+
env/
|
|
63
|
+
venv/
|
|
64
|
+
ENV/
|
|
65
|
+
env.bak/
|
|
66
|
+
venv.bak/
|
|
67
|
+
|
|
68
|
+
# IDE
|
|
69
|
+
.vscode/
|
|
70
|
+
.idea/
|
|
71
|
+
.claude/settings.local.json
|
|
72
|
+
*.swp
|
|
73
|
+
*.kate-swp
|
|
74
|
+
*.swo
|
|
75
|
+
*~
|
|
76
|
+
|
|
77
|
+
# Eventloom data (runtime)
|
|
78
|
+
.eventloom/
|
|
79
|
+
|
|
80
|
+
# Local production secret files generated by scripts/setup.sh --production
|
|
81
|
+
secrets/
|
|
82
|
+
|
|
83
|
+
# Local TLS material generated by scripts/generate-certs.sh
|
|
84
|
+
.certs/
|
|
85
|
+
|
|
86
|
+
# Neo4j runtime data (if running locally without Docker)
|
|
87
|
+
neo4j_data/
|
|
88
|
+
neo4j_logs/
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
# Zaxy: Event-Sourced Temporal Knowledge Graph Fabric
|
|
2
|
+
|
|
3
|
+
## Problem Statement
|
|
4
|
+
|
|
5
|
+
Markdown files + vector DBs are the dominant approach for agent persistent context, but they are fundamentally lossy and inefficient:
|
|
6
|
+
|
|
7
|
+
- **No relational reasoning**: Vector similarity can't do multi-hop traversal or follow causal chains.
|
|
8
|
+
- **No temporal awareness**: Can't answer "What was true then vs. now?" — facts overwrite each other silently.
|
|
9
|
+
- **Non-replayable**: Context is chunked and flattened; you can't reconstruct how the agent arrived at a decision.
|
|
10
|
+
- **Un-auditable**: No provenance chain for compliance or debugging.
|
|
11
|
+
|
|
12
|
+
## Architecture Decision Record
|
|
13
|
+
|
|
14
|
+
### ADR-1: Event-Sourced Foundation
|
|
15
|
+
|
|
16
|
+
**Decision**: Use Eventloom's append-only JSONL as the immutable source of truth.
|
|
17
|
+
|
|
18
|
+
**Rationale**:
|
|
19
|
+
- Hash-chain integrity (tamper-evident).
|
|
20
|
+
- Deterministic replay.
|
|
21
|
+
- Zero write overhead (local file append).
|
|
22
|
+
- Cross-process locking already solved.
|
|
23
|
+
|
|
24
|
+
**Trade-off**: Single-writer per file. For multi-agent distributed setups, shard by session or add a log aggregation layer later.
|
|
25
|
+
|
|
26
|
+
### ADR-2: Hybrid Extraction (Rule-Based + LLM Fallback)
|
|
27
|
+
|
|
28
|
+
**Decision**: Extract entities/relations from events using registered rule-based extractors first, LLM fallback only for unstructured events.
|
|
29
|
+
|
|
30
|
+
**Rationale**:
|
|
31
|
+
- Eventloom events are strongly typed (`goal.created`, `task.proposed`, etc.).
|
|
32
|
+
- Typed events map deterministically to graph schema.
|
|
33
|
+
- Reduces LLM extraction cost by 60–80%.
|
|
34
|
+
- Faster ingestion (<50ms vs 500ms–2s for LLM).
|
|
35
|
+
|
|
36
|
+
**Trade-off**: New event types require writing an extractor. This is intentional — it forces schema discipline.
|
|
37
|
+
|
|
38
|
+
### ADR-3: Direct Neo4j Cypher vs. Graphiti Abstraction
|
|
39
|
+
|
|
40
|
+
**Decision**: Use the official `neo4j` Python driver with custom Cypher rather than Graphiti's high-level `add_episode` API.
|
|
41
|
+
|
|
42
|
+
**Rationale**:
|
|
43
|
+
- Full control over bi-temporal schema (`valid_from`, `valid_to`).
|
|
44
|
+
- Our extraction engine already produces structured `ExtractedEntity`/`ExtractedEdge` objects.
|
|
45
|
+
- Graphiti's LLM-based extraction is redundant with our hybrid extractor.
|
|
46
|
+
- Graphiti's hybrid search (vector + BM25 + traversal) can be replicated with native Neo4j indexes.
|
|
47
|
+
|
|
48
|
+
**Trade-off**: We maintain more Cypher. Mitigated by keeping queries simple and tested.
|
|
49
|
+
|
|
50
|
+
### ADR-4: Hybrid Retrieval (Exact + Keyword + Traversal)
|
|
51
|
+
|
|
52
|
+
**Decision**: Query router fuses three strategies with configurable weights.
|
|
53
|
+
|
|
54
|
+
**Rationale**:
|
|
55
|
+
- **Exact**: Fast lookup when the query is an entity name.
|
|
56
|
+
- **Keyword/BM25**: Full-text for semantic similarity on names/summaries.
|
|
57
|
+
- **Traversal**: Multi-hop expansion from top keyword hits.
|
|
58
|
+
- Each covers blind spots of the others.
|
|
59
|
+
|
|
60
|
+
**Trade-off**: Fusion adds ~10–50ms latency. Acceptable for agent context quality.
|
|
61
|
+
|
|
62
|
+
### ADR-5: Pathlight for Observability (Not Storage)
|
|
63
|
+
|
|
64
|
+
**Decision**: Pathlight can trace every memory operation when enabled, but does not store context itself.
|
|
65
|
+
|
|
66
|
+
**Rationale**:
|
|
67
|
+
- Eventloom = durable history.
|
|
68
|
+
- Neo4j = structured reasoning layer.
|
|
69
|
+
- Pathlight = execution tracing + breakpoints + diff.
|
|
70
|
+
- Clean separation of concerns.
|
|
71
|
+
|
|
72
|
+
**Trade-off**: Extra network call per traced operation. Mitigated by async batching and optional disabling.
|
|
73
|
+
|
|
74
|
+
### ADR-6: MCP as Primary Interface
|
|
75
|
+
|
|
76
|
+
**Decision**: Expose memory via MCP tools (`memory_append`, `memory_query`, `memory_replay`, `memory_invalidate`).
|
|
77
|
+
|
|
78
|
+
**Rationale**:
|
|
79
|
+
- Framework-agnostic (LangGraph, CrewAI, AutoGen, Claude Desktop, etc.).
|
|
80
|
+
- Standardized schema discovery and type safety.
|
|
81
|
+
- One-click integration via `mcpServers` config.
|
|
82
|
+
|
|
83
|
+
**Trade-off**: Requires MCP client support. Major frameworks already have it (2025+).
|
|
84
|
+
|
|
85
|
+
## Tech Stack
|
|
86
|
+
|
|
87
|
+
| Layer | Technology | Version |
|
|
88
|
+
|-------|-----------|---------|
|
|
89
|
+
| Language | Python | 3.11+ |
|
|
90
|
+
| Graph DB | Neo4j Community | 5.26+ |
|
|
91
|
+
| Graph Driver | neo4j (official) | 5.20+ |
|
|
92
|
+
| Validation | Pydantic | 2.7+ |
|
|
93
|
+
| MCP Server | mcp (official Python SDK) | 1.0+ |
|
|
94
|
+
| Observability | pathlight (Python SDK) | 0.1+ |
|
|
95
|
+
| CLI | typer | 0.12+ |
|
|
96
|
+
| Testing | pytest + pytest-asyncio + pytest-cov | 8.0+ |
|
|
97
|
+
| Lint/Format | ruff | 0.4+ |
|
|
98
|
+
| Types | mypy | 1.10+ |
|
|
99
|
+
|
|
100
|
+
## Directory Structure
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
zaxy/
|
|
104
|
+
├── pyproject.toml # Project config, deps, tool settings
|
|
105
|
+
├── docker-compose.yml # Neo4j + test services
|
|
106
|
+
├── AGENTS.md # This file
|
|
107
|
+
├── src/zaxy/
|
|
108
|
+
│ ├── __init__.py # Public API exports
|
|
109
|
+
│ ├── __main__.py # CLI entrypoint (`python -m zaxy`)
|
|
110
|
+
│ ├── core.py # MemoryFabric orchestrator
|
|
111
|
+
│ ├── event.py # Eventloom JSONL I/O + hash chain
|
|
112
|
+
│ ├── extract.py # Hybrid extraction engine + registry
|
|
113
|
+
│ ├── graph.py # Neo4j bi-temporal wrapper
|
|
114
|
+
│ ├── query.py # Hybrid retrieval router
|
|
115
|
+
│ ├── mcp_server.py # MCP stdio/sse server
|
|
116
|
+
│ └── trace.py # Pathlight observability hooks
|
|
117
|
+
├── tests/
|
|
118
|
+
│ ├── conftest.py # Shared fixtures
|
|
119
|
+
│ ├── test_event.py # Event log I/O + integrity
|
|
120
|
+
│ ├── test_extract.py # Rule-based extractors
|
|
121
|
+
│ ├── test_graph.py # Neo4j operations (mock + integration)
|
|
122
|
+
│ ├── test_query.py # Query routing + fusion
|
|
123
|
+
│ ├── test_mcp.py # MCP protocol compliance
|
|
124
|
+
│ └── test_trace.py # Pathlight span emission
|
|
125
|
+
├── examples/
|
|
126
|
+
│ └── langgraph_memory.py # Full LangGraph integration demo
|
|
127
|
+
└── scripts/
|
|
128
|
+
└── setup_neo4j_indexes.cypher # Manual index setup
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Development Workflow
|
|
132
|
+
|
|
133
|
+
1. **Write the test first** (Karpathy rule). Every public function must have a test before the implementation is considered complete.
|
|
134
|
+
2. **Unit tests mock external deps** (Neo4j, Pathlight, filesystem).
|
|
135
|
+
3. **Integration tests use Docker** (marked `@pytest.mark.integration`).
|
|
136
|
+
4. **Coverage gate: ≥90%** (enforced by CI).
|
|
137
|
+
5. **Lint/format with ruff**, type-check with mypy.
|
|
138
|
+
|
|
139
|
+
## Testing Strategy
|
|
140
|
+
|
|
141
|
+
| Test Type | Scope | External Deps | Marker |
|
|
142
|
+
|-----------|-------|---------------|--------|
|
|
143
|
+
| Unit | Single function/class | Mocked | `unit` (default) |
|
|
144
|
+
| Integration | Cross-module + real DB | Neo4j Docker | `integration` |
|
|
145
|
+
| E2E | Full agent run | Full Docker stack | `e2e` (future) |
|
|
146
|
+
|
|
147
|
+
Run unit tests: `pytest`
|
|
148
|
+
Run integration tests: `pytest -m integration`
|
|
149
|
+
Run with coverage: `pytest --cov` (default in pyproject.toml)
|
|
150
|
+
|
|
151
|
+
## Integration Points
|
|
152
|
+
|
|
153
|
+
### Eventloom (Bottom Layer)
|
|
154
|
+
- **Input**: Zaxy reads `.eventloom/*.jsonl` files.
|
|
155
|
+
- **Output**: Zaxy appends projection metadata back to Eventloom (optional).
|
|
156
|
+
- **Contract**: `Event` Pydantic model matches Eventloom JSONL schema.
|
|
157
|
+
|
|
158
|
+
### Neo4j (Core Memory)
|
|
159
|
+
- **Bolt URI**: `bolt://localhost:7687`
|
|
160
|
+
- **Auth**: `neo4j/testpassword` (local dev)
|
|
161
|
+
- **Schema**: `Entity(name, entity_type, valid_from, valid_to, ...)` + `RELATES(relation_type, valid_from, valid_to)`
|
|
162
|
+
- **Indexes**: Vector index (embedding), Fulltext index (BM25)
|
|
163
|
+
|
|
164
|
+
### Pathlight (Top Layer)
|
|
165
|
+
- **Collector**: `http://localhost:4100`
|
|
166
|
+
- **Dashboard**: `http://localhost:3100`
|
|
167
|
+
- **Traced Operations**: `append`, `query`, `replay`, `invalidate`
|
|
168
|
+
- **Eventloom Panel**: Pathlight renders Eventloom exports natively.
|
|
169
|
+
|
|
170
|
+
### MCP (Interface Layer)
|
|
171
|
+
- **Transport**: stdio (default) or SSE
|
|
172
|
+
- **Tools**:
|
|
173
|
+
- `memory_append(event_type, actor, payload, thread?)`
|
|
174
|
+
- `memory_query(query, temporal_filter?, limit?)`
|
|
175
|
+
- `memory_replay(session_id, from_seq?)`
|
|
176
|
+
- `memory_invalidate(entity_name, entity_type, invalid_at)`
|
|
177
|
+
|
|
178
|
+
## Performance Targets
|
|
179
|
+
|
|
180
|
+
| Metric | Target | Notes |
|
|
181
|
+
|--------|--------|-------|
|
|
182
|
+
| Event append | <50ms | Local JSONL write + lock |
|
|
183
|
+
| Rule-based extraction | <10ms | Pure Python dict mapping |
|
|
184
|
+
| Neo4j upsert | <100ms | MERGE + index lookup |
|
|
185
|
+
| Hybrid query | <200ms | Parallel exact + keyword + traversal |
|
|
186
|
+
| Total context retrieval | <300ms | End-to-end |
|
|
187
|
+
| Token reduction vs. chunk RAG | 70–90% | Structured paths vs. raw text |
|
|
188
|
+
|
|
189
|
+
## Current Status
|
|
190
|
+
|
|
191
|
+
- [x] Project scaffold (pyproject.toml, docker-compose.yml)
|
|
192
|
+
- [x] Eventloom JSONL I/O with hash-chain integrity
|
|
193
|
+
- [x] Hybrid extraction engine with rule registry
|
|
194
|
+
- [x] Neo4j graph store (schema, upsert, retrieval, invalidation)
|
|
195
|
+
- [x] Hybrid query router (exact + keyword + traversal)
|
|
196
|
+
- [x] Pathlight tracing integration
|
|
197
|
+
- [x] MCP server implementation
|
|
198
|
+
- [x] `MemoryFabric` orchestrator wiring
|
|
199
|
+
- [x] CLI entrypoint (`zaxy serve`, `zaxy replay`, `zaxy compact`)
|
|
200
|
+
- [x] LangGraph adapter example
|
|
201
|
+
- [x] CI/CD (GitHub Actions)
|
|
202
|
+
- [x] Operational runbooks
|
|
203
|
+
- [x] Configuration management (pydantic-settings, env vars)
|
|
204
|
+
- [x] Docker containerization (Dockerfile + compose + SSE production command)
|
|
205
|
+
- [x] Structured logging (console + JSON)
|
|
206
|
+
- [x] Graceful shutdown (SIGTERM/SIGINT handling)
|
|
207
|
+
- [x] Production secrets management (Docker secrets + `*_FILE` config)
|
|
208
|
+
- [x] TLS for Neo4j (generated certs + TLS compose service + integration test)
|
|
209
|
+
- [x] Multi-agent session sharding (SessionManager + MemoryFabric/MCP wiring + graph session isolation)
|
|
210
|
+
- [x] Prometheus metrics
|
|
211
|
+
- [x] Vector index and vector similarity search in query router
|
|
212
|
+
- [x] SSE transport for MCP daemon mode
|
|
213
|
+
- [x] Embedding generation pipeline (deterministic local provider + entity/query vectors)
|
|
214
|
+
- [x] True temporal versioning for reasserted facts and multi-version entity state
|
|
215
|
+
- [x] Remote MCP security (SSE bearer auth + per-client session scopes)
|
|
216
|
+
- [x] Operational backup/restore/log-rotation scripts backed by tests
|
|
217
|
+
- [x] Competitive benchmark suite vs. flat JSONL context baseline
|
|
218
|
+
- [x] Hosted embedding provider adapter with secret-managed credentials
|
|
219
|
+
- [x] Remote deployment environment validation for MCP/SSE
|
|
220
|
+
- [x] Go-live readiness checklist and release gate
|
|
221
|
+
- [x] Release packaging and versioned distribution artifacts
|
|
222
|
+
- [x] Public static site and expanded documentation set
|
|
223
|
+
- [x] Eventloom provenance citations on graph-backed retrieval results
|
|
224
|
+
- [x] Append-time secret redaction and payload classification
|
|
225
|
+
- [x] MMR diversity and explainable score metadata in query router
|
|
226
|
+
- [x] Filesystem document ingestion with source path and line citations
|
|
227
|
+
- [x] Sanitized transcript ingestion and replay-to-context assembly API
|
|
228
|
+
- [x] Query expansion and temporal-aware retrieval scoring policies
|
|
229
|
+
- [x] Configurable scoring profiles and local lexical reranker provider
|
|
230
|
+
- [x] Hosted OpenAI-compatible and local HTTP reranker providers
|
|
231
|
+
- [x] Graceful degradation for graph, embedding, vector, and reranker outages
|
|
232
|
+
- [x] Context lifecycle hooks for after-turn assembly, handoff bundles, and subagent cleanup
|
|
233
|
+
- [x] OIDC/JWKS remote MCP authentication for public multi-tenant deployments
|
|
234
|
+
- [x] Degraded-mode Prometheus metrics and alerting guidance
|
|
235
|
+
- [x] Extractor authoring templates and auditable schema migration tooling
|
|
236
|
+
- [x] Frozen benchmark workload fingerprints and external comparison disclosures
|
|
237
|
+
- [x] Representative benchmark suite for temporal, document, transcript, and mixed workloads
|
|
238
|
+
- [x] Geometry-aware consolidation roadmap for identity-preserving compaction
|
|
239
|
+
- [x] Consolidation-collapse benchmark lane and identity-recall metric
|
|
240
|
+
- [x] `zaxy compact --audit` safety checks for integrity, identity recall, and citations
|
|
241
|
+
- [x] Medoid/exemplar projection storage with Eventloom and source backpointers
|
|
242
|
+
- [x] Context assembly warnings for unsupported compacted/projection context
|
|
243
|
+
- [x] Projection artifact retrieval as cited local routing candidates
|
|
244
|
+
- [x] Okapi BM25 baseline in the live benchmark harness
|
|
245
|
+
- [x] Automatic compaction projection discovery under Eventloom directories
|
|
246
|
+
- [x] First-run MCP client config and framework handoff adapter helpers
|
|
247
|
+
- [x] Local-first embedding/reranker setup helpers
|
|
248
|
+
- [x] Extractor schema-pack examples for common agent event taxonomies
|
|
249
|
+
- [x] Remote MCP rate limiting and audit event export
|
|
250
|
+
- [x] Domain-separated MCP defaults to avoid cross-project `default` session bleed
|
|
251
|
+
- [x] File-level codebase mapping as Eventloom-backed graph projection
|
|
252
|
+
- [x] Symbol-level codebase mapping for functions, classes, types, and imports
|
|
253
|
+
- [x] Local code dependency mapping from resolved imports to source files
|
|
254
|
+
- [x] Python call-site mapping with resolved symbol call edges
|
|
255
|
+
- [x] Static Python test coverage links from tests to imported production symbols
|
|
256
|
+
- [x] JavaScript and TypeScript call-site mapping for same-file and imported local symbols
|
|
257
|
+
- [x] Go, Rust, and Java same-file call-site mapping
|
|
258
|
+
- [x] Go cross-file call resolution for local package-qualified imports
|
|
259
|
+
- [x] Rust cross-file call resolution for simple `use crate::module::symbol` imports
|
|
260
|
+
- [x] Java cross-file call resolution for imported local classes
|
|
261
|
+
- [x] Workspace genesis entry process with profile discovery and write instructions
|
|
262
|
+
- [x] Workspace instruction bootstrap and drift events for agent guidance files
|
|
263
|
+
- [x] Initial lifecycle hook taxonomy for tool calls, command results, and file edits
|
|
264
|
+
- [x] Automatic redacted MCP tool-call lifecycle capture
|
|
265
|
+
- [x] Lifecycle capture for compaction, subagent completion, and session end
|
|
266
|
+
- [x] Minimal static Eventloom/session viewer for bootstrap and lifecycle inspection
|
|
267
|
+
- [x] Local onboarding doctor for Eventloom, MCP defaults, viewer, local profile, and config posture
|
|
268
|
+
- [x] Non-destructive temporal retention and decay-aware retrieval policies
|
|
269
|
+
- [x] Direct agent integration templates for LangGraph, CrewAI, and AutoGen
|
|
270
|
+
- [x] Retention metadata extraction and reinforcement events for decay-aware retrieval
|
|
271
|
+
- [x] Retrieval feedback events that reinforce used context
|
|
272
|
+
- [x] MCP tool support for retrieval feedback events
|
|
273
|
+
- [x] Observer hook config and lightweight hook-event capture
|
|
274
|
+
- [x] Hook protocol documentation and doctor onboarding guidance
|
|
275
|
+
- [x] Safe hook config write mode with no-overwrite default
|
|
276
|
+
- [x] Searchable hook checkpoint events with summary and reason metadata
|
|
277
|
+
- [x] Hook installation detection and supported-client matrix
|
|
278
|
+
- [x] Pruned stale direct-Neo4j demo scripts superseded by doctor, hooks, and MCP smoke coverage
|
|
279
|
+
- [x] Hook status and heartbeat health checks for observable lifecycle capture
|
|
280
|
+
- [x] Unified `zaxy init` onboarding orchestrator for MCP config, local profile, hooks, genesis, heartbeat, doctor, and hook status
|
|
281
|
+
- [x] Explicit `zaxy init --infra check|start` local Neo4j bootstrap actions
|
|
282
|
+
- [x] Structured onboarding next steps in text and JSON output
|
|
283
|
+
- [x] Pre-MCP CLI install guidance and resolved executable paths in generated MCP config
|
|
284
|
+
- [x] Installed `zaxy` console-script preference for generated MCP executable paths
|
|
285
|
+
- [x] `zaxy init --preset local-claude` shortcut for the explicit local onboarding path
|
|
286
|
+
- [x] MCP client install target verification matrix for Claude Code, Cursor, VS Code, and Codex
|
|
287
|
+
- [x] Safe project-local MCP config write-and-merge helpers for Claude Code, Cursor, and VS Code
|
|
288
|
+
- [x] Codex MCP install command rendering via `codex mcp add`
|
|
289
|
+
- [x] Explicit Codex TOML merge support for user and trusted-project config scopes
|
|
290
|
+
- [x] Claude Code local hook merge and parsed install detection coverage
|
|
291
|
+
- [x] Focused full-suite integration check helper that starts, requires, or skips Neo4j test services explicitly
|
|
292
|
+
- [x] Optional framework extras and install hints for LangGraph, CrewAI, and AutoGen
|
|
293
|
+
- [x] Framework integration support registry with maturity and native-adapter status discovery
|
|
294
|
+
- [x] LongMemEval public-memory benchmark workload for MemPalace-comparable identity recall
|
|
295
|
+
- [x] BM25 lexical fusion for Zaxy LongMemEval benchmark retrieval
|
|
296
|
+
- [x] First-class verbatim Eventloom retrieval with MCP and MemoryFabric access
|
|
297
|
+
- [x] Source-aware context assembly with reserved verbatim Eventloom retrieval lane
|
|
298
|
+
- [x] Configurable and observable context assembly source-recall policy
|
|
299
|
+
- [x] Read-only `zaxy memory status` for Eventloom session integrity and latest hashes
|
|
300
|
+
- [x] Read-only `zaxy memory log` for recent Eventloom events with JSON output
|
|
301
|
+
- [x] Read-only `zaxy memory diff` for Eventloom sequence ranges
|
|
302
|
+
- [x] Hash-linked Eventloom provenance path projected into Neo4j with `NEXT_EVENT`/`PREVIOUS_EVENT`
|
|
303
|
+
- [x] Eventloom-vs-Neo4j graph projection integrity status with lag and chain-link checks
|
|
304
|
+
- [x] Intelligent active memory working-set projection in context assembly
|
|
305
|
+
- [x] First-class Memory Checkout contract for current cited prompt state
|
|
306
|
+
- [x] Eventloom-backed memory refs and checkout-by-ref support
|
|
307
|
+
- [x] Normalized command and file-edit observation capture for hooks
|
|
308
|
+
- [x] Hook and doctor observation coverage reporting for automatic capture gaps
|
|
309
|
+
- [x] Hook-event sinks for tool-call and transcript-turn automatic capture
|
|
310
|
+
- [x] Native-preview LangGraph adapter for context projection, observations, and retrieval feedback
|
|
311
|
+
- [x] Codex in-session `/resume` duplicate MCP process troubleshooting guidance
|
|
312
|
+
- [x] Competitive positioning roadmap against MemPalace-style memory systems
|
|
313
|
+
- [x] LongMemEval workload chunking for hosted embedding input limits
|
|
314
|
+
- [x] Persistent embedding cache and progress output for long-running live benchmarks
|
|
315
|
+
- [x] Local onboarding happy-path infrastructure profile for plain localhost Neo4j with cleared TLS/password-file overrides
|
|
316
|
+
- [x] Model-facing memory capability manifest with ambient checkout/capture/feedback loop guidance
|
|
317
|
+
- [x] Deterministic capture as default onboarding mode with optional packet/hybrid capture and local Codex preset
|
|
318
|
+
|
|
319
|
+
## Metrics
|
|
320
|
+
|
|
321
|
+
| Metric | Value |
|
|
322
|
+
|--------|-------|
|
|
323
|
+
| Tests | 586 passed |
|
|
324
|
+
| Coverage | 92.25% |
|
|
325
|
+
| Lint | ruff clean |
|
|
326
|
+
| Types | mypy clean |
|
|
327
|
+
| Python versions | 3.11, 3.12, 3.13 |
|
|
328
|
+
|
|
329
|
+
## Next Steps
|
|
330
|
+
|
|
331
|
+
1. Use LangGraph native-preview feedback to decide whether CrewAI should become the next maintained adapter.
|
|
332
|
+
2. Add reproducible MemPalace-comparable workloads for temporal, source-recall, graph-traversal, and context-collapse behavior.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Zaxy production Dockerfile
|
|
2
|
+
# Multi-stage build for minimal image size
|
|
3
|
+
|
|
4
|
+
FROM python:3.13-slim AS builder
|
|
5
|
+
|
|
6
|
+
WORKDIR /build
|
|
7
|
+
|
|
8
|
+
# Install build dependencies
|
|
9
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
10
|
+
gcc \
|
|
11
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
12
|
+
|
|
13
|
+
# Install Python dependencies and build the wheel from the package sources.
|
|
14
|
+
COPY pyproject.toml ./
|
|
15
|
+
COPY README.md ./
|
|
16
|
+
COPY src ./src
|
|
17
|
+
RUN pip install --no-cache-dir build && \
|
|
18
|
+
python -m build --wheel && \
|
|
19
|
+
pip install --no-cache-dir dist/*.whl
|
|
20
|
+
|
|
21
|
+
# ------------------------------------------------------------------
|
|
22
|
+
# Runtime stage
|
|
23
|
+
# ------------------------------------------------------------------
|
|
24
|
+
FROM python:3.13-slim
|
|
25
|
+
|
|
26
|
+
WORKDIR /app
|
|
27
|
+
|
|
28
|
+
# Create non-root user
|
|
29
|
+
RUN groupadd -r zaxy && useradd -r -g zaxy zaxy
|
|
30
|
+
|
|
31
|
+
# Install runtime dependencies
|
|
32
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
33
|
+
curl \
|
|
34
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
35
|
+
|
|
36
|
+
# Copy built wheel from builder
|
|
37
|
+
COPY --from=builder /build/dist/*.whl /tmp/
|
|
38
|
+
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl
|
|
39
|
+
|
|
40
|
+
# Create directories
|
|
41
|
+
RUN mkdir -p /app/.eventloom /app/.volumes && \
|
|
42
|
+
chown -R zaxy:zaxy /app
|
|
43
|
+
|
|
44
|
+
USER zaxy
|
|
45
|
+
|
|
46
|
+
# Health check
|
|
47
|
+
HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=3 \
|
|
48
|
+
CMD zaxy status || exit 1
|
|
49
|
+
|
|
50
|
+
EXPOSE 8080
|
|
51
|
+
|
|
52
|
+
ENTRYPOINT ["zaxy"]
|
|
53
|
+
CMD ["serve", "--transport", "sse", "--host", "0.0.0.0", "--port", "8080"]
|