Skip to main content
PyPI version License Python 3.11+

pyeve is a filesystem-first framework for durable backend AI agents in Python. Core agent capabilities live in conventional locations, so projects are easier to inspect, extend, and operate.

The filesystem is the authoring interface

A pyeve agent is just three things:

my-agent/
└── agent/
    ├── agent.py            # model and adapter config
    ├── instructions.md     # always-on system prompt
    └── tools/              # functions the model can call
        └── search.py

No decorators. No schema classes. No custom adapters. pyeve wires it all together automatically.

Quick start

pip install "pyeve[mistral]"
pyeve init my-agent
cd my-agent
pyeve dev

Your agent is running at http://localhost:8000.

A minimal example

agent/instructions.md:

You are a concise weather assistant. Tell users that the weather data is mocked.

agent/tools/get_weather.py:

async def execute(city: str) -> dict:
    """Return current weather for a city."""
    return {"city": city, "condition": "Sunny", "temp_f": 72}

agent/agent.py:

from pyeve import define_agent
from pyeve.adapters.mistral import MistralAdapter

agent = define_agent(
    model="mistral-large-latest",
    adapter=MistralAdapter(),
)

Set your API key and start the server:

export MISTRAL_API_KEY=...
pyeve dev

Send a message:

curl -X POST http://localhost:8000/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "What is the weather in Berlin?"}'

Response streams as Server-Sent Events.

Tools are plain async functions

pyeve reads the docstring as the tool description and infers the JSON schema from type hints. No registration needed — any .py file in tools/ is auto-discovered.

# agent/tools/search.py
async def execute(query: str, limit: int = 5) -> list[dict]:
    """Search the knowledge base and return matching documents."""
    ...

SSE event stream

Each POST /chat response streams newline-delimited SSE events:

Event type Payload
token {"type": "token", "text": "..."}
tool_call {"type": "tool_call", "id": "...", "name": "...", "input": {...}}
tool_result {"type": "tool_result", "id": "...", "result": {...}}
done {"type": "done", "text": "<full response>"}
error {"type": "error", "message": "..."}

Durable sessions

Sessions are persisted to disk automatically. Resume a conversation by passing session_id:

curl -X POST http://localhost:8000/chat \
  -d '{"message": "Follow up question", "session_id": "user-123"}'

Retrieve history:

curl http://localhost:8000/sessions/user-123

Works with any Python framework

agent() returns a standard ASGI callable — mount it anywhere:

# FastAPI
from fastapi import FastAPI
from pyeve import agent

app = FastAPI()
app.mount("/", agent("./agent"))
# Standalone with uvicorn
import uvicorn
from pyeve import agent

uvicorn.run(agent("./agent"), port=8000)

Provider adapters

Provider Install Adapter
Mistral pip install "pyeve[mistral]" MistralAdapter()
SAP AI Core pip install "pyeve[sap]" SAPAICoreAdapter()

Testing

pyeve ships a MockAdapter and test client for unit testing agents without real API calls:

from pyeve.adapters.mock import MockAdapter
from pyeve.testing import AgentTestClient

async def test_weather_agent():
    client = AgentTestClient(
        agent_dir="./agent",
        adapter=MockAdapter(responses=["The weather in Berlin is sunny and 72°F."]),
    )
    response = await client.chat("What is the weather in Berlin?")
    assert "Berlin" in response.text

License

Apache 2.0

Metadata

Release files for pyeve 0.2.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 pyeve 0.2.0
File Size Uploaded Provenance Actions
pyeve-0.2.0.tar.gz 66.1 kB Without provenance Details for pyeve-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 85.7 kB

Release files / pyeve-0.2.0.tar.gz

Download URL pyeve-0.2.0.tar.gz
Size 66.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0212f28d03b2e3cec51217b61301b4c037dd5f7642f1d7a261181eb8be863acb
BLAKE2b-256 checksum
How to use checksums
5968e5401c77ee9c64b9c870a47f0bfa38fd358146beec64c065514d5a10c587
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / pyeve-0.2.0-py3-none-any.whl

Download URL pyeve-0.2.0-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbeced897823d7700859c14eda9839ed749f882d931e72fb14a831912e87a3bb
BLAKE2b-256 checksum
How to use checksums
51cb26b87290de03bbe11d9279f33f2bca58e5572376587b936173a018cefae7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for pyeve 0.2.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.

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