Redis implementation of the Store interface for ai-agentswarm.
Project description
agentswarm-redis-store
Redis implementation of the Store interface for ai-agentswarm.
Security Configuration
This project focuses on secure Redis connections. It supports:
- SSL/TLS: For encrypted communication.
- ACL/Passwords: For authenticated access.
- Safe Serialization: Uses JSON by default for structured data.
Installation
pip install agentswarm-redis-store
Local Development
If you are working on the source code:
# Clone the repository
cd agentswarm-redis-store
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install in editable mode
pip install -e .
Security Focus
The RedisStore is designed with security as a primary concern:
- SSL/TLS: Mandatory for production environments to prevent eavesdropping.
- Authentication: Supports both legacy
passwordand modern Redis 6+username/passwordACLs. - Secure Reconstruction:
to_dict()returns a minimal configuration that triggers reconstruction from environment variables on the remote side, ensuring sensitive credentials are never serialized or transmitted. - Client Injection: Allows passing a pre-configured
redis.Redisclient for advanced use cases (e.g., custom pooling, sentinel).
Configuration Environment Variables
When using RedisStore.from_env() or remote reconstruction, the following environment variables are supported:
| Variable | Description | Default |
|---|---|---|
REDIS_HOST |
Redis server hostname | localhost |
REDIS_PORT |
Redis server port | 6379 |
REDIS_DB |
Redis database number | 0 |
REDIS_USERNAME |
Username for ACL authentication | None |
REDIS_PASSWORD |
Password for authentication | None |
REDIS_SSL |
Enable SSL/TLS connection (true/false) |
false |
Usage
Environmental Configuration (Recommended)
Set REDIS_HOST, REDIS_PASSWORD, etc., in your environment and use:
from agentswarm.redis.store import RedisStore
store = RedisStore.from_env()
Direct Client Injection
import redis
from agentswarm.redis.store import RedisStore
client = redis.Redis(host="localhost", db=0)
store = RedisStore(redis_client=client)
Remote Reconstruction
store = RedisStore.from_env()
config = store.to_dict() # Returns {"recreate_from_env": True}
# On a remote machine (with its own REDIS_HOST env var)
remote_store = RedisStore.recreate(config)
Integration with Agentswarm
You can use the RedisStore as the backend for the agentswarm.Context:
from agentswarm.redis.store import RedisStore
from agentswarm.datamodels.context import Context
# 1. Initialize the store (e.g., from environment)
store = RedisStore.from_env()
# 2. Inject into the Context
context = Context(
trace_id="my-unique-trace",
messages=[],
store=store,
tracing=my_tracing_instance
)
# 3. Use as usual
context.store.set("key", "value")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentswarm_redis_store-0.1.0.tar.gz.
File metadata
- Download URL: agentswarm_redis_store-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed2e155cf325bd3141735c804fcc947272b01be65ee3607deb8ca141b14895c1
|
|
| MD5 |
9aba6170842c8941b43f776babb48bde
|
|
| BLAKE2b-256 |
108fc1bfc37b6a06a2052f0eaef18ef8114132c0b7a47c59642f33cb4dbb86d4
|
Provenance
The following attestation bundles were made for agentswarm_redis_store-0.1.0.tar.gz:
Publisher:
publish.yml on ai-agentswarm/agentswarm-redis-store
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentswarm_redis_store-0.1.0.tar.gz -
Subject digest:
ed2e155cf325bd3141735c804fcc947272b01be65ee3607deb8ca141b14895c1 - Sigstore transparency entry: 863046347
- Sigstore integration time:
-
Permalink:
ai-agentswarm/agentswarm-redis-store@df8e658cdc1c9a227c3368063f0e40b5cb1daa28 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-agentswarm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@df8e658cdc1c9a227c3368063f0e40b5cb1daa28 -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentswarm_redis_store-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentswarm_redis_store-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51c8799a76f720ae8bf35eca65fbf1f2877798e671927f300eb8be0d7d67881d
|
|
| MD5 |
405b84588acd3b8099791adfef2eb4bd
|
|
| BLAKE2b-256 |
8792ba66e6acf6760c9361fa575462a056e149c03c6721fe79e87d0d32fe0e2f
|
Provenance
The following attestation bundles were made for agentswarm_redis_store-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ai-agentswarm/agentswarm-redis-store
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentswarm_redis_store-0.1.0-py3-none-any.whl -
Subject digest:
51c8799a76f720ae8bf35eca65fbf1f2877798e671927f300eb8be0d7d67881d - Sigstore transparency entry: 863046348
- Sigstore integration time:
-
Permalink:
ai-agentswarm/agentswarm-redis-store@df8e658cdc1c9a227c3368063f0e40b5cb1daa28 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ai-agentswarm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@df8e658cdc1c9a227c3368063f0e40b5cb1daa28 -
Trigger Event:
release
-
Statement type: