Skip to main content

xyberos-redis

Redis plugin — RFC-0019, M4. RedisVectorStore + RedisMemory + cache backing for CacheResponder, all lazy-importing redis. Covers the [state] extra scope (cache + state + vector).

Install

pip install -e ./redis
pip install redis               # or: pip install xyberos[state]

Usage

from xyberos import create_app
from xyberos_redis import RedisPlugin

app = create_app()
app.load_plugin(RedisPlugin(url="redis://localhost:6379"))   # or set REDIS_URL

vector = app.resolve("redis_vector")     # a VectorStore
memory = app.resolve("redis_memory")     # a Memory
cache  = app.resolve("redis_cache")      # exact-match string cache

RedisPlugin(replace_defaults=True) also swaps the app's vector_store / memory providers.

CacheResponder backing

RedisVectorStore is a full VectorStore, so it plugs straight into the core CacheResponder for near-exact prompt -> answer caching:

from xyberos.llm import HashEmbedder
from xyberos.router import CacheResponder
from xyberos_redis import RedisVectorStore

responder = CacheResponder(store=RedisVectorStore(url="redis://localhost:6379"),
                           embedder=HashEmbedder())
responder.teach("what is xyberos?", "a cognitive platform")

Design

  • RedisVectorStore — one Redis hash per namespace; vectors JSON-encoded; queries scored with exact cosine (the same scan-and-score approach as the stdlib SqliteVectorStore, so behavior — and parity — holds without needing a RediSearch vector module).
  • RedisMemory — one entry per store() appended to a Redis list; retrieve() returns MemoryEntrys oldest-first, mirroring SqliteMemory.
  • RedisStringCache — tiny exact-match get/set/delete with optional TTL.
  • redis is imported lazily; a clear ProviderError is raised when missing.

Tests

pip install pytest fakeredis
pytest tests/

Tests run against fakeredis (an in-memory redis-py client), so they need no Redis server; they skip cleanly when redis/fakeredis are absent. The vector parity tests run the exact scenarios the SqliteVectorStore reference passes.

Ship location

[state] extra (redis already added to pyproject.toml).

Download files

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

Source Distribution

xyberos_redis-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

xyberos_redis-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file xyberos_redis-0.1.0.tar.gz.

File metadata

  • Download URL: xyberos_redis-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for xyberos_redis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c86853fb6aa41f6064831e793fa8add124fc65a9e287e1f99228f9ae0c770c20
MD5 498881810f7b3d2621455f5157518076
BLAKE2b-256 ed9a165448ca7f1ce2739ae8e0a9d77d9007da6b46d4981ea25847d80faf5d3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for xyberos_redis-0.1.0.tar.gz:

Publisher: pypi-plugins.yml on xyberos/xyberos-plugins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xyberos_redis-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xyberos_redis-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for xyberos_redis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32c2953c3fb5d5de1f205afed84ef2962c3b0a29014a3f980a38bcc73d67941a
MD5 520d0bd205634e6a529b2108364204a3
BLAKE2b-256 a6321aa82c9ea2fc8069a7acb180ba7ce2e6dc77adae23dfa32064bc0e5d4aa9

See more details on using hashes here.

Provenance

The following attestation bundles were made for xyberos_redis-0.1.0-py3-none-any.whl:

Publisher: pypi-plugins.yml on xyberos/xyberos-plugins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

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