vesper-memory 0.3.2 → 0.5.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.
Files changed (69) hide show
  1. package/.env.example +8 -4
  2. package/CHANGELOG.md +129 -3
  3. package/LICENSE +59 -0
  4. package/README.md +422 -24
  5. package/config/migrations/001_add_skill_summary.sql +75 -0
  6. package/config/migrations/001_rollback_skill_summary.sql +60 -0
  7. package/config/sqlite-schema.sql +68 -4
  8. package/dist/benchmark/types.d.ts +4 -4
  9. package/dist/cli.js +204 -10
  10. package/dist/cli.js.map +1 -1
  11. package/dist/consolidation/pipeline.d.ts +6 -1
  12. package/dist/consolidation/pipeline.d.ts.map +1 -1
  13. package/dist/consolidation/pipeline.js +53 -35
  14. package/dist/consolidation/pipeline.js.map +1 -1
  15. package/dist/memory-layers/semantic-memory.d.ts +9 -19
  16. package/dist/memory-layers/semantic-memory.d.ts.map +1 -1
  17. package/dist/memory-layers/semantic-memory.js +31 -54
  18. package/dist/memory-layers/semantic-memory.js.map +1 -1
  19. package/dist/memory-layers/skill-lazy-loading.d.ts +160 -0
  20. package/dist/memory-layers/skill-lazy-loading.d.ts.map +1 -0
  21. package/dist/memory-layers/skill-lazy-loading.js +247 -0
  22. package/dist/memory-layers/skill-lazy-loading.js.map +1 -0
  23. package/dist/memory-layers/skill-library.d.ts +133 -4
  24. package/dist/memory-layers/skill-library.d.ts.map +1 -1
  25. package/dist/memory-layers/skill-library.js +427 -8
  26. package/dist/memory-layers/skill-library.js.map +1 -1
  27. package/dist/memory-layers/working-memory.d.ts +35 -14
  28. package/dist/memory-layers/working-memory.d.ts.map +1 -1
  29. package/dist/memory-layers/working-memory.js +114 -36
  30. package/dist/memory-layers/working-memory.js.map +1 -1
  31. package/dist/retrieval/hybrid-search.d.ts +2 -2
  32. package/dist/retrieval/hybrid-search.d.ts.map +1 -1
  33. package/dist/retrieval/hybrid-search.js +4 -3
  34. package/dist/retrieval/hybrid-search.js.map +1 -1
  35. package/dist/router/smart-router.d.ts +25 -0
  36. package/dist/router/smart-router.d.ts.map +1 -1
  37. package/dist/router/smart-router.js +90 -10
  38. package/dist/router/smart-router.js.map +1 -1
  39. package/dist/scheduler/consolidation-scheduler.d.ts +129 -0
  40. package/dist/scheduler/consolidation-scheduler.d.ts.map +1 -0
  41. package/dist/scheduler/consolidation-scheduler.js +179 -0
  42. package/dist/scheduler/consolidation-scheduler.js.map +1 -0
  43. package/dist/scheduler/index.d.ts +7 -0
  44. package/dist/scheduler/index.d.ts.map +1 -0
  45. package/dist/scheduler/index.js +7 -0
  46. package/dist/scheduler/index.js.map +1 -0
  47. package/dist/server-wrapper.js +0 -0
  48. package/dist/server.js +892 -30
  49. package/dist/server.js.map +1 -1
  50. package/dist/synthesis/conflict-detector.d.ts +4 -6
  51. package/dist/synthesis/conflict-detector.d.ts.map +1 -1
  52. package/dist/synthesis/conflict-detector.js +19 -21
  53. package/dist/synthesis/conflict-detector.js.map +1 -1
  54. package/dist/utils/paths.d.ts +72 -0
  55. package/dist/utils/paths.d.ts.map +1 -0
  56. package/dist/utils/paths.js +160 -0
  57. package/dist/utils/paths.js.map +1 -0
  58. package/dist/utils/validation.d.ts +123 -1
  59. package/dist/utils/validation.d.ts.map +1 -1
  60. package/dist/utils/validation.js +146 -7
  61. package/dist/utils/validation.js.map +1 -1
  62. package/docker-compose.yml +11 -13
  63. package/embedding-service/README.md +8 -0
  64. package/package.json +6 -3
  65. package/scripts/FRESH_INSTALL.md +1 -1
  66. package/scripts/ensure-infrastructure.sh +86 -15
  67. package/scripts/health-check.sh +2 -1
  68. package/scripts/stop-infrastructure.sh +23 -0
  69. package/scripts/test-mcp-server.sh +2 -1
package/.env.example CHANGED
@@ -9,7 +9,9 @@ REDIS_PORT=6379
9
9
  QDRANT_URL=http://localhost:6333
10
10
 
11
11
  # SQLite (Knowledge Graph)
12
- SQLITE_DB=./data/memory.db
12
+ # Default: ~/.vesper/data/memory.db (user-level storage)
13
+ # Override with absolute path if needed
14
+ # SQLITE_DB=~/.vesper/data/memory.db
13
15
 
14
16
  # Embedding Service (BGE-large)
