Skip to content

chore: drop unused access_count column#178

Merged
nicoloboschi merged 1 commit intomainfrom
access-count
Jan 20, 2026
Merged

chore: drop unused access_count column#178
nicoloboschi merged 1 commit intomainfrom
access-count

Conversation

@nicoloboschi
Copy link
Copy Markdown
Collaborator

No description provided.

@nicoloboschi nicoloboschi merged commit 16b85a4 into main Jan 20, 2026
23 of 24 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant