attachment_store
attachment_store
¶
AttachmentStore — content-addressed blob storage for Deep Research attachments.
Stores binary attachments at {base_dir}/{sha256[:2]}/{sha256} and tracks
metadata in a SQLite database at {base_dir}/attachments.db.
Deduplication is automatic: re-storing the same bytes accumulates source_doc_ids but does not write a second copy of the file.
Pure Python sqlite3 (no Rust extension required).
Classes¶
AttachmentStore
¶
Content-addressed blob store with SQLite metadata index.
Files are written to {base_dir}/{sha256[:2]}/{sha256} so that the
directory fan-out stays bounded even for millions of blobs. The SQLite
metadata table tracks filename, MIME type, size, and the list of
source document IDs that reference each blob.
Source code in src/openjarvis/connectors/attachment_store.py
Functions¶
store
¶
Store content and return its SHA-256 hex digest.
The call is idempotent with respect to the blob file — if the same bytes are stored again only the metadata (source_doc_ids) is updated.
Source code in src/openjarvis/connectors/attachment_store.py
get_metadata
¶
Return the metadata dict for sha, or None if not found.
Returned keys: sha256, filename, mime_type,
size_bytes, source_doc_ids (list), created_at.
Source code in src/openjarvis/connectors/attachment_store.py
get_content
¶
Return the raw bytes for sha, or None if the blob is missing.