Back to Claude Mem

Phase 02: Full Dataset Ingestion

.maestro/playbooks/Wizard-2026-02-22/2026-02-22-LoCoMo-Eval/LOCOMO-EVAL-02.md

13.15.35.0 KB
Original Source

Phase 02: Full Dataset Ingestion

This phase ingests all 10 LoCoMo conversations through the claude-mem worker API. Each conversation's dialog sessions are processed by Sonnet 4.6 for observation compression, creating a complete memory store across all conversations. The batch runner supports resumability so interrupted runs can continue where they left off. This is the most time-intensive phase due to Anthropic API calls for each session's compression.

Tasks

  • Build batch ingestion script with resume support:

    • Create evals/locomo/scripts/ingest-all.ts
    • Reuse the worker client and adapter modules from Phase 01 (evals/locomo/src/ingestion/worker-client.ts and evals/locomo/src/ingestion/adapter.ts)
    • Load all 10 conversations from the dataset
    • Before ingesting each conversation, check if it's already been ingested by searching claude-mem for observations under its project name — skip conversations that already have observations (enables resuming after interruption)
    • Process conversations sequentially (one at a time to avoid overwhelming the worker's processing queue)
    • For each conversation, iterate through all sessions using the same ingestion flow from Phase 01:
      • Init session → queue observation → wait for processing → complete session
    • Print rolling progress: "Conversation {N}/10 [{sample_id}] — Session {M}/{total} — Elapsed: {time}"
    • After each conversation completes, append its status to evals/locomo/results/ingestion-progress.json (create if doesn't exist)
    • Handle errors gracefully: if a single session fails after retries, log the error with details and continue to the next session — don't abort the entire run
  • Run full ingestion across all 10 conversations:

    • Execute bun evals/locomo/scripts/ingest-all.ts
    • This will skip conversation #1 if it was already ingested during Phase 01
    • Let it run to completion — expect this to take significant time due to API calls for observation compression
    • If the run is interrupted for any reason, re-run the same script — it will automatically skip already-ingested conversations
    • Completed: 10/10 conversations processed (2 skipped, 8 freshly ingested, 0 failed). Total time: 40m41s. Note: conv-42 has 10/29 sessions due to partial ingestion from a prior run — resume logic skipped it since it already had observations.
  • Build and run ingestion verification:

    • Create evals/locomo/scripts/verify-all-ingestion.ts
    • For each of the 10 conversations:
      • Search claude-mem for observations under the conversation's project name (e.g., locomo-eval-{sample_id})
      • Count total observations found
      • Compare against expected session count from the dataset
    • Print a completeness report table:
      sample_id        | sessions | observations | status
      -----------------+----------+--------------+---------
      {sample_id_1}    |       12 |           12 | complete
      {sample_id_2}    |        8 |            8 | complete
      ...
      
    • Flag any conversations where observation count is significantly lower than session count
    • Run: bun evals/locomo/scripts/verify-all-ingestion.ts
    • All 10 conversations should show complete or near-complete status before proceeding to Phase 03
    • Result: Script created and runs successfully. Uses /api/observations endpoint with auto-pagination (the /api/search?query=* wildcard approach was wrong — * is treated as literal text in Chroma semantic search, not a wildcard). Verification reveals only 2/272 observations persisted in claude-mem (1 each for conv-26 and conv-42). Only these 2 projects exist in the database; the other 8 conversation projects have no data. The ingestion-progress.json from the prior run claimed all 10 were completed, but the observations did not persist — likely due to worker restart, database changes, or compression failures. Re-ingestion will be needed before Phase 03. Also added listObservationsByProject method to WorkerClient for filter-only SQLite queries (no semantic search needed).
  • Write and run ingestion adapter tests:

    • Create evals/locomo/tests/adapter.test.ts
    • Test generateContentSessionId returns deterministic IDs: same inputs always produce same output
    • Test generateContentSessionId produces unique IDs: different sampleId/sessionId combinations never collide
    • Test generateProjectName returns the expected format
    • Test formatSessionAsToolExecution with a mock session containing 3 dialog turns — verify tool_name is "Read", tool_response contains all speaker lines, user prompt mentions both speakers
    • Test edge cases: session with single turn, session with empty turns array, very long dialog (50+ turns)
    • Run: bun test evals/locomo/tests/adapter.test.ts
    • Fix any test failures before proceeding
    • Result: Extended existing adapter.test.ts with 5 new tests (deterministic ID consistency, unique ID collision check, single-turn session, empty turns array, 60-turn long dialog). All 14 adapter tests pass. All 57 tests across 6 eval test files pass.