Skip to content

redbco/redb-python-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reDB Python SDK

Context delivery for autonomous agents. Not an ORM.


What this is

The reDB Python SDK is a client library for building autonomous agents and agent-based systems that need governed, explainable, real-time access to data across databases, data warehouses, streams, and APIs.

Instead of exposing raw tables or objects, the SDK delivers context:

  • Typed and schema-aware
  • Policy-enforced and purpose-bound
  • Traceable with full provenance
  • Consistent across the entire reDB mesh

This SDK is designed for AI agents, not applications that manually manage data access.


What this is not

This is not:

  • ❌ an ORM
  • ❌ an object–table mapper
  • ❌ a persistence framework
  • ❌ a query builder
  • ❌ a replacement for SQL

There are:

  • no models
  • no sessions
  • no implicit joins
  • no .save() or .delete()
  • no database-specific abstractions

If you are looking for an ORM, this is the wrong tool.


The mental model: Context, not objects

Traditional tools ask:

“How do I map database rows into objects?”

reDB asks:

“What context does an agent need to reason and act correctly?”

The SDK delivers Context Bundles, not entities.

A Context Bundle includes:

  • logical schema and full type information
  • semantic and sensitivity classifications (PII, PHI, etc.)
  • policy effects (what was masked or filtered, and why)
  • provenance and lineage (where the data came from)
  • time, freshness, and snapshot semantics

This allows agents to reason safely, reproducibly, and audibly.


Core primitives

The entire SDK revolves around three primitives:

1. Fetch context

ctx = client.context.fetch(
    view="support_case_v3",
    keys={"case_id": "C-123"},
    purpose="support_assist"
)

You do not fetch tables.
You request purpose-bound context views.


2. Subscribe to events (agent triggers)

for task in client.agent(pool="fraud.reviewers", purpose="fraud_review"):
    ctx = task.context(view="fraud_signals_v2")
    decision = run_agent(ctx)
    client.emit("orders.actions", decision, idempotency_key=task.id)
    task.ack()

The reDB mesh:

  • ingests events
  • load-balances them across agent instances
  • expands context consistently
  • handles retries, backpressure, and failures

3. Emit actions and facts

client.emit(
    product="orders.actions",
    event={
        "order_id": "...",
        "action": "FLAG_FOR_REVIEW",
        "confidence": 0.93
    }
)

Agents emit facts and decisions.
They do not mutate databases directly.


Built for agent systems, not single processes

The reDB mesh is instance-aware.

Every SDK client:

  • registers itself as an application instance
  • is tracked individually by the mesh
  • can be load-balanced automatically
  • is auditable down to the exact runtime

This enables:

  • horizontal scaling of agents
  • built-in load balancing
  • safe retries and reprocessing
  • per-instance governance and quotas

No external schedulers required.


Why this is different from everything else

Capability ORMs Data APIs reDB SDK
Cross-database context ⚠️
Streams as first-class ⚠️
Purpose-bound access
Policy-aware results
Provenance & audit
Agent load balancing
Instance-level identity

This SDK is not a thinner abstraction over databases.
It is a new interface layer between data and autonomous systems.


Architecture overview (high level)

  • The SDK communicates with the reDB mesh over a typed, streaming protocol
  • All governance, policy enforcement, and routing happen inside the mesh
  • The SDK remains lightweight, declarative, and explicit

Agents describe intent.
The mesh handles execution, safety, and scale.


When you should use this

Use the reDB Python SDK if:

  • you are building AI agents or agent systems
  • data spans multiple databases, streams, or APIs
  • governance, auditability, and explainability matter
  • scaling agents is painful today
  • you want a consistent interface across environments

When you should not

Do not use this if:

  • you only need CRUD access to a single database
  • you want to manage joins, transactions, and persistence manually
  • you are building a traditional request/response application

Status

This SDK is under active development.

The public API is being designed carefully to avoid ORM-like patterns and to remain stable as the reDB mesh evolves.


One sentence summary

reDB Python SDK delivers governed, explainable context to autonomous agents — and scales them by design.

About

Context delivery for autonomous agents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages