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.22.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.22.0
File Size Uploaded
astrocyte_sqlite-0.22.0.tar.gz 165.0 kB Details

Built distribution (wheel)

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

Total release size: 181.1 kB

Release files / astrocyte_sqlite-0.22.0.tar.gz

Download URL astrocyte_sqlite-0.22.0.tar.gz
Size 165.0 kB
Tags Source
SHA-256 checksum
How to use checksums
abed22d50078291cf026d5cff2634d05ccb72860eb3a554a10b5f6acb06f8385
BLAKE2b-256 checksum
How to use checksums
5ecb7c61c95e096f87e122557fe9a471abd1119808400e8188694b0e94b935fb
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.22.0-py3-none-any.whl

Download URL astrocyte_sqlite-0.22.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff470a7deed1039fdf1c64e8709b78286b48d90d691b7d3e2c3f56a9c0692e2d
BLAKE2b-256 checksum
How to use checksums
9b1364aa58bea177d45d7161d47a0a88fdd4abde821aadabd1ae4d9b51ad8d00
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.22.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