Skip to main content

Module chunks

Module chunks 

Source
Expand description

Chunk storage CRUD for multi-chunk memories.

Manages the memory_chunks table: insert embeddings for bodies that exceed the 512-token E5 limit and query chunks for vector search.

Structs§

Chunk

Functions§

count_for_memory
GAP-SG-40: counts the rows actually persisted in memory_chunks for a memory. Single-chunk bodies are stored inline in the memories row and append no chunk rows, so this returns 0 for them; multi-chunk bodies return the exact number of persisted chunk rows. Callers query this AFTER the transaction commits so the reported chunks_persisted reflects the observable database state rather than a pre-commit estimate.
delete_chunks
get_chunks_by_memory
insert_chunk_slices
insert_chunks
knn_search_chunks
upsert_chunk_vec