# Changelog All notable changes to this project will be documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/). ## [Unreleased] ### Added - `src/epimneme/assembly.py` — deterministic, $0/query context assembly for the reader: temporal scaffolding (precomputed date deltas, no reader-side date arithmetic), chronological presentation, supersession pruning (linked + SimHash-detected), adaptive K/char budgeting, session grouping, and parent-document (small-to-big) expansion. Opt-in via `assemble=true` on `GET /api/memories/search` and the MCP `recall` tool. - `assembly.assemble_context(skip=...)` leaves out individual presentation steps (`prune`, `group`, `chrono`, `dates`) for ablation, an opt-in `recency_note` (off by default; `--assembly-recency` in the benchmark harness) prepends one line telling the reader that the latest-dated value wins where excerpts disagree — it is skipped for counting queries. On LongMemEval-S it is benchmark-neutral overall (knowledge-update 0.821 → 0.859 ungated, at the cost of multi-session 0.602 → 0.564; gating it off for counting queries removes both, since 38/78 knowledge-update questions are counting queries). The per-header day-delta suffix is now emitted only when `needs_date_arithmetic(query)` (elapsed-time / ordering cue or a parseable relative date; `date_delta_gate=None` restores always-on), and chronological re-ordering is off by default (`DEFAULT_SKIP = {"chrono"}`). Measured per question on LongMemEval-S (qwen3.8:27b reader, judged): the suffix helped 10 / hurt 4 temporal-reasoning questions and helped 3 / hurt 18 multi-session ones; chronological order was −5 on temporal and −1 on multi-session. - `benchmarks/lme_e2e_bench.py` feeds the reader through `epimneme.assembly.assemble_context` by default (same candidate pool as before; `--no-assembly` reproduces the raw `---`-joined context, `--assembly-budget N` sets the char budget) and records `assembly_excerpts` / `assembly_chars` / `assembly_truncated` per result row. `benchmarks/compare_e2e.py` prints paired per-category hit rates across e2e result files. - `recall_all@k` and `evidence_completeness@k` metrics in the LME benchmark harness, alongside the existing `recall_any@k` — `recall_any` was masking incomplete multi-session evidence (turn-level `EvidenceCompleteness@10` measured at 0.527 on the current LME-S baseline, vs. `recall_any@10` reading 0.982). - Temporal partition rerank (`fusion.temporal_partition`): for day-precision temporal queries, structurally promotes in-window candidates ahead of out-of-window ones rather than relying on an additive score boost. - New config knobs: `EPIMNEME_ASSEMBLY_BUDGET_CHARS`, `EPIMNEME_ASSEMBLY_K_SINGLE`, `EPIMNEME_ASSEMBLY_K_COUNTING`, `EPIMNEME_ASSEMBLY_PARENT_EXPANSION`, `EPIMNEME_TEMPORAL_PARTITION_ENABLED`. - MIT license, `NOTICE`, `CONTRIBUTING.md`, `SECURITY.md`, `ARCHITECTURE.md`. - Startup guard: the server refuses to start if `EPIMNEME_PG_PASSWORD` is unset or equal to the default `epimneme`, unless `EPIMNEME_DEMO_MODE=1`. - `.env.example` with documented minimum settings. - OCI image labels on the Dockerfile. ### Fixed - `benchmarks/longmemeval_bench.py` silently stored only the first 2,000 chars of each ranked item's text (`content[:2000]`). LME turn-pairs run ~2,000–3,400 chars, so 65.7% of the top-10 texts in the v700 run were clipped — and `lme_e2e_bench.py` feeds that stored text to the reader, so the e2e reader never saw the tail of most retrieved turns (the plan's "assistant turn truncation" root cause was this, not ingest-side chunking; the ingest path stores whole turn-pairs). Full text is now the default; `--text-cap N` reproduces the old files. - `benchmarks/lme_e2e_bench.py` never set Ollama's `num_ctx`, so requests ran at Ollama's default context (4,096 tokens in current releases) — smaller than ten full turn-pairs plus the prompt — and Ollama silently drops the *front* of an over-long prompt. Now sends `num_ctx=16384` by default (`--num-ctx`). Prior e2e numbers were therefore measured on a reader that could not see all of its context; treat them as a floor. - `fusion.extract_logical_date` (used by the temporal boost) only matched ISO-hyphenated dates; real LongMemEval haystacks use slash-delimited dates with a weekday/time suffix (`[Date: 2023/05/20 (Sat) 09:05]`), so the temporal boost was silently falling back to `created_at` (ingestion wall-clock time) on every benchmark memory — effectively a no-op on the exact data it's benchmarked against. - `fusion.mmr_rerank` was O(n·k²) in the requested result limit (measured: 0.8s → 174s going from `limit=10` to `limit=200` on a ~2,500-memory project). Fixed to O(n·k) by maintaining a running max-similarity-to-selected per candidate instead of recomputing it from scratch every iteration. Output is unchanged (verified by differential test against the original algorithm). - Two leftover hardcoded `engram.*` references from the Engram→Epimneme rename that broke a fresh container build entirely: the Dockerfile's `CMD` (`engram.server:app`) and `migrations/runner.py`'s `importlib.import_module(f"engram.migrations.{name}")`. - `benchmarks/lme_e2e_bench.py`'s final summary counted `exact_match`/`judge_match` and ignored the `_abs` ("Unknown" is correct) rule that the per-row `hit` flag applies, so it under-reported every run by ~4pp (0.578 printed vs 0.618 actual on the 2026-09-09 run). It now counts `hit`. `--rescore-only` no longer demands a `--retrieval-results` path it never reads. - `benchmarks/epimneme_client.py`'s `clear_project()` now enumerates a project's memories directly via `/api/memories/recent` instead of a relevance-scored `search(query="*")` loop — not a correctness bug in practice, but not a *guaranteed* complete enumeration either. - `pyproject.toml`'s `mcp[cli]` dependency had no upper bound; `mcp` 2.x renamed `FastMCP`, breaking `skills.py`'s import on any fresh install. Pinned `<2`. ### Changed - `benchmarks/*.py` defaults now point at `http://localhost:8000` instead of a hard-coded LAN address. - README rewritten for a public audience; architectural deep-dive moved to `ARCHITECTURE.md`. - CORS middleware now disables credentials when `allow_origins=["*"]` (matches browser spec). - License switched from Apache 2.0 to MIT. ### Removed - Internal-only `TECHNICAL_REVIEW.md` (content preserved in `ARCHITECTURE.md`). - Private domain and hostnames from documentation. ### Investigated (no change) - Embedder-side chunking (2026-09-06/07): `all-MiniLM-L6-v2` reads only the first 256 tokens; 79% of LME-S turn-pairs and 94.8% of answer-bearing ones are longer (gold median ≈630 tokens), so the semantic channel indexes under half of most gold documents. Gold-turn recall@10 on the v700 run falls with length (≤256 tok: 97.6%, 257–512: 88.3%, >512: 77.9%; multi-session >512: 62.1%). Tested whether sub-window or role-split (`[USER]`/`[ASSISTANT]` embedded separately) chunking closes that gap with `benchmarks/sem_chunking_sim.py` (semantic-channel-only, 200 stratified questions): **NO-GO**. Best variant lifts gold-turn recall@10 76.3%→79.1% overall, inside sampling noise, with multi-session — the target bucket — flat (67.4%→68.9%) and plain windowing slightly negative. The length gradient was confounded with question type, not caused by truncation. Full table in `benchmarks/BENCHMARK_RESULTS.md`. No production change. - Phase 5 (two-stage session-then-chunk retrieval at LME-M scale): NO-GO. Best case tied flat chunk search (0.0pp R@1 gain, well short of the +3pp bar); narrower session cuts regressed R@10 recall_all by up to 8.4pp. See `benchmarks/lme_m_hierarchical_experiment.py` and its commit message for the full results table. ## [0.7.0] — 2026-04 Historical releases tracked via git history. Highlights: - LongMemEval + LoCoMo benchmark harness, adaptive keyword weight for vague queries. - Reciprocal-Rank Fusion hybrid search, preference boosting, entity-aware dedup. - Persistent-project flag, pinning, versioning, SimHash dedup, FSRS-inspired decay. - Reflection / compaction scheduler (GC, consolidation, conflict resolution). - Dashboard (activity stream, graph viz, backup/restore), REST project claiming. - Pagination, structured JSON logging, CI pipeline. - API key cycling, hard-forget endpoint, 403 hints. - Backup rotation, integration tests. - Initial PostgreSQL + pgvector rewrite (replacing DuckDB + LanceDB + Kuzu).