15
17
  EMBEDDING_SERVICE_URL=http://localhost:8000
@@ -21,8 +23,10 @@ LOG_LEVEL=info
21
23
  # =============================================================================
22
24
  # Quick Start
23
25
  # =============================================================================
24
- # 1. Copy this file: cp .env.example .env
25
- # 2. Start services: docker-compose up -d
26
+ # 1. Install: npm install -g vesper-memory
27
+ # 2. Setup: vesper install
26
28
  # 3. That's it! No passwords or API keys required for local use.
27
29
  #
28
- # The system will automatically create the data/ directory for SQLite.
30
+ # Data is stored at ~/.vesper/ (user-level storage, persists across projects)
31
+ # - SQLite database: ~/.vesper/data/memory.db
32
+ # - Docker volumes: ~/.vesper/docker-data/
package/CHANGELOG.md CHANGED
@@ -5,6 +5,132 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.5.0] - 2026-02-06
9
+
10
+ ### Added
11
+
12
+ **Multi-Agent Namespace Isolation**
13
+ - All memory operations now support `namespace` parameter for multi-agent isolation
14
+ - Default namespace is `"default"` - fully backward compatible
15
+ - Namespace column added to: memories, entities, relationships, facts, conflicts, skills
16
+ - Redis keys prefixed with namespace: `{namespace}:working:{id}`
17
+ - Qdrant payload filtering by namespace
18
+
19
+ **Agent Attribution**
20
+ - `agent_id`, `agent_role`, `task_id` fields on stored memories
21
+ - Filter retrieval by agent_id, task_id, or exclude_agent
22
+ - Track which agent stored which memory
23
+
24
+ **Decision Memory Type**
25
+ - New `memory_type: "decision"` for architectural and project decisions
26
+ - Reduced temporal decay (decay_factor: 0.25) so decisions persist longer
27
+ - Supersedes mechanism: new decisions can mark old ones as superseded
28
+ - Automatic conflict detection against existing decisions
29
+
30
+ **4 New MCP Tools**
31
+ - `share_context`: Copy memories between namespaces with handoff tracking
32
+ - `store_decision`: Store decisions with reduced decay and conflict detection
33
+ - `list_namespaces`: Discover all namespaces with counts
34
+ - `namespace_stats`: Per-namespace breakdown of memories, entities, skills, agents
35
+
36
+ **Validation**
37
+ - Added `NamespaceSchema` (alphanumeric + hyphens/underscores)
38
+ - Extended memory_type enum to include `"decision"`
39
+ - All existing tool schemas updated with optional `namespace` parameter
40
+
41
+ **Tests**
42
+ - 112 new tests across 5 test files (namespace-isolation, agent-attribution, share-context, store-decision, namespace-tools)
43
+ - Total: 909 tests passing (up from 632)
44
+
45
+ ### Changed
46
+ - `SemanticMemoryLayer`: all methods accept `namespace` parameter
47
+ - `SkillLibrary` / `SkillLazyLoader`: namespace-scoped queries
48
+ - `ConflictDetector`: namespace-scoped detection
49
+ - `ConsolidationPipeline`: iterates all namespaces when none specified
50
+ - `SmartRouter`: `RoutingContext` includes optional `namespace`
51
+ - `HybridSearchEngine`: `filter` parameter for Qdrant namespace filtering
52
+ - `WorkingMemoryLayer`: Redis keys use `{namespace}:` prefix
53
+
54
+ ### Backward Compatibility
55
+ - All new columns use `DEFAULT 'default'` - existing data automatically works
56
+ - All new tool params are optional - existing tool calls unchanged
57
+ - Old Redis keys expire naturally via 7-day TTL
58
+ - Qdrant: falls back to unfiltered search for `"default"` namespace
59
+
60
+ ---
61
+
62
+ ## [0.4.0] - 2026-02-03
63
+
64
+ ### BREAKING CHANGES
65
+
66
+ **User-Level Storage Migration**
67
+ - All data now stored at `~/.vesper/` (user-level) instead of project directories
68
+ - SQLite database: `~/.vesper/data/memory.db` (was `./data/memory.db`)
69
+ - Docker volumes: `~/.vesper/docker-data/` (were named volumes `qdrant_storage`, `redis_storage`)
70
+ - Memories now persist across all projects
71
+
72
+ **Migration Required:**
73
+ ```bash
74
+ # Automatic migration from v0.3.x
75
+ vesper migrate
76
+
77
+ # Or manually:
78
+ mkdir -p ~/.vesper/data
79
+ cp ./data/memory.db ~/.vesper/data/memory.db
80
+ docker-compose down
81
+ docker-compose up -d
82
+ ```
83
+
84
+ ### Added
85
+
86
+ **CLI Enhancements**
87
+ - `vesper migrate` command for automatic data migration from v0.3.x
88
+ - User-level directory structure creation with secure permissions (0o700)
89
+ - `VESPER_HOME` environment variable for custom storage location
90
+ - Improved `vesper status` showing data directory and database size
91
+ - Detection of old data needing migration
92
+
93
+ **Path Utilities**
94
+ - Cross-platform path resolution module (`src/utils/paths.ts`)
95
+ - `getVesperHome()` - Resolves `~/.vesper` with platform-specific home directory
96
+ - `getSqlitePath()` - Returns user-level SQLite database path
97
+ - `ensureDirectories()` - Creates all required directories with proper permissions
98
+ - Tilde expansion support in environment variables
99
+
100
+ **Security Improvements**
101
+ - Path traversal warnings for system directories
102
+ - Restrictive directory permissions (owner-only: 0o700)
103
+ - Fixed command injection vulnerability in CLI uninstall
104
+ - Secrets excluded from version control (.claude/settings.local.json)
105
+
106
+ **Testing**
107
+ - 62 new tests for path utilities, CLI migration, and Docker config
108
+ - Total: 632 tests passing (up from 570)
109
+ - 100% test coverage for migration logic
110
+
111
+ ### Changed
112
+
113
+ - Docker volumes changed from named volumes to host bind mounts
114
+ - Default SQLITE_DB path from `./data/memory.db` to `~/.vesper/data/memory.db`
115
+ - CLI install creates `~/.vesper/` structure instead of local `data/` directory
116
+ - Server logs now indicate whether using user-level storage or override
117
+ - Environment variable handling improved with `VESPER_HOME` support
118
+
119
+ ### Fixed
120
+
121
+ - Command injection vulnerability in `vesper uninstall` (replaced shell `rm -rf` with `fs.rmSync`)
122
+ - Race condition in directory creation (removed redundant `existsSync` checks)
123
+ - Missing error handling for directory creation failures
124
+ - Secrets exposure risk (added .claude/settings.local.json to .gitignore)
125
+
126
+ ### Security
127
+
128
+ - **CRITICAL**: Prevented hardcoded secrets in version control
129
+ - **HIGH**: Fixed command injection in CLI uninstall
130
+ - **HIGH**: Added path traversal warnings for dangerous paths
131
+ - **MEDIUM**: Set restrictive permissions on data directories
132
+ - Security review conducted by automated security-reviewer agent
133
+
8
134
  ## [0.3.0] - 2026-02-02
