vesper-memory 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/.env.example +28 -0
- package/CHANGELOG.md +137 -0
- package/LICENSE +21 -0
- package/README.md +665 -0
- package/config/sqlite-schema.sql +413 -0
- package/dist/benchmark/index.d.ts +18 -0
- package/dist/benchmark/index.d.ts.map +1 -0
- package/dist/benchmark/index.js +19 -0
- package/dist/benchmark/index.js.map +1 -0
- package/dist/benchmark/metrics-collector.d.ts +90 -0
- package/dist/benchmark/metrics-collector.d.ts.map +1 -0
- package/dist/benchmark/metrics-collector.js +196 -0
- package/dist/benchmark/metrics-collector.js.map +1 -0
- package/dist/benchmark/report-generator.d.ts +35 -0
- package/dist/benchmark/report-generator.d.ts.map +1 -0
- package/dist/benchmark/report-generator.js +221 -0
- package/dist/benchmark/report-generator.js.map +1 -0
- package/dist/benchmark/runner.d.ts +30 -0
- package/dist/benchmark/runner.d.ts.map +1 -0
- package/dist/benchmark/runner.js +308 -0
- package/dist/benchmark/runner.js.map +1 -0
- package/dist/benchmark/scenarios/context-recall.d.ts +65 -0
- package/dist/benchmark/scenarios/context-recall.d.ts.map +1 -0
- package/dist/benchmark/scenarios/context-recall.js +180 -0
- package/dist/benchmark/scenarios/context-recall.js.map +1 -0
- package/dist/benchmark/scenarios/index.d.ts +34 -0
- package/dist/benchmark/scenarios/index.d.ts.map +1 -0
- package/dist/benchmark/scenarios/index.js +230 -0
- package/dist/benchmark/scenarios/index.js.map +1 -0
- package/dist/benchmark/statistics.d.ts +125 -0
- package/dist/benchmark/statistics.d.ts.map +1 -0
- package/dist/benchmark/statistics.js +520 -0
- package/dist/benchmark/statistics.js.map +1 -0
- package/dist/benchmark/types.d.ts +458 -0
- package/dist/benchmark/types.d.ts.map +1 -0
- package/dist/benchmark/types.js +297 -0
- package/dist/benchmark/types.js.map +1 -0
- package/dist/cli 2.js +583 -0
- package/dist/cli.d 2.ts +8 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts 2.map +1 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +583 -0
- package/dist/cli.js 2.map +1 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/rate-limits.d.ts +76 -0
- package/dist/config/rate-limits.d.ts.map +1 -0
- package/dist/config/rate-limits.js +161 -0
- package/dist/config/rate-limits.js.map +1 -0
- package/dist/config 2/rate-limits.d.ts +76 -0
- package/dist/config 2/rate-limits.d.ts.map +1 -0
- package/dist/config 2/rate-limits.js +161 -0
- package/dist/config 2/rate-limits.js.map +1 -0
- package/dist/consolidation/pipeline.d.ts +52 -0
- package/dist/consolidation/pipeline.d.ts.map +1 -0
- package/dist/consolidation/pipeline.js +193 -0
- package/dist/consolidation/pipeline.js.map +1 -0
- package/dist/consolidation 2/pipeline.d.ts +52 -0
- package/dist/consolidation 2/pipeline.d.ts.map +1 -0
- package/dist/consolidation 2/pipeline.js +193 -0
- package/dist/consolidation 2/pipeline.js.map +1 -0
- package/dist/embeddings/client.d.ts +95 -0
- package/dist/embeddings/client.d.ts.map +1 -0
- package/dist/embeddings/client.js +162 -0
- package/dist/embeddings/client.js.map +1 -0
- package/dist/embeddings 2/client.d.ts +94 -0
- package/dist/embeddings 2/client.d.ts.map +1 -0
- package/dist/embeddings 2/client.js +144 -0
- package/dist/embeddings 2/client.js.map +1 -0
- package/dist/memory-layers/semantic-memory.d.ts +76 -0
- package/dist/memory-layers/semantic-memory.d.ts.map +1 -0
- package/dist/memory-layers/semantic-memory.js +231 -0
- package/dist/memory-layers/semantic-memory.js.map +1 -0
- package/dist/memory-layers/skill-library.d.ts +25 -0
- package/dist/memory-layers/skill-library.d.ts.map +1 -0
- package/dist/memory-layers/skill-library.js +54 -0
- package/dist/memory-layers/skill-library.js.map +1 -0
- package/dist/memory-layers/working-memory.d.ts +57 -0
- package/dist/memory-layers/working-memory.d.ts.map +1 -0
- package/dist/memory-layers/working-memory.js +153 -0
- package/dist/memory-layers/working-memory.js.map +1 -0
- package/dist/memory-layers 2/semantic-memory.d.ts +33 -0
- package/dist/memory-layers 2/semantic-memory.d.ts.map +1 -0
- package/dist/memory-layers 2/semantic-memory.js +114 -0
- package/dist/memory-layers 2/semantic-memory.js.map +1 -0
- package/dist/memory-layers 2/skill-library.d.ts +25 -0
- package/dist/memory-layers 2/skill-library.d.ts.map +1 -0
- package/dist/memory-layers 2/skill-library.js +54 -0
- package/dist/memory-layers 2/skill-library.js.map +1 -0
- package/dist/memory-layers 2/working-memory.d.ts +57 -0
- package/dist/memory-layers 2/working-memory.d.ts.map +1 -0
- package/dist/memory-layers 2/working-memory.js +153 -0
- package/dist/memory-layers 2/working-memory.js.map +1 -0
- package/dist/middleware/auth.d.ts +287 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/middleware/auth.js +610 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware 2/auth.d.ts +287 -0
- package/dist/middleware 2/auth.d.ts.map +1 -0
- package/dist/middleware 2/auth.js +610 -0
- package/dist/middleware 2/auth.js.map +1 -0
- package/dist/monitoring/health.d.ts +241 -0
- package/dist/monitoring/health.d.ts.map +1 -0
- package/dist/monitoring/health.js +649 -0
- package/dist/monitoring/health.js.map +1 -0
- package/dist/monitoring/metrics.d.ts +153 -0
- package/dist/monitoring/metrics.d.ts.map +1 -0
- package/dist/monitoring/metrics.js +349 -0
- package/dist/monitoring/metrics.js.map +1 -0
- package/dist/monitoring 2/health.d.ts +241 -0
- package/dist/monitoring 2/health.d.ts.map +1 -0
- package/dist/monitoring 2/health.js +649 -0
- package/dist/monitoring 2/health.js.map +1 -0
- package/dist/monitoring 2/metrics.d.ts +153 -0
- package/dist/monitoring 2/metrics.d.ts.map +1 -0
- package/dist/monitoring 2/metrics.js +349 -0
- package/dist/monitoring 2/metrics.js.map +1 -0
- package/dist/retrieval/hybrid-search.d.ts +186 -0
- package/dist/retrieval/hybrid-search.d.ts.map +1 -0
- package/dist/retrieval/hybrid-search.js +330 -0
- package/dist/retrieval/hybrid-search.js.map +1 -0
- package/dist/retrieval 2/hybrid-search.d.ts +186 -0
- package/dist/retrieval 2/hybrid-search.d.ts.map +1 -0
- package/dist/retrieval 2/hybrid-search.js +327 -0
- package/dist/retrieval 2/hybrid-search.js.map +1 -0
- package/dist/router/smart-router.d.ts +157 -0
- package/dist/router/smart-router.d.ts.map +1 -0
- package/dist/router/smart-router.js +524 -0
- package/dist/router/smart-router.js.map +1 -0
- package/dist/router 2/smart-router.d.ts +111 -0
- package/dist/router 2/smart-router.d.ts.map +1 -0
- package/dist/router 2/smart-router.js +383 -0
- package/dist/router 2/smart-router.js.map +1 -0
- package/dist/security/rate-limit-middleware.d.ts +119 -0
- package/dist/security/rate-limit-middleware.d.ts.map +1 -0
- package/dist/security/rate-limit-middleware.js +193 -0
- package/dist/security/rate-limit-middleware.js.map +1 -0
- package/dist/security 2/rate-limit-middleware.d.ts +119 -0
- package/dist/security 2/rate-limit-middleware.d.ts.map +1 -0
- package/dist/security 2/rate-limit-middleware.js +193 -0
- package/dist/security 2/rate-limit-middleware.js.map +1 -0
- package/dist/server 2.js +861 -0
- package/dist/server-wrapper 2.js +170 -0
- package/dist/server-wrapper.d 2.ts +12 -0
- package/dist/server-wrapper.d.ts +12 -0
- package/dist/server-wrapper.d.ts 2.map +1 -0
- package/dist/server-wrapper.d.ts.map +1 -0
- package/dist/server-wrapper.js +170 -0
- package/dist/server-wrapper.js 2.map +1 -0
- package/dist/server-wrapper.js.map +1 -0
- package/dist/server.d 2.ts +14 -0
- package/dist/server.d.ts +14 -0
- package/dist/server.d.ts 2.map +1 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +656 -0
- package/dist/server.js 2.map +1 -0
- package/dist/server.js.map +1 -0
- package/dist/synthesis/conflict-detector.d.ts +43 -0
- package/dist/synthesis/conflict-detector.d.ts.map +1 -0
- package/dist/synthesis/conflict-detector.js +125 -0
- package/dist/synthesis/conflict-detector.js.map +1 -0
- package/dist/synthesis 2/conflict-detector.d.ts +43 -0
- package/dist/synthesis 2/conflict-detector.d.ts.map +1 -0
- package/dist/synthesis 2/conflict-detector.js +125 -0
- package/dist/synthesis 2/conflict-detector.js.map +1 -0
- package/dist/utils/monitoring.d.ts +25 -0
- package/dist/utils/monitoring.d.ts.map +1 -0
- package/dist/utils/monitoring.js +41 -0
- package/dist/utils/monitoring.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +97 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +166 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/validation.d.ts +139 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +195 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils 2/monitoring.d.ts +25 -0
- package/dist/utils 2/monitoring.d.ts.map +1 -0
- package/dist/utils 2/monitoring.js +41 -0
- package/dist/utils 2/monitoring.js.map +1 -0
- package/dist/utils 2/rate-limiter.d.ts +97 -0
- package/dist/utils 2/rate-limiter.d.ts.map +1 -0
- package/dist/utils 2/rate-limiter.js +166 -0
- package/dist/utils 2/rate-limiter.js.map +1 -0
- package/dist/utils 2/validation.d.ts +139 -0
- package/dist/utils 2/validation.d.ts.map +1 -0
- package/dist/utils 2/validation.js +195 -0
- package/dist/utils 2/validation.js.map +1 -0
- package/docker-compose.yml +65 -0
- package/embedding-service/Dockerfile +29 -0
- package/embedding-service/README.md +68 -0
- package/embedding-service/requirements.txt +6 -0
- package/embedding-service/server.py +110 -0
- package/package.json +92 -0
- package/scripts/FRESH_INSTALL.md +280 -0
- package/scripts/README.md +101 -0
- package/scripts/ensure-infrastructure.sh +38 -0
- package/scripts/fresh-install-auto.sh +96 -0
- package/scripts/fresh-install.sh +167 -0
- package/scripts/health-check.sh +72 -0
- package/scripts/init-qdrant.ts +201 -0
- package/scripts/postinstall.js +94 -0
- package/scripts/run-accuracy-benchmark.ts +1237 -0
- package/scripts/run-real-benchmark.ts +581 -0
- package/scripts/test-mcp-server.sh +38 -0
package/.env.example
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Vesper Configuration
|
|
2
|
+
# For local/personal use, these defaults work out of the box!
|
|
3
|
+
|
|
4
|
+
# Redis (Working Memory Cache)
|
|
5
|
+
REDIS_HOST=localhost
|
|
6
|
+
REDIS_PORT=6379
|
|
7
|
+
|
|
8
|
+
# Qdrant (Vector Database)
|
|
9
|
+
QDRANT_URL=http://localhost:6333
|
|
10
|
+
|
|
11
|
+
# SQLite (Knowledge Graph)
|
|
12
|
+
SQLITE_DB=./data/memory.db
|
|
13
|
+
|
|
14
|
+
# Embedding Service (BGE-large)
|
|
15
|
+
EMBEDDING_SERVICE_URL=http://localhost:8000
|
|
16
|
+
|
|
17
|
+
# Application
|
|
18
|
+
NODE_ENV=development
|
|
19
|
+
LOG_LEVEL=info
|
|
20
|
+
|
|
21
|
+
# =============================================================================
|
|
22
|
+
# Quick Start
|
|
23
|
+
# =============================================================================
|
|
24
|
+
# 1. Copy this file: cp .env.example .env
|
|
25
|
+
# 2. Start services: docker-compose up -d
|
|
26
|
+
# 3. That's it! No passwords or API keys required for local use.
|
|
27
|
+
#
|
|
28
|
+
# The system will automatically create the data/ directory for SQLite.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
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.3.0] - 2026-02-02
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
**Performance Optimizations**
|
|
13
|
+
- Preference query handler with direct SQLite lookup (31% faster: 204ms → 142ms)
|
|
14
|
+
- Temporal decay weighting for preference ranking
|
|
15
|
+
- LRU embedding cache (1000 entries, 1hr TTL) eliminates redundant HTTP calls
|
|
16
|
+
- Working memory integration in smart router for fast-path retrieval
|
|
17
|
+
- Optimized SQL index for preference queries
|
|
18
|
+
|
|
19
|
+
**Multi-hop Reasoning**
|
|
20
|
+
- `personalizedPageRankWithFacts()` method for knowledge graph traversal
|
|
21
|
+
- Fact retrieval along traversal paths for multi-hop query answering
|
|
22
|
+
- Chain tracking with intermediary entities for explainability
|
|
23
|
+
- Path information showing relationship types between entities
|
|
24
|
+
- Support for inferring A→C connections via A→B→C chains
|
|
25
|
+
|
|
26
|
+
**Testing & Validation**
|
|
27
|
+
- 6 new preference handler tests (edge cases, performance, scaling)
|
|
28
|
+
- 8 new multi-hop fact chaining tests
|
|
29
|
+
- All 529 tests passing (100% pass rate)
|
|
30
|
+
|
|
31
|
+
### Performance
|
|
32
|
+
|
|
33
|
+
- Preference queries: -31% latency (204.4ms → 141.8ms)
|
|
34
|
+
- Multi-hop queries: -11% latency (173.4ms → 154.2ms)
|
|
35
|
+
- Overall accuracy: 98.5% F1 score
|
|
36
|
+
- P50 latency: 4.4ms (target: <30ms) ✅
|
|
37
|
+
- P95 latency: 5.3ms (target: <200ms) ✅
|
|
38
|
+
|
|
39
|
+
## [0.2.0] - 2026-02-02
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
**Scientific Benchmarking System**
|
|
44
|
+
- Accuracy-focused benchmark measuring answer quality (not just latency)
|
|
45
|
+
- Real-world benchmark with A/B testing methodology
|
|
46
|
+
- Statistical validation (Welch's t-test, Cohen's d effect size)
|
|
47
|
+
- 5 test categories: Factual, Preference, Temporal, Multi-hop, Contradiction
|
|
48
|
+
- Automated report generation with detailed metrics
|
|
49
|
+
|
|
50
|
+
**Documentation**
|
|
51
|
+
- Reorganized README with performance section before origin story
|
|
52
|
+
- Updated benchmark results with clean database runs
|
|
53
|
+
- Fixed accuracy claims and routing strategy documentation
|
|
54
|
+
- Corrected latency measurements and improvement calculations
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- Database contamination in benchmarks (now cleared between runs)
|
|
59
|
+
- Semantic versioning (0.1.1 → 0.2.0 for features)
|
|
60
|
+
- README inaccuracies in tech stack descriptions
|
|
61
|
+
|
|
62
|
+
## [0.1.0] - 2026-02-01
|
|
63
|
+
|
|
64
|
+
### Added
|
|
65
|
+
|
|
66
|
+
**Core Memory System**
|
|
67
|
+
- Three-layer memory architecture (Working, Semantic, Procedural)
|
|
68
|
+
- BGE-large embeddings (1024-dimensional vectors)
|
|
69
|
+
- Hybrid semantic search with RRF fusion
|
|
70
|
+
- Smart query routing with 6 query types
|
|
71
|
+
- Conflict detection (temporal, contradiction, preference)
|
|
72
|
+
- Nightly consolidation pipeline
|
|
73
|
+
|
|
74
|
+
**Production Features**
|
|
75
|
+
- HTTPS/TLS encryption with nginx
|
|
76
|
+
- API key authentication with bcrypt hashing
|
|
77
|
+
- Tier-based rate limiting (standard/premium/unlimited)
|
|
78
|
+
- Comprehensive Prometheus metrics (13 metric types)
|
|
79
|
+
- Grafana dashboards (16 panels)
|
|
80
|
+
- AlertManager integration (PagerDuty, Slack, Email)
|
|
81
|
+
- Certificate expiration monitoring
|
|
82
|
+
|
|
83
|
+
**Infrastructure**
|
|
84
|
+
- Docker Compose orchestration (13 services)
|
|
85
|
+
- Redis for working memory (<5ms latency)
|
|
86
|
+
- Qdrant for vector storage
|
|
87
|
+
- PostgreSQL for auth and metadata
|
|
88
|
+
- SQLite for knowledge graphs
|
|
89
|
+
- Python embedding service (BGE-large-en-v1.5)
|
|
90
|
+
|
|
91
|
+
**Developer Experience**
|
|
92
|
+
- Automatic MCP configuration on install
|
|
93
|
+
- CLI tools (install, configure, status, uninstall)
|
|
94
|
+
- Health checks and service validation
|
|
95
|
+
- Session startup hooks
|
|
96
|
+
- Comprehensive error handling
|
|
97
|
+
|
|
98
|
+
**Security & Compliance**
|
|
99
|
+
- OWASP Top 10 compliance
|
|
100
|
+
- Fail-closed rate limiting
|
|
101
|
+
- Audit logging for all auth attempts
|
|
102
|
+
- Secure credential storage
|
|
103
|
+
- Input validation with Zod v4
|
|
104
|
+
- No CRITICAL/HIGH vulnerabilities
|
|
105
|
+
|
|
106
|
+
**Testing & Quality**
|
|
107
|
+
- 171 tests (100% pass rate)
|
|
108
|
+
- Integration tests for all features
|
|
109
|
+
- Performance validation (<200ms P95)
|
|
110
|
+
- Security audit completed
|
|
111
|
+
- TypeScript strict mode
|
|
112
|
+
|
|
113
|
+
**Documentation**
|
|
114
|
+
- Complete README with deployment guide
|
|
115
|
+
- API documentation
|
|
116
|
+
- Security audit report
|
|
117
|
+
- Production readiness checklist
|
|
118
|
+
- Troubleshooting guide
|
|
119
|
+
|
|
120
|
+
### Performance
|
|
121
|
+
|
|
122
|
+
- P50 latency: 12ms (target: <30ms) ✅
|
|
123
|
+
- P95 latency: 165ms (target: <200ms) ✅
|
|
124
|
+
- P99 latency: 280ms (target: <500ms) ✅
|
|
125
|
+
- Working memory hit: ~5ms
|
|
126
|
+
- Semantic search: ~150ms
|
|
127
|
+
- Total security overhead: ~15ms
|
|
128
|
+
|
|
129
|
+
### Cost Efficiency
|
|
130
|
+
|
|
131
|
+
- Infrastructure: $49-73/month
|
|
132
|
+
- Per user: $0.49-0.73/month (100 users)
|
|
133
|
+
- 97% cost reduction vs. target
|
|
134
|
+
|
|
135
|
+
[0.3.0]: https://github.com/fitz2882/vesper/releases/tag/v0.3.0
|
|
136
|
+
[0.2.0]: https://github.com/fitz2882/vesper/releases/tag/v0.2.0
|
|
137
|
+
[0.1.0]: https://github.com/fitz2882/vesper/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 David Fitzsimmons and Vesper Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|