Skip to main content

Stateless memory-compression layer for autonomous AI agents

Project description

agentgc-bindings

FFI surface for AgentGC — Python (via uniffi) today, TypeScript via uniffi-bindgen-react-native or napi-rs to follow.

What's exposed

A concrete-type binding: SqliteStorage + AzureOpenAIClient. Other storage/LLM combinations need their own constructor variants (or future binding crates) because uniffi works best with concrete types and AgentGC's native AFIT trait isn't directly object-safe.

The Python surface mirrors crates::agentgc_core::AgentGC's methods:

import asyncio
from agentgc import AgentGC

async def main():
    # Async alternate constructor — Python's __init__ can't be async,
    # so uniffi maps the async constructor to AgentGC.open(...).
    gc = await AgentGC.open(
        sqlite_url="sqlite:agent.db",
        azure_endpoint="https://your-resource.cognitiveservices.azure.com",
        azure_api_key="...",
        azure_deployment="gpt-5.5",
        azure_api_version="2025-04-01-preview",
        model="gpt-5.5",
    )

    memory = await gc.extract("user:alice", "I prefer dark mode")
    if memory is not None:
        print(memory.content)

    matches = await gc.retrieve("user:alice", "dark", 10)
    state = await gc.consolidate("main", "noisy log here...")
    print(state.learned_rules)
    if state.active_task is not None:
        print(state.active_task.intent, state.active_task.status)

asyncio.run(main())

Build the Python wheel

We use maturin (recommended for Rust+Python projects). From this directory:

# uv environment with maturin
uv venv
uv pip install maturin

# Build a wheel for the current platform
uv run maturin build --release

# Or develop-install for iteration
uv run maturin develop --release

The wheel lands in target/wheels/. Install with:

uv pip install target/wheels/agentgc-*.whl

Generate UDL bindings manually

If you need raw uniffi bindings without maturin's wheel pipeline:

# Build the dylib first
cargo build --release

# Generate Python bindings from the UDL
cargo run --bin uniffi-bindgen -- \
    generate src/agentgc.udl \
    --language python \
    --out-dir bindings/python

This produces agentgc.py plus a .dylib / .so / .dll that must be on LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH on macOS).

Status

  • ✅ Crate scaffolding, UDL definition, Rust wrappers compile.
  • ⏳ Python wheel build verification (requires maturin + Python env).
  • ⏳ TypeScript bindings (defer until Python is in users' hands).
  • ⏳ Integration tests against a real Azure OpenAI key (manual smoke test).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

agentgc-0.0.3-py3-none-win_amd64.whl (4.5 MB view details)

Uploaded Python 3Windows x86-64

agentgc-0.0.3-py3-none-musllinux_1_2_x86_64.whl (5.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

agentgc-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

File details

Details for the file agentgc-0.0.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: agentgc-0.0.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentgc-0.0.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b80491a2522ce162598fff93c63f9fc28083b4e68f379142ce6a3332c8f6dd04
MD5 eadb0cab3822356f9ebb542ac658601c
BLAKE2b-256 01ff3977b1c595c61653810bdb567470e9fb4f72b9ba1f1030bcbd84eddac557

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentgc-0.0.3-py3-none-win_amd64.whl:

Publisher: publish-python-wheels.yml on carrickcheah/agentgc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentgc-0.0.3-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for agentgc-0.0.3-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 16e9ddedb7bc5a933d6b42504dcbe583ec2bb5ff45a6164bcdb060e63442598d
MD5 4ca93bc0e3505fa5639a0ebb65bf9e30
BLAKE2b-256 316f2b4a72ead105fc8698e00aa13641a8df0c9a23004fc5bbdfe954bc516ba2

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentgc-0.0.3-py3-none-musllinux_1_2_x86_64.whl:

Publisher: publish-python-wheels.yml on carrickcheah/agentgc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentgc-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for agentgc-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 43be7862a2f784efb1f889ce9392cd5a3958ce49f02890f332fbf5f4b8e69823
MD5 056325e154e385b7230d8574c69247c0
BLAKE2b-256 8da49603343c7acb9a1151209331720a680be75c6a690eea1a0b907d142e93a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentgc-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-python-wheels.yml on carrickcheah/agentgc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page