Skip to main content

GraphRAG Storage

This package provides a unified storage abstraction layer with support for multiple backends including file system, Azure Blob, Azure Cosmos, and memory storage. It features a factory-based creation system with configuration-driven setup and extensible architecture for implementing custom storage providers.

Basic

This example creates a file storage system using the GraphRAG storage package's configuration system. The example shows setting up file storage in a specified directory and demonstrates basic storage operations like setting and getting key-value pairs.

Open the notebook to explore the basic storage example code

Custom Storage

Here we create a custom storage implementation by extending the base Storage class and registering it with the GraphRAG storage system. Once registered, the custom storage can be instantiated through the factory pattern using either StorageConfig or directly via storage_factory, enabling extensible storage solutions for different backends.

Open the notebook to explore the custom storage example code

Details

By default, the create_storage comes with the following storage providers registered that correspond to the entries in the StorageType enum.

  • FileStorage
  • AzureBlobStorage
  • AzureCosmosStorage
  • MemoryStorage

The preregistration happens dynamically, e.g., FileStorage is only imported and registered if you request a FileStorage with create_storage(StorageType.File, ...). There is no need to manually import and register builtin storage providers when using create_storage.

If you want a clean factory with no preregistered storage providers then directly import storage_factory and bypass using create_storage. The downside is that storage_factory.create uses a dict for init args instead of the strongly typed StorageConfig used with create_storage.

from graphrag_storage.storage_factory import storage_factory
from graphrag_storage.file_storage import FileStorage

# storage_factory has no preregistered providers so you must register any
# providers you plan on using.
# May also register a custom implementation, see above for example.
storage_factory.register("my_storage_key", FileStorage)

storage = storage_factory.create(
    strategy="my_storage_key", init_args={"base_dir": "...", "other_settings": "..."}
)

...

Metadata

Release files for graphrag-storage 3.3.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 graphrag-storage 3.3.0
File Size Uploaded
graphrag_storage-3.3.0.tar.gz 30.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphrag-storage 3.3.0
File Interpreter ABI Platform
graphrag_storage-3.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 66.7 kB

Release files / graphrag_storage-3.3.0.tar.gz

Download URL graphrag_storage-3.3.0.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d8940668e0c7ada7ab9b85b76721caf278bc2ab30f85482fdc76e257c9f1fa82
BLAKE2b-256 checksum
How to use checksums
2efa9d15e4eeda8d9249c2554662484f5651a89877339d674ac549cc4ddf3f79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Release files / graphrag_storage-3.3.0-py3-none-any.whl

Download URL graphrag_storage-3.3.0-py3-none-any.whl
Size 35.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adc62283bf9ce9189bd143dac70744c37016125aa9a01d6d9ffe8e3abb47ab63
BLAKE2b-256 checksum
How to use checksums
80d738f866bca6cb408d3a4cf2c1d6b2f1fb9ab86ec53f17ec43d5dd1da66057
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Release history Release notifications | RSS feed

This release

3.3.0 This release

2 release files

3.2.0

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.9

2 release files

3.0.8

2 release files

3.0.7

2 release files

3.0.6

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

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