Dynamic Schema
Store arbitrary metadata in JSON columns without migrations. Automatically create generated-column indexes for fast lookups.
Dynamic attributes, interconnected files, and vector search with zero migrations.
mnemosine is a schema-less storage library built on top of SQLite designed for applications that outgrow simple document stores or flat relational tables. It provides a unified data layer combining:
sqlite-vec (and automatic fallback).| Challenge | Traditional Approach | mnemosine Solution |
|---|---|---|
| Evolving Fields | Alter tables / run migration scripts | Store in JSON metadata + index with index_attribute() |
| Large Files | Heavy BLOBs bloat the database | On-disk SHA-256 deduplicated blob store, metadata in DB |
| Complex Relations | Foreign keys & complex join tables | Typed Link edges with metadata and recursive graph queries |
| AI & Vector Search | Separate vector DB (Pinecone, Chroma, etc.) | Embedded sqlite-vec with zero external service dependencies |
from mnemosine import Storage
# 1. Open the storage engine
with Storage("project.db", blob_root="data/blobs") as db:
# 2. Create a dynamic schema-less document
doc = db.node(kind="doc", path="notes/kickoff")
doc["title"] = "Project Plan"
doc["tags"] = ["sqlite", "storage", "ai"]
doc.content = "We need a resilient, hybrid storage layer."
doc.save()
# 3. Store a binary file (deduplicated by SHA-256 hash)
pdf = db.file("report.pdf", mime="application/pdf")
pdf.write(b"%PDF-1.4 sample content...")
# 4. Link document and file with typed metadata
doc.link(pdf, link_type="attachment", metadata={"label": "v1.0"})
# 5. Index dynamic JSON fields on the fly
db.index_attribute("title", as_type="TEXT")
# 6. Graph traversal
for neighbor in doc.neighbors(direction="outgoing"):
print(f"Connected to: {neighbor['node'].path} via {neighbor['link'].link_type}")