crow-memory
The one memory contract for crow. SQLAlchemy over a caller-supplied db_uri
— sqlite by default, postgres a seam away. Shared by crow-cli (writes)
and crow-mcp (read-only queries).
import crow_memory
uri = crow_memory.normalize_db_uri("~/.agents/crow/crow.db") # or postgresql://...
crow_memory.create_database(uri) # tables + FTS5 index (sqlite)
engine = crow_memory.get_engine(uri)
crow_memory.create_agent(engine, agent_id="s-1", session_id="s", agent_idx=1)
crow_memory.add_message(engine, "s-1", {"role": "user", "content": "hi"})
crow_memory.search_messages(engine, "hi") # FTS5 bm25 (sqlite)
Design rules:
- No config in this package. Apps resolve their own
db_uriand pass it in.normalize_db_uriaccepts a full URI or a plain path. - Images never live in the DB:
add_message(..., images_dir=)extracts inline base64 to content-addressed files;load_messages(..., hydrate=True)swaps refs back to data URLs. - Read-only consumers (crow-mcp) use
get_engine("sqlite:///file:<path>?mode=ro&uri=true"). - Keyword search is SQLite FTS5. A future postgres backend needs its own
search implementation behind
search_messages; everything else is portable SQLAlchemy already.
Tests: uv --project . run pytest
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
crow_memory-0.1.34.tar.gz
(14.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crow_memory-0.1.34.tar.gz.
File metadata
- Download URL: crow_memory-0.1.34.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aaf59b073c985e5832ce2ac735aad16f522c31af8caa240c1a16318e44ccd4f0
|
|
| MD5 |
b05cb4fff54a986cf45bb94f55365524
|
|
| BLAKE2b-256 |
9e8a348914155f87998f13b625bc95b2dbc44ed055334138d80f9e05bd4f83c4
|
File details
Details for the file crow_memory-0.1.34-py3-none-any.whl.
File metadata
- Download URL: crow_memory-0.1.34-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8105f597a9198372ff4d0a3e3e4abccdf5787f0f43c14d8d06b00560633ab5fb
|
|
| MD5 |
d182b068b607d379ff009bb36cb418ad
|
|
| BLAKE2b-256 |
9daa4fcaf6882dccb2dfd8d367c6d97604e38ec966ce0916d19c07e62a146149
|