Skip to main content

GraphRAG cache package.

Project description

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

...

Project details


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.0.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.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: graphrag_cache-3.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":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.0.tar.gz
Algorithm Hash digest
SHA256 eb0688e14194562234c354212392dab3a171788603ef5544bbf7bb1580af96a4
MD5 3a4216e58a8d54c7a73b8f9ae55598f5
BLAKE2b-256 6d7f1190e3e36bda3c1fa85865f203bf09e32bf2e6d2fcafad9ae14a460b60e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graphrag_cache-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1cb4a3784e761809580585d97419d7aa4b88f7f5cb6b764f96c329cccf697b8
MD5 e313218ad5c397d387238939227478dd
BLAKE2b-256 78d6d20c7bc6dbf9f985dd00184d3cb6cee569a7907cc0339bc1a6bbd30d7fe6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page