Skip to main content

Grizabella

A tri-layer memory framework for LLM solutions.

Docs License: MIT

Overview

Grizabella is a sophisticated memory layer designed for Large Language Model (LLM) solutions. It provides a unified interface to manage and query data across relational, vector, and graph databases, enabling complex memory and knowledge retrieval for AI applications.

Key Features

  • Tri-layer Storage: Integrates SQLite (relational), LanceDB (vector), and LadybugDB (graph) for comprehensive data management.
  • Unified Python API: Offers a simple and consistent Python interface to interact with all three database layers.
  • Complex Query Engine: Allows for sophisticated queries that can span across the different data storage paradigms.
  • GPU Acceleration: Optional GPU support for faster embedding generation using Sentence Transformers.
  • Bulk Processing: Efficient bulk addition mode for high-throughput data ingestion.
  • PySide6 UI: Includes an optional desktop application for visualizing and managing data.
  • MCP Server: Can operate as a Model Context Protocol (MCP) server, allowing other tools to leverage its memory capabilities.

Quick Installation

For production use (once published):

pip install grizabella

For development:

git clone https://github.com/pwilkin/grizabella.git
cd grizabella
poetry install

Basic Usage Snippet

from grizabella import Grizabella

# Initialize Grizabella (connects to default in-memory databases)
gz = Grizabella()

# Define an object type (implicitly creates a table/node type)
gz.create_object_type("document", {"text": str, "source": str})

# Add an object
doc1 = gz.add_object(
    object_type="document",
    data={"text": "This is the first document.", "source": "manual"},
    vector_data={"text": "This is the first document."} # Data for embedding
)

print(f"Added document with ID: {doc1.id}")

# Bulk addition with GPU support
with Grizabella(use_gpu=True) as gz:
    gz.begin_bulk_addition()
    for i in range(100):
        gz.upsert_object(obj_instance) # Define obj_instance beforehand
    gz.finish_bulk_addition()

# Further operations (querying, adding relations, etc.) would go here.

Maintenance

The vector store compacts itself: after 64 writes to a table, or once writes have been quiet for five minutes, its fragments are merged and versions older than ten minutes are removed. A vector index (IVF_FLAT, exact squared-L2 distances) is built once a table passes 50,000 rows; below that a flat scan is exact and takes a few milliseconds. GRIZABELLA_LANCEDB_COMPACT_AFTER_WRITES, GRIZABELLA_LANCEDB_MAINTENANCE_INTERVAL_S (0 turns the background pass off), GRIZABELLA_LANCEDB_MAINTENANCE_IDLE_S, GRIZABELLA_LANCEDB_CLEANUP_OLDER_THAN_S and GRIZABELLA_LANCEDB_INDEX_MIN_ROWS change those numbers.

grizabella-maintain works on a database no engine has open:

grizabella-maintain --db-path ./mydb stats          # rows, fragments, versions, sizes; graph vs SQLite counts
grizabella-maintain --db-path ./mydb compact        # compact every vector table, keep only the latest version
grizabella-maintain --db-path ./mydb rebuild-graph  # recreate the graph tier from SQLite

rebuild-graph is the way across a LadybugDB storage-format change: SQLite holds every object and relation, so the graph can be recreated from it. The old graph files are moved into graph-backup-<time>/, not deleted.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md (to be added) for guidelines on how to contribute to Grizabella.

License

Grizabella is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for grizabella 0.8.1

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

Source distribution (sdist)

Source distribution for grizabella 0.8.1
File Size Uploaded Provenance
grizabella-0.8.1.tar.gz 192.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for grizabella 0.8.1
File Interpreter ABI Platform
grizabella-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 418.2 kB

Release files / grizabella-0.8.1.tar.gz

Download URL grizabella-0.8.1.tar.gz
Size 192.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bd2852dec428734f6581ce63a254a20241a07ce864c830f24fdca79df6d71b8a
BLAKE2b-256 checksum
How to use checksums
2f7e18f1428c538cea78b1cb6d426b550381442eb7da905a9d427774db2685ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / grizabella-0.8.1-py3-none-any.whl

Download URL grizabella-0.8.1-py3-none-any.whl
Size 226.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3393d8eb73aa9fbded5a83c4f7fb7ce4890865536f641f41c089037f3845eede
BLAKE2b-256 checksum
How to use checksums
61ae1e724a4eba10f0b9385d3d3a0156b3c88260b7298f51d2a757ff59bebd2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for grizabella 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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