astrocyte-sqlite
Zero-infrastructure storage for Astrocyte: every memory in one SQLite file.
No server, no Docker, no native extensions — pip install and retain.
# astrocyte.yaml
provider_tier: storage
vector_store: sqlite
vector_store_config:
path: ~/.local/share/astrocyte/astrocyte.db # default; or ASTROCYTE_SQLITE_PATH
SqliteStore satisfies both the VectorStore and DocumentStore protocols,
so the pipeline's keyword retrieval leg turns on automatically (the same
auto-wire PostgresStore gets).
Behaves like Postgres, deliberately
Semantics match astrocyte-postgres, not the in-memory test store, because
Postgres is what users deploy and what every benchmark measures:
| Behaviour | SqliteStore / PostgresStore |
|---|---|
delete |
soft delete (forgotten_at); as_of time travel still sees it |
| re-storing a deleted id | resurrects it |
tags / fact_types filters |
items without tags / type are excluded |
| similarity score | cosine, clamped to [0, 1] |
search_similar + time_range |
not applied (list_recent_vectors applies it) |
| batch with a wrong-length vector | whole batch rejected |
| keyword query | English stopwords dropped, remaining terms ANDed, stemmed |
tests/test_parity_postgres.py runs identical operations against both
backends and fails on any divergence. Known, accepted differences: keyword
ranking (FTS5 bm25 vs ts_rank_cd — the pipeline fuses by rank, and the
match set is identical), stemmer edge cases (Porter vs Snowball), and zero
vectors (score 0.0 here; NaN in pgvector).
Design
-
Exact cosine in numpy over float32 BLOBs. pgvector stores float4 too.
sqlite-vecwas rejected: it needsenable_load_extension, which some Python builds (including macOS system Python) omit. -
FTS5 with a LIKE fallback for SQLite builds compiled without it.
health()reports which is active. -
Safe across processes. An MCP server and short-lived agent-hook processes write the same file: WAL journal,
BEGIN IMMEDIATEwrites, busy timeout, a connection per call. -
Embedding dimension is pinned on first write. Switching embedding models against an existing file fails loudly instead of mixing incomparable vectors.
-
Scale. Exact search is linear in a bank's live memories. Measured on an Apple Silicon laptop, median of 15 queries,
limit=50:memories dim vector query keyword query file 1,000 384 3.7 ms 3.5 ms 2 MB 10,000 384 23 ms 19 ms 21 MB 50,000 384 116 ms 95 ms 107 MB 10,000 1536 68 ms 27 ms 83 MB 50,000 1536 420 ms 143 ms 414 MB Use the embedding model's native width:
local_embeddingswithpad_to: nullgives bge-small's 384 dims. Zero-padding to 1536 (needed only for Postgres's fixedvector(1536)column) costs ~4x in time and disk and changes no similarity. Keyword figures are pessimistic: the synthetic corpus puts the query terms in nearly every document. -
Identifiers sort bytewise.
list_vectorsorders byidin byte order. Postgres orders by the database collation; the two agree for the lowercase UUIDs Astrocyte generates, but could differ for arbitrary mixed-case ids.
Metadata
Release files for astrocyte-sqlite 0.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| astrocyte_sqlite-0.20.0.tar.gz | 163.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| astrocyte_sqlite-0.20.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 178.5 kB
Release files / astrocyte_sqlite-0.20.0.tar.gz
| Download URL | astrocyte_sqlite-0.20.0.tar.gz |
|---|---|
| Size | 163.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a5e8de4c078c38da611e5d583d284f3607d71153537f114b8096348d5adf10e
|
|
BLAKE2b-256 checksum How to use checksums |
df22c13c03b355d7b636cb7fef66cf77e1bc96959caf6786546f713d55c9691a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / astrocyte_sqlite-0.20.0-py3-none-any.whl
| Download URL | astrocyte_sqlite-0.20.0-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0466c89465dbecbcaa47230d32bf6e88f8f9bd22d736f345e34e4415da5d8ecd
|
|
BLAKE2b-256 checksum How to use checksums |
5e99fbd05cb77f0b24925b18a7169afcc13fe5a2e21782bf3763ebd0fb09de0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|