Files
claude-mem/experiment
Alex Newman 633f89a5fb feat: Implement user prompt syncing to Chroma and enhance timeline querying
- Added `getObservationById` method to retrieve observations by ID in SessionStore.
- Introduced `getSessionSummariesByIds` and `getUserPromptsByIds` methods for fetching session summaries and user prompts by IDs.
- Developed `getTimelineAroundTimestamp` and `getTimelineAroundObservation` methods to provide a unified timeline of observations, sessions, and prompts around a specified anchor point.
- Enhanced ChromaSync to format and sync user prompts, including a new `syncUserPrompt` method.
- Updated WorkerService to sync the latest user prompt to Chroma after updating the worker port.
- Created tests for timeline querying and MCP handler logic to ensure functionality.
- Documented the implementation plan for user prompts and timeline context tool in the Chroma search completion plan.
2025-11-03 16:55:33 -05:00
..

Chroma MCP Experiment

This directory contains experimental scripts to test semantic search via ChromaDB without modifying production code.

Files

  • chroma-sync-experiment.ts - Syncs SQLite observations/summaries to ChromaDB via Chroma MCP tools
  • chroma-search-test.ts - Compares semantic search (Chroma) vs keyword search (FTS5)
  • RESULTS.md - Document findings and make decision on production integration

Prerequisites

  1. Chroma MCP server configured in Claude settings
  2. Running: uvx chroma-mcp --client-type persistent --data-dir ~/.claude-mem/vector-db

Running the Experiment

Step 1: Sync Data

npx tsx experiment/chroma-sync-experiment.ts

This will:

  • Connect to your Chroma MCP server
  • Create collection cm__claude-mem
  • Sync all observations and sessions from SQLite
  • Report sync statistics
npx tsx experiment/chroma-search-test.ts

This will:

  • Run 8 test queries (4 semantic, 4 keyword)
  • Compare Chroma semantic search vs FTS5 keyword search
  • Display results side-by-side

Step 3: Document Results

Edit RESULTS.md with your findings:

  • Which queries worked better with semantic search?
  • Which worked better with keyword search?
  • Is hybrid search worth the complexity?

Decision Point

Based on results:

  • If semantic search provides significant value: Design production integration
  • If FTS5 is sufficient: Keep current implementation, document why

Note

This is a pure experiment - no production code changes. All scripts are self-contained in this directory.