You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
detects semantically related candidates when a new semantic memory is stored
lets the host LLM or operator decide whether a contradiction actually exists
periodically scores semantic, episodic, and procedural memories for keep / fade / prune
safely prunes records and owned media without introducing broken references
This issue body supersedes the previous plan where they conflict.
Validated conclusions
1. Exponential decay is still the right default
Keep an exponential half-life model for memory retention. This is consistent with MemoryBank, FadeMem, and the broader forgetting literature.
2. Generic embedding similarity is candidate retrieval only
The current repo uses generic semantic embeddings. Those embeddings are suitable for recalling topically related memories, but they must not be treated as contradiction judges.
The safe design is still two-phase:
embeddings recall candidates
the host LLM or operator judges the logical relationship
3. Forgetting needs mutation primitives, not just scan + delete
The current stores can read, write, retrieve, and update access metadata, but they cannot yet:
scan all records through the public interface
delete arbitrary records through the public interface
replace or mutate an existing record through the public interface
Fade and supersession both require mutation support.
4. Duplicate handling must happen before final bucket assignment
The forgetting cycle cannot:
score
bucket
then flag likely duplicates
That ordering leaves stale buckets. Duplicate or superseded records must either:
be forced into the prune path before bucketing, or
trigger a second bucketing pass
5. Prune order should be DB first, media second
Delete the ChromaDB record first, then delete owned media. If media deletion fails, log the orphan and continue. That leaves no live record pointing at a missing file.
6. CLI should call the API for forgetting operations
The forgetting cycle should run inside the API service rather than through a second local CLI process opening the same persistent Chroma database. There are open Chroma reports where get() and vector query() diverge across processes on the same persistent store.
7. Reuse the existing event surface
The repo already has an in-memory event recorder and /api/events. Forgetting should extend that surface rather than introduce a parallel history subsystem in v1.
Store capabilities required first
Before any forgetting logic, the store layer needs:
replace(record: MemoryRecord) -> None or update_record(record)
This is a hard dependency for the rest of Step 6.
Updated architecture
flowchart TD
subgraph "Real-time semantic store path"
A[Store semantic memory] --> B[Use stored embedding to find related candidates]
B --> C[Return potential_contradictions to caller]
C --> D[Host LLM or operator judges]
D -->|Confirmed replacement| E[Resolve supersession]
D -->|No contradiction| F[No mutation]
end
subgraph "Batch forgetting cycle"
G[Scan all stores] --> H[Find likely duplicate semantic pairs]
H --> I[Build forced-prune / forced-zero-importance set]
I --> J[Compute decay score with one snapshot time]
J --> K[Bucket keep / fade / prune]
K --> L[Execute writes and deletes]
L --> M[Emit events and return report]
end
Summary
Add a forgetting service that:
This issue body supersedes the previous plan where they conflict.
Validated conclusions
1. Exponential decay is still the right default
Keep an exponential half-life model for memory retention. This is consistent with MemoryBank, FadeMem, and the broader forgetting literature.
2. Generic embedding similarity is candidate retrieval only
The current repo uses generic semantic embeddings. Those embeddings are suitable for recalling topically related memories, but they must not be treated as contradiction judges.
The safe design is still two-phase:
3. Forgetting needs mutation primitives, not just scan + delete
The current stores can read, write, retrieve, and update access metadata, but they cannot yet:
Fade and supersession both require mutation support.
4. Duplicate handling must happen before final bucket assignment
The forgetting cycle cannot:
That ordering leaves stale buckets. Duplicate or superseded records must either:
5. Prune order should be DB first, media second
Delete the ChromaDB record first, then delete owned media. If media deletion fails, log the orphan and continue. That leaves no live record pointing at a missing file.
6. CLI should call the API for forgetting operations
The forgetting cycle should run inside the API service rather than through a second local CLI process opening the same persistent Chroma database. There are open Chroma reports where
get()and vectorquery()diverge across processes on the same persistent store.7. Reuse the existing event surface
The repo already has an in-memory event recorder and
/api/events. Forgetting should extend that surface rather than introduce a parallel history subsystem in v1.Store capabilities required first
Before any forgetting logic, the store layer needs:
get_all_records(include_embeddings: bool = False) -> list[MemoryRecord]delete(record_id: str) -> Nonereplace(record: MemoryRecord) -> Noneorupdate_record(record)This is a hard dependency for the rest of Step 6.
Updated architecture
flowchart TD subgraph "Real-time semantic store path" A[Store semantic memory] --> B[Use stored embedding to find related candidates] B --> C[Return potential_contradictions to caller] C --> D[Host LLM or operator judges] D -->|Confirmed replacement| E[Resolve supersession] D -->|No contradiction| F[No mutation] end subgraph "Batch forgetting cycle" G[Scan all stores] --> H[Find likely duplicate semantic pairs] H --> I[Build forced-prune / forced-zero-importance set] I --> J[Compute decay score with one snapshot time] J --> K[Bucket keep / fade / prune] K --> L[Execute writes and deletes] L --> M[Emit events and return report] endUpdated sub-issue map
Updated delivery order
Decisions locked for v1
/api/eventsReferences checked during research
Querydoes not matchGeton persistent DB accessed by two processes. chroma-core/chroma#3792