feat: add semantic memory evaluation harness#1242
Draft
o-love wants to merge 9 commits intocluster-integrationfrom
Draft
feat: add semantic memory evaluation harness#1242o-love wants to merge 9 commits intocluster-integrationfrom
o-love wants to merge 9 commits intocluster-integrationfrom
Conversation
…ing) Widen parameter types to Sequence/Mapping for covariance, narrow return types where mutation is needed (MutableMapping). Convert async def methods returning iterators to def returning AsyncIterator. Add delete_history_set to the storage interface.
Adapt all callers of storage methods that now return AsyncIterator: - SemanticService propagates AsyncIterator for search, get_set_features, list_set_id_starts_with - SemanticSessionManager propagates AsyncIterator to the boundary - MemMachine collects AsyncIterator into lists at the API boundary - IngestionService collects internally where lists are needed - Add merge_async_iterators utility for parallel iterator merging - Update test files to collect from AsyncIterator
5c3ccd6 to
685c9ee
Compare
- Fix ruff import sorting in semantic_memory.py and test_background - Fix ty invalid-assignment: use Sequence[SemanticFeature] for consolidation sections, convert to list at llm boundary - Fix ty invalid-argument-type: revert Protocol widening in session manager where config_store hasn't been updated yet, convert at call sites instead - Fix ruff formatting in test_semantic_ingestion.py
685c9ee to
1131247
Compare
The router constructs response models with concrete list/dict fields but the widened model types now expose Sequence/Mapping. Convert at the serialization boundary.
1131247 to
c60cb13
Compare
Introduce ClusterManager, ClusterSplitter, and ClusterStore abstraction with SQLAlchemy and in-memory implementations. Clusters group incoming messages by semantic similarity before ingestion.
c60cb13 to
ae1f158
Compare
The ResourceManager protocol requires get_reranker but the test's local _ResourceManager was missing it, causing isinstance check to fail at runtime.
bae9bb0 to
f7ae24e
Compare
edwinyyyu
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the change
Add a LoCoMo-based evaluation harness for measuring semantic memory retrieval quality, enabling systematic benchmarking of ingestion and search.
Description
runner.py) orchestrating ingestion → search → scoring pipelineingest.pyandsearch.pyfor harness-specific ingestion and retrievallocomo_evaluate.pyfor computing retrieval metrics against LoCoMo ground truthgenerate_scores.pyfor aggregating and reporting resultssemantic_harness.pyas the top-level entry pointStack: PR 4/4 —
main←storage-interface-refactor←cluster-engine←cluster-integration←eval-harnessDepends on #1241
Type of change
How Has This Been Tested?
Unit Test
test_runner.py— evaluation runner orchestrationtest_ingest.py— harness ingestion pipelinetest_search.py— harness search and scoringtest_semantic_harness.py/test_semantic_harness_build.py— end-to-end harnessTest Results: All evaluation tests pass locally.
Checklist
Maintainer Checklist
Screenshots/Gifs
N/A
Further comments
This PR is entirely additive (16 new files, 714 lines) under
evaluation/andtests/evaluation/. The harness is self-contained and does not affect the main application.