Skip to main content

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-vec was rejected: it needs enable_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 IMMEDIATE writes, 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_embeddings with pad_to: null gives bge-small's 384 dims. Zero-padding to 1536 (needed only for Postgres's fixed vector(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_vectors orders by id in 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.19.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astrocyte-sqlite 0.19.0
File Size Uploaded
astrocyte_sqlite-0.19.0.tar.gz 163.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for astrocyte-sqlite 0.19.0
File Interpreter ABI Platform
astrocyte_sqlite-0.19.0-py3-none-any.whl Python 3 none any Details

Total release size: 178.5 kB

Release files / astrocyte_sqlite-0.19.0.tar.gz

Download URL astrocyte_sqlite-0.19.0.tar.gz
Size 163.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7080672aa88237009dcd12687c6de4ac78d57c35cc60192d5144d6d51ba714a3
BLAKE2b-256 checksum
How to use checksums
4edbf0bc491df3168edac9916d9517af2a654aeccfc82eaa15437e49c70a725a
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.19.0-py3-none-any.whl

Download URL astrocyte_sqlite-0.19.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
232c26b9e32c11741d501b15086d6670d325d4df7c7d9b93e10ed19c3468b24a
BLAKE2b-256 checksum
How to use checksums
f9d1eff9ce09966b496c5d12f927ddf82c443c55aa01fc7c50d0a6067f0d7b23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.19.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page