9
135
 
10
136
  ### Added
@@ -132,6 +258,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
132
258
  - Per user: $0.49-0.73/month (100 users)
133
259
  - 97% cost reduction vs. target
134
260
 
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
261
+ [0.3.0]: https://github.com/fitz2882/vesper-memory/releases/tag/v0.3.0
262
+ [0.2.0]: https://github.com/fitz2882/vesper-memory/releases/tag/v0.2.0
263
+ [0.1.0]: https://github.com/fitz2882/vesper-memory/releases/tag/v0.1.0
package/LICENSE CHANGED
@@ -19,3 +19,62 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
+
23
+ ---
24
+
25
+ ## Third-Party Software Attributions
26
+
27
+ This software includes or is built upon the following third-party components:
28
+
29
+ ### Core Dependencies (MIT License)
30
+
31
+ **HippoRAG**
32
+ Copyright (c) 2024 OSU-NLP-Group
33
+ https://github.com/OSU-NLP-Group/HippoRAG
34
+
35
+ **FlagEmbedding (BGE Models)**
36
+ Copyright (c) Beijing Academy of Artificial Intelligence (BAAI)
37
+ https://github.com/FlagOpen/FlagEmbedding
38
+
39
+ **Voyager**
40
+ Copyright (c) MineDojo
41
+ https://github.com/MineDojo/Voyager
42
+
43
+ **better-sqlite3**
44
+ Copyright (c) 2017 Joshua Wise
45
+ https://github.com/WiseLibs/better-sqlite3
46
+
47
+ **ioredis**
48
+ https://github.com/redis/ioredis
49
+
50
+ **@modelcontextprotocol/sdk**
51
+ https://github.com/modelcontextprotocol/typescript-sdk
52
+
53
+ ### Apache 2.0 Licensed Components
54
+
55
+ **Qdrant Vector Database**
56
+ Apache License 2.0
57
+ https://github.com/qdrant/qdrant
58
+
59
+ **@qdrant/js-client-rest**
60
+ Apache License 2.0
61
+ https://github.com/qdrant/qdrant-js
62
+
63
+ ### Standalone Services (Not Distributed)
64
+
65
+ **SQLite** - Public Domain (https://www.sqlite.org)
66
+ **Redis** - AGPLv3 for v8+ (https://redis.io)
67
+
68
+ Users are responsible for ensuring compliance with the licenses of any
69
+ standalone services they choose to deploy alongside this software.
70
+
71
+ ### Academic Research Inspirations
72
+
73
+ This software implements concepts from:
74
+ - HippoRAG (Bernal et al., NeurIPS 2024)
75
+ - Hippocampal Indexing Theory (Teyler & Rudy, 2007)
76
+ - Word2Vec (Mikolov et al., 2013)
77
+ - Reciprocal Rank Fusion (Cormack et al., SIGIR 2009)
78
+ - Voyager (Wang et al., 2023)
79
+
80
+ See README.md Research & Credits section for complete citations.