Skip to main content

GraphRAG Cache

This package contains a collection of utilities to handle GraphRAG caching implementation.

Basic

This example shows how to create a JSON cache with file storage using the GraphRAG cache package's configuration system.

Open the notebook to explore the basic example code

Custom Cache

This example demonstrates how to create a custom cache implementation by extending the base Cache class and registering it with the GraphRAG cache system. Once registered, the custom cache can be instantiated through the factory pattern using either CacheConfig or directly via cache_factory, allowing for extensible caching solutions tailored to specific needs.

Open the notebook to explore the basic custom example code

Details

By default, the create_cache comes with the following cache providers registered that correspond to the entries in the CacheType enum.

  • JsonCache
  • MemoryCache
  • NoopCache

The preregistration happens dynamically, e.g., JsonCache is only imported and registered if you request a JsonCache with create_cache(CacheType.Json, ...). There is no need to manually import and register builtin cache providers when using create_cache.

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

from graphrag_cache.cache_factory import cache_factory
from graphrag_cache.json_cache import JsonCache

# cache_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.
cache_factory.register("my_cache_impl", JsonCache)

cache = cache_factory.create(
    strategy="my_cache_impl", init_args={"some_setting": "..."}
)

...

Download files

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

Source Distribution

graphrag_cache-3.1.2.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

graphrag_cache-3.1.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: graphrag_cache-3.1.2.tar.gz
  • Upload date:
  • Size: 7.0 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_cache-3.1.2.tar.gz
Algorithm Hash digest
SHA256 40dc0ce40028d1194e59ce32df4856b35b8c1e1ef1d508210ed8aaae67afb719
MD5 b7fbf880711ef6a1af2f994cfcec547e
BLAKE2b-256 fb5ef5d9aa3c1d49914346efc44ab784624d6b7b894d013f567929e298eeeb05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graphrag_cache-3.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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_cache-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8d6e0ca79bcc03fe103a5018fbd3f1524adf6a8bf2ff846293411fdc3a6f764d
MD5 3fce61fe6871e62631b9f224f109c521
BLAKE2b-256 760f2fec66313302b6dbe0f23f5fc9c55010f3e47bc246123869b78ebbbcf600

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