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": "..."}
)

...

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphrag_storage-3.1.2.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphrag_storage-3.1.2-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file graphrag_storage-3.1.2.tar.gz.

File metadata

  • Download URL: graphrag_storage-3.1.2.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • 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":null}

File hashes

Hashes for graphrag_storage-3.1.2.tar.gz
Algorithm Hash digest
SHA256 e7a124aa89a88b8388a7d070f732a77825389f469a6ddb4c150d376854ddfedf
MD5 3c7f6cd86e834d8cc3e391cae7b1f5ed
BLAKE2b-256 514ee7ed5321279eda9c17124d3096238fd0c4b03f3a2fd4b57cf7408d896180

See more details on using hashes here.

File details

Details for the file graphrag_storage-3.1.2-py3-none-any.whl.

File metadata

  • Download URL: graphrag_storage-3.1.2-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • 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":null}

File hashes

Hashes for graphrag_storage-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 48c763c98b20e27ab9e860c7fe1b22d4fd934761768e522132f2b36e337eee6e
MD5 fe02d1bedbabb51d9099b14074b6249d
BLAKE2b-256 056a12a8cc2057ad375808f5acff6c5afec75dc48cc3ab4ca8e21263578e0285

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.1.2 This release

2 files

3.1.1

2 files

3.1.0

2 files

3.0.9

2 files

3.0.8

2 files

3.0.7

2 files

3.0.6

2 files

3.0.5

2 files

3.0.4

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 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