Fix project filter and update export/import docs

Critical bug fix:
- Pass project filter to getSessionSummariesByIds() and getUserPromptsByIds() in SearchManager
- Previously only observations were filtered by project, sessions and prompts leaked from other projects

Documentation improvements:
- Update "FTS5 search" to "hybrid search" (accurate terminology)
- Add privacy warning about sensitive data in exports
- Document --project parameter for filtered exports
- Add "Export by Project" examples to advanced usage

Verified with test export using --project=claude-mem filter.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2025-12-10 20:38:21 -05:00
parent 4e7ed75fa9
commit 5b338ba34e
3 changed files with 19 additions and 6 deletions
+16 -3
View File
@@ -18,7 +18,7 @@ Share your claude-mem knowledge with other users! These scripts allow you to exp
### Export Script
Searches the database using FTS5 full-text search and exports all matching:
Searches the database using **hybrid search** (combines ChromaDB vector embeddings with FTS5 full-text search) and exports all matching:
- **Observations** - Individual learnings and discoveries
- **Sessions** - Session metadata
- **Summaries** - Session summaries
@@ -26,6 +26,8 @@ Searches the database using FTS5 full-text search and exports all matching:
Output is a portable JSON file that can be shared.
> **Privacy Note:** Export files contain all matching memory data in plain text. Review exports before sharing to ensure no sensitive information (API keys, passwords, private paths) is included.
### Import Script
Imports memories with **duplicate prevention**:
@@ -56,8 +58,9 @@ npx tsx scripts/export-memories.ts "progressive disclosure" progressive-disclosu
```
**Parameters:**
1. `<query>` - Search query (uses FTS5 full-text search)
1. `<query>` - Search query (uses hybrid semantic + full-text search)
2. `<output-file>` - Output JSON file path
3. `--project=name` - Optional: filter results to a specific project
**Example Output:**
```
@@ -196,6 +199,16 @@ If you run the import again on the same file, duplicates are automatically skipp
## Advanced Usage
### Export by Project
```bash
# Export only claude-mem project memories
npx tsx scripts/export-memories.ts "bugfix" bugfixes.json --project=claude-mem
# Export all memories for a specific project
npx tsx scripts/export-memories.ts "" all-project.json --project=my-app
```
### Export by Type
```bash
@@ -208,7 +221,7 @@ npx tsx scripts/export-memories.ts "type:bugfix" bugfixes.json
### Export by Date Range
FTS5 doesn't support date filtering directly, but you can filter the export after:
You can filter the export after exporting:
```bash
# Export all memories, then filter manually with jq