chore: drop unused access_count column#178
Merged
nicoloboschi merged 1 commit intomainfrom Jan 20, 2026
Merged
Conversation
98f1893 to
087fb64
Compare
kagura-agent
added a commit
to kagura-agent/hindsight
that referenced
this pull request
Mar 31, 2026
Add access_count column to memory_units to track how often each memory is retrieved via user-facing recall operations. Changes: - Migration: re-add access_count column (INTEGER NOT NULL DEFAULT 0) with DESC index. This column existed in the initial schema but was dropped in vectorize-io#178 because it was never populated. - ORM model: add access_count to MemoryUnit with server_default='0' - Increment logic: after successful recall_async(), batch-increment access_count for all returned memory IDs. Only user-facing recalls increment the counter — internal operations (reflect, consolidation) pass _quiet=True and are excluded. - Response models: expose access_count in MemoryFact (core), RecallResult (HTTP API), list_memory_units, and get_memory_unit responses. - Tests: 13 unit tests covering response models, API model, migration structure, and ORM model properties. The increment is non-blocking: failures are logged but don't affect the recall response. The access_count value returned in recall results reflects the count *before* the current retrieval's increment (read happens before write in the pipeline). Closes vectorize-io#793
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.
No description provided.