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.0a2. Not published by this change.

pip install redis-agent-lens==0.1.0a2

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 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 or discovery routes. Cloud responses include database bindings and endpoint candidates; on-prem get/update responses omit them. Cloud get/update/register 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 five management operations.

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.0a2

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.0a2
File Size Uploaded Provenance
redis_agent_lens-0.1.0a2.tar.gz 85.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 262.8 kB

Release files / redis_agent_lens-0.1.0a2.tar.gz

Download URL redis_agent_lens-0.1.0a2.tar.gz
Size 85.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8b9f190ea9fc1ec7d321b6679bac3a90824750393ab537a722d39a6f86844dea
BLAKE2b-256 checksum
How to use checksums
a6516e305870eebe512c4ad876a2a7abbe8d6ea37d2d0be5c86650d0525ac4ac
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-1070-azure

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

Download URL redis_agent_lens-0.1.0a2-py3-none-any.whl
Size 177.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73c2ac41dfa519ab513613e097e7836ae7a06e8f42a4d9483f64f7a4915aa5cd
BLAKE2b-256 checksum
How to use checksums
755f9a6184cde2e55a124ad474f0bb0c568887f0defbee72aa633e21200a1c36
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-1070-azure

Security for redis-agent-lens 0.1.0a2

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