Skip to main content

Rungent

Rungent is a small, typed agent runtime that embeds into an existing Python application. It standardizes tool calling, the harness loop, durable sessions and runs, user interactions, deterministic approval gates, and an SSE event protocol. The same tools can be mounted as an optional MCP adapter for external agents; OAuth stays in the host application.

Its headless activity protocol exposes model steps, safe public progress, tools, and interactions as persisted events. It never exposes raw provider reasoning or hidden chain of thought.

from typing import Annotated

from rungent import Agent, RunActivity, Runtime, ToolContext, ToolResult, tool
from rungent.llm import OpenAICompatibleModel
from rungent.store import MemoryStore


@tool(effect="write", approval="never")
async def move_place(
    ctx: ToolContext,
    name: Annotated[str, "Exact place name"],
    day_number: Annotated[int | None, "Target day; null means unplanned"],
) -> ToolResult:
    await ctx.deps["trips"].move(ctx.resource["trip_id"], name, day_number)
    return ToolResult(message=f"Moved {name}")


agent = Agent(
    name="trip_planner",
    instructions="Help the user update their trip. Use tools for every change.",
    tools=[move_place],
    run_activity=lambda _ctx, _content: RunActivity(
        message="Received the request",
        waiting_message="Still preparing; no changes have been made",
        long_wait_message="The request is detailed; still preparing",
        continuation_message="Preparing the result",
    ),
)

runtime = Runtime(
    agents=[agent],
    model=OpenAICompatibleModel(
        api_key="...",
        base_url="https://api.openai.com/v1",
        model="gpt-5-mini",
    ),
    store=MemoryStore(),
)

Documentation: rungent.github.io. Source lives in docs/ and is rendered by the Fumadocs app in apps/docs.

AI coding agents should start with RUNGENT.md, then load llms.txt or the full dump llms-full.txt. Per-page raw Markdown is at https://rungent.github.io/markdown/<page>.md.

Development

uv sync --all-extras
uv run pytest -W error
uv run ruff check src tests

pnpm install
pnpm dev:docs
pnpm test
pnpm build

The public site is rungent.github.io. After docs changes land on main, run Publish on rungent/rungent.github.io (or set repo secret GH_PAGES_TOKEN so CI can trigger that workflow). The org disables deploy keys, so the pages repo rebuilds from this repository with its own GITHUB_TOKEN.

Release

rungent (PyPI) and @rungent/sdk (npm) share one semver. Publishing is done by GitHub Actions on v* tags — do not uv publish / npm publish from your laptop.

./scripts/release.sh 0.2.0
git push origin main --tags

One-time Trusted Publishing setup: see RELEASING.md.

Metadata

Release files for rungent 0.3.6

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

Source distribution (sdist)

Source distribution for rungent 0.3.6
File Size Uploaded
rungent-0.3.6.tar.gz 44.5 kB Details

Built distribution (wheel)

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

Total release size: 96.6 kB

Release files / rungent-0.3.6.tar.gz

Download URL rungent-0.3.6.tar.gz
Size 44.5 kB
Tags Source
SHA-256 checksum
How to use checksums
01ceb8bf2b6781ab41dda6a27a0058e1a6a81201b63cbdd0e57aa322083fa7cc
BLAKE2b-256 checksum
How to use checksums
7d81483c3a2dc17db7bc5ea8d8b8aabf6e5f2970dccf2602d411dd89e36b9650
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / rungent-0.3.6-py3-none-any.whl

Download URL rungent-0.3.6-py3-none-any.whl
Size 52.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b7d85fbbb94a7eb83c05d320f2588c3cd0519ae5250e43a1e203327fcfcff05
BLAKE2b-256 checksum
How to use checksums
426c768d3e14e0c5911688d5377d7c8c6e96d75462928e3af295f5ebc2fd9d28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.3.6 This release

2 release files

0.3.4

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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