Skip to main content

Agendo

Deterministic row-level rollback engine for AI agents on Postgres 16.

Agendo sits between your AI agent and Postgres. Every agent write runs inside a transaction tagged with SET LOCAL agendo.action_id = '<uuid>', captured at the row level by a generic PL/pgSQL trigger (agendo_capture()). If the write turns out wrong, one click (or API call) atomically reverts only the rows that action touched—without tearing down or re-seeding the database.

Setup

  1. Configure environment variables:

    cp .env.example .env
    

    Edit .env if you want custom Postgres credentials or to set GEMINI_API_KEY for --live-gemini.

  2. Start Postgres 16 (loads sql/01_agendo.sql and demo/seed.sql into a named volume agendo_pgdata):

    docker compose up -d --wait
    
  3. Create a virtualenv and install Agendo in editable mode:

    python3 -m venv .venv
    source .venv/bin/activate
    pip install -e ".[dev]"
    

Environment Variables

  • POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB: Postgres container credentials (required by docker-compose.yml).
  • DATABASE_URL: Postgres connection string (e.g. postgresql://agendo:agendo_dev_password@localhost:5432/agendo).
  • GEMINI_API_KEY: Required only when running with --live-gemini (fails fast if unset).
  • GEMINI_FLASH_MODEL: Flash model ID for diagnostic summaries (defaults to gemini-3.8-flash).
  • GEMINI_REASONING_MODEL: Reasoning model ID for tool-called repair SQL (defaults to gemini-4-hydrogen).

Attaching Agendo to Your Own Tables

Any table with a PRIMARY KEY can be tracked with one SQL call (or agendo.attach_trigger("orders") in Python):

SELECT attach_agendo_trigger('your_table_name');

Run the Demo Scenario

  1. Start the demo server (core Agendo API + ESP32 /bench router + Postgres-persisted serial push hook):

    uvicorn demo.app:app --reload --port 8000
    

    (For the pure hardware-agnostic core API without /bench, run uvicorn agendo.api:app --port 8000.)

  2. Open http://localhost:8000 to see the healthy ESP32 test bench (esp32-bench-01).

  3. Run the self-contained ESP32 demo loop (corrupts GPIO12, disables I2C pull-ups, wipes 2 calibration rows → runs diagnose + repair → auto-reverts → feeds REVERT NOTICE back and verifies skip):

    # Deterministic offline full loop:
    python -m demo.run_demo
    
    # Live Gemini full loop using v1beta function calling (requires GEMINI_API_KEY):
    python -m demo.run_demo --live-gemini
    
    # Pause after repair without auto-reverting (to click Revert in the UI):
    python -m demo.run_demo --no-revert
    
  4. Refresh http://localhost:8000, inspect the red/green JSON diff, and click Revert (or see demo/script.md).

Run the Acceptance Tests

pytest -v

Metadata

Release files for agendo 0.1.0

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

Source distribution (sdist)

Source distribution for agendo 0.1.0
File Size Uploaded Provenance Actions
agendo-0.1.0.tar.gz 603.5 kB Without provenance Details for agendo-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agendo 0.1.0
File Interpreter ABI Platform Actions
agendo-0.1.0-py3-none-any.whl Python 3 none any Details for agendo-0.1.0-py3-none-any.whl

Total release size: 628.6 kB

Release files / agendo-0.1.0.tar.gz

Download URL agendo-0.1.0.tar.gz
Size 603.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d3dfac3bb818ab1bd7149a02dc7f5ffd4398837031f67e89f2a1a4aeb3ec2142
BLAKE2b-256 checksum
How to use checksums
41afa5268118f968129b343c69c1caa7a11568a90f665172a43b26aa17134eb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / agendo-0.1.0-py3-none-any.whl

Download URL agendo-0.1.0-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df566827b62a73e13cc1e53dccbeac691a49be5914e856b5e1fde37c508399df
BLAKE2b-256 checksum
How to use checksums
c7f624bfb416a4c77bc9ed3426ccd8bdb591728d2748d77f4850254dbabaf362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for agendo 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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