Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

redis-agent-lens

Python management and read clients for Redis Lens. This alpha prerelease contains the control-plane and data-plane REST APIs. Telemetry collection and OTel instrumentation are owned by redis-iris. This package does not import OpenTelemetry, initialize tracing, or export spans.

Installation and status

Prepared version: 0.1.0a3. Not published by this change.

pip install redis-agent-lens==0.1.0a3

Install after publication; pin alpha versions. Breaking changes may occur between alpha releases. Redis AI documentation and package page.

Two independently configured clients

LensService manages the deployment/account's singleton instance. Lens reads one instance. Configure each URL and credential explicitly. Cloud instance responses include endpoint candidates and accessibility metadata; select an appropriate endpoint for the deployment. The package does not select an endpoint or mint a read key.

from redis_agent_lens import Lens, LensService

with LensService(server_url=service_url, token=service_token) as service:
    instance = service.get_instance()

with Lens(server_url=read_url, instance_id=instance.instance_id, api_key=read_key) as lens:
    agents = lens.list_agents()
    sessions = lens.list_sessions(agent_id="support-bot", range="24h")

LensService has get/update instance and cloud-only register/delete instance, list databases, and get network info for control-plane egress allow-listing. Call list_databases() once and select databases whose eligible_roles contain records or content; the request takes no role filter. An empty role list means the database is not ready or cannot fill either role. Records require a Pro or Essentials RAM database; content can use RAM or Flex. Readiness and control-plane accessibility are also returned; registration still performs live checks. On-prem instances are provisioned at startup and have no registration, deletion or discovery routes. Cloud responses include database bindings and endpoint candidates; on-prem get/update responses omit them. Cloud get/update/register/delete and database discovery require the operator JWT, matching SM JSESSIONID cookie and CSRF token. Use a session-aware transport/fetcher to supply these on every request. Network info requires operator read authority. Dependent-resource failures return a typed 424 error across all six management operations.

Cloud registration returns HTTP 201 and creates a new instance ID. Registering when an instance already exists returns a typed 409 conflict, even for the same databases. To change databases, call delete_instance(x_csrf_token=csrf_token) and then register again. Deletion returns no value (HTTP 204); deleting an absent instance, including retrying after success, raises a typed 404. Deletion removes Lens data from reachable bound databases and skips unreachable or deleted databases. Keys for the deleted instance stop working; mint keys for the new instance ID after registering again. The async method is delete_instance_async().

For cloud database selection:

with LensService(server_url=service_url, token=service_token) as service:
    databases = service.list_databases().databases
    records_databases = [db for db in databases if "records" in db.eligible_roles]

Lens has list agents, list sessions, get session, get turn, get content, and get Context Retriever result. instanceId is bound on the client. Session lists require agent and range, support repeated outcome filters, and expose the opaque next cursor without promising snapshot isolation. Preserve the filters across pages. Session detail currently returns retained turn summaries together; the server rejects sessions over its current 10,000-turn cap.

Turn IDs are OTel trace IDs. Turn detail includes component observations and content references. Fetch content separately and inspect availability before using its body: expired/not-captured/masked are valid states, not HTTP failures. The wire envelope contains base64 bytes. The generated body representation is shown in the operation/model reference; no implicit text or JSON parsing occurs.

Credentials and transports

  • DP accepts a Bearer instance key with read or full. Cloud UI reads also accept an SM JWT with Lens read authority and matching tenant; supply it via the same api_key/apiKey option. SM JWTs do not authorize OTLP ingest.
  • CP uses token; its fallback is LENS_SERVICE_TOKEN.
  • DP fallback is LENS_API_KEY. Neither client reads the existing instrumentation credential IRIS_LENS_API_KEY or falls back to the other plane.
  • Clients support independent transports, callable credentials, timeouts, and explicit retry configuration. Retries are not enabled by default.
  • CP models/errors live under redis_agent_lens.controlplane; DP models/errors retain their own namespace.

Python supports sync/async methods (async suffix _async), context managers, and caller-owned HTTP clients. The SDK takes a service root. For a gateway that already inserts /v1/instances/<id>, adapt its fetcher to avoid duplicating that prefix.

See DP operations and CP operations. Internal grant callbacks, Identity key lifecycle, OTLP ingestion, and planned backend APIs are excluded. Use redis-iris for telemetry collection and instrumentation.

Metadata

Release files for redis-agent-lens 0.1.0a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redis-agent-lens 0.1.0a3
File Size Uploaded Provenance
redis_agent_lens-0.1.0a3.tar.gz 86.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for redis-agent-lens 0.1.0a3
File Interpreter ABI Platform
redis_agent_lens-0.1.0a3-py3-none-any.whl Python 3 none any Details

Total release size: 265.5 kB

Release files / redis_agent_lens-0.1.0a3.tar.gz

Download URL redis_agent_lens-0.1.0a3.tar.gz
Size 86.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d433dbea5b4f6c5f51223a1a53b1f397f1dc69a3d7524fff90f22bacd2e17a9e
BLAKE2b-256 checksum
How to use checksums
d0cb3088651ed0f9d9cfc29e6a49155b87f418e8f07e30bcf00e5857cfb3d6f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.22 Linux/6.8.0-1064-azure

Release files / redis_agent_lens-0.1.0a3-py3-none-any.whl

Download URL redis_agent_lens-0.1.0a3-py3-none-any.whl
Size 178.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed92e875183980aa1b1f7a85198515436aa8669db3bc2d8ee3f63cefc8c4759a
BLAKE2b-256 checksum
How to use checksums
10a475eb663519c937a2e8a571fe2653a59fe5c38484357d8d27b2424ffc8327
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.22 Linux/6.8.0-1064-azure

Security for redis-agent-lens 0.1.0a3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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