PUBLISHED ON PYPI·v1.10.1

Runtime harness for building AI agents.

An open-source, provider-agnostic runtime for building AI agents.

Token streaming, stateful & stateless paradigms, thinking flags, native context compaction, async execution, MCP, and <1µs telemetry.

$pip install "evidor[openai]"
app /agent.py
from evidor import Agent, OpenAIProvider
agent = Agent(
OpenAIProvider(model="gpt-4.1-mini"),
)
response = agent.send(
"Explain dependency inversion."
)
print(response.text)
DATA FLOW
ApplicationEvidor HarnessOpenAI
PHILOSOPHY

A runtime harness, not another wrapper.

Evidor provides the operational runtime layer between your application and underlying LLM providers. Rather than masking provider APIs with bloated abstractions, it provides deterministic context compaction, MCP server connectivity, unified retries, and non-blocking telemetry.

Two Execution Paradigms

Stateful conversations (Agent) manage turn continuation and tool loops automatically. Stateless calls (provider.generate) give full control with zero hidden state.

Agent.send() • provider.generate()

Native Provider Compaction

Context management is offloaded directly to model providers at compact_threshold using server-side chaining on OpenAI and Gemini, and prompt caching on Claude.

compact_threshold • Server-Side Chaining

Thinking & Reasoning Flags

First-class reasoning configurations for GPT-6, Claude, and Gemini with internal scratchpad access via response.thinking and cryptographic signature replaying.

thinking_level • effort • budget

Streaming & Concurrent Tools

Real-time token streaming with TTFT tracking, concurrent multi-tool turns via asyncio.gather(), persistent connection pooling, MCP, and a non-blocking <1µs telemetry actor.

stream=True • TTFT • asyncio.gather
CORE SPECIFICATION

Verified Capabilities

Production capabilities implemented in evidor-core v1.10.1 and published on PyPI.

Published PyPI Package v1.10.1
v1.10.1 production ready

Token Streaming Enginev1.10.1 Engine

Stream tokens in real time across OpenAI, Gemini, and Anthropic with unified syntax. Tool arguments accumulate silently in the background without polluting the text stream, thinking tokens stream via chunk.thinking, and latency is tracked with precise TTFT metrics.

agent.send("Debugging quote", stream=True)
TTFT: 124.6msgpt-6-astra
Click "Simulate Stream" to test live token dispatch...
Tokens: 0 / 33
stream=True & stream.time_to_first_token_msView Streaming Guide

Two Execution ParadigmsCore Architecture

Recommended for conversational agents. Maintains conversation memory across turns without re-passing the entire message history each time. Evidor handles server-side chaining and autonomous tool loops.

Agent(provider) // Session MemoryTurn 2 Delta Only
Turn 1: agent.send("My favorite color is navy blue.")
Turn 2: agent.send("What color did I say I like?")
"You said your favorite color is navy blue." (Chained natively via agent.strategy)
agent.send() / send_async()View Architecture Guide

Native Provider Compaction

Context management and turn compaction are offloaded directly to model providers rather than hitting artificial local limits.

STRATEGY: response_chaincompact_threshold=100000
Chains turns via Responses API previous_response_id. Server-side compaction preserves opaque summary states.
compact_threshold=100000Docs

Configurable Thinking & ReasoningGPT-6 • Claude • Gemini

First-class reasoning configuration via typed configs or intuitive shorthands. Inspect intermediate scratchpads via response.thinking, track reasoning tokens, and automatically replay cryptographic signatures across multi-turn tool loops.

OpenAIProvider(model="gpt-6-astra", thinking="high")Cryptographic Signatures Preserved
INTERNAL SCRATCHPAD (response.thinking):
"1. Analyzing dependencies... 2. Inverting interface contract... 3. Verifying signature..."
Reasoning Tokens: 384Tool Calls Verified & Signed
response.thinking & response.usage.reasoning_tokensView Thinking Guide
asyncio.gather

Concurrent Multi-Tool Engine

When an LLM emits multiple tool calls in a single turn, Evidor dispatches them concurrently via asyncio.gather(), slashing turn latency in complex multi-step workflows.

DISPATCH: Single TurnParallel (Concurrent)
⚡ fetch_user_profile(id=42)
⚡ fetch_recent_orders(id=42)
Event loop guards raise RuntimeError if sync calls are misused.
await agent.send_async(...)Docs

Model Context Protocol (MCP)stdio • HTTP • SSE

Connect agents seamlessly to external MCP servers with automatic tool discovery, argument validation, and collision prevention. Use mcp_client to share a single client across multiple agents in FastAPI without spawning duplicate subprocesses.

stdio: uvx amazon-mcp-server
3 tools discovered
amazon.search_productsamazon.get_product_reviewsamazon.check_inventory
pip install "evidor[mcp]"View MCP Guide
v1.5+

Evidence Store & Web Reader

Equip research agents with EvidenceStore to prevent hallucinations across multi-step research, and read_webpage to strip HTML boilerplate with character bounds.

store.tools: 3 primitivesstore.to_markdown()
[ev_1] architecture: SQLite zero-network vs PostgreSQL concurrency
Bounded to 15,000 chars per page fetch.
EvidenceStore & read_webpageDocs

Telemetry Actor Runtime & Thinking Visibility<1µs overhead

Asynchronous producer-consumer actor runtime. Event dispatch takes under 1µs on the agent thread. Toggle capture_thinking=True to stream intermediate reasoning steps to trace dashboards, or keep it off to redact thoughts while preserving token counts.

agent.run185ms • 412 tokens (128 reasoning)
├── llm.gpt-6-astra [gen_ai.reasoning.content: "..."]120ms
└── tool.amazon.search_products65ms
pip install "evidor[otel]"Observability Guide

Privacy & PII Protection

Setting capture_content=False enables metadata-only mode: keeps span trees, token metrics, and latency timings while completely redacting prompt text and tool arguments.

PAYLOAD SENT TO TRACE SINK:
"Patient John Doe: SSN 000-12-3456..."
Tokens: 42Span Hierarchy Intact
capture_content=FalseHIPAA / SOC2 Guide
TOOLS & MCP PROTOCOL

Native tool execution & MCP servers.

Equip your agents with Python functions using @tool or connect directly to external Model Context Protocol (MCP) servers. Evidor automatically handles schema derivation, timeouts, error recovery, and autonomous execution loops.

Schema Derivation & Concurrent Gather

The @tool decorator derives JSON Schema from type hints and docstrings. Multi-tool calls in a turn execute concurrently via asyncio.gather() with error self-correction.

Model Context Protocol (MCP)

Connect to external MCP servers over stdio, modern Streamable HTTP, or SSE. Share a single client across agents in FastAPI with mcp_client.

Evidence Store & Web Reader

Bundled dependency-free tools include in-memory EvidenceStore for research, token-bounded read_webpage, sandbox filesystem_tools, and web_search.

TOOL DISPATCH LIFECYCLE
Autonomous Tool Loops & Concurrent Execution
01 / QUERY
agent.send(...)
User or service prompts agent with tool-dependent request
02 / DISPATCH
Concurrent Gather
Multiple calls in a turn execute concurrently via asyncio.gather()
03 / EXECUTE & CATCH
Safe Execution
Runs sync/async with timeouts; errors feed back for self-healing
04 / SYNTHESIZE
Final Response
Model receives outputs & returns final completed answer
agent_tool_loop.py
python
1from evidor import Agent, GeminiProvider, tool
2
3@tool
4def search_database(query: str) -> list[str]:
5 """Search internal records by keyword."""
6 return [f"Record 1 matching '{query}'", f"Record 2 matching '{query}'"]
7
8agent = Agent(
9 GeminiProvider(model="gemini-3.8-flash"),
10 tools=[search_database],
11 max_tool_iterations=10, # Maximum tool execution turns per send() (default: 10)
12)
13
14response = agent.send("Can you check our records for 'alpha project'?")
15print(response.text)
ARCHITECTURE

Modular harness topology

Clean separation between client application, conversational state, bounded context compaction, MCP subprocesses, and non-blocking telemetry.

SPECIFICATION // v1.10.1

System Topology & Runtime Pipeline

Token Streaming • Connection Pooling • Native Compaction • Thinking Flags • Async Multi-Tool Engine
1. Two Execution Paradigms + Token StreamingSync & Async Streaming
Stateful Agent (Recommended)

Automatic context memory, server-side chaining, token streaming & autonomous tool loops.

agent.send(..., stream=True)
Stateless LLM Calls

Direct single-turn calls with user-managed history, zero hidden state & token streaming.

provider.generate(request)
Evidor Logo
Evidor RuntimeCore Harness v1.10.1
Token streaming generator, persistent HTTP/2 pool, concurrent multi-tool gather & telemetry
Streaming: TTFT & Chunks
Pooling: Daemon Loop
Thinking: Flags & Stream
Telemetry: <1µs Actor
P
ModelProvider Protocol
Unified streaming & async interface: generate_async & generate with stream=True
GenerationRequest(stream=True)
OpenAI
gpt-6-astra
Responses Streaming
Anthropic
claude-3-7-sonnet
Thinking Streams
Gemini
gemini-3.8-flash
Live Interop
Custom
Any LLM
Async Streamer
2. Subsystems & Bridgesv1.10.1 Engine
Token Streaming & TTFT
stream=True yielding chunk.text, chunk.thinking, chunk.tool_calls with precise TTFT tracking.
Connection Pooling & Daemon Loop
Internal daemon event loop preserves HTTP/2 keep-alive sockets across turns, eliminating TCP/TLS handshake latency.
Native Provider Compaction
Offloaded directly to providers via compact_threshold, Responses API chaining, and Claude native compaction blocks.
Thinking & Reasoning Mode
Typed configs (thinking_level, reasoning_effort, budget_tokens) with cryptographic signature replaying.
Concurrent Async Execution
Multiple tool calls in a turn execute concurrently via asyncio.gather() with event loop guards.
Zero-Flooding Telemetry Actor
Boundary emission for streams with TTFT tracking, capture_thinking and capture_content=False metadata auditing.
DEVELOPER EXPERIENCE

Simple on the surface. Powerful underneath.

Start with a single Agent. Add MCP servers, configure retries, or hook up OpenTelemetry without rewriting your application.

Initialize an Agent with OpenAI and dispatch a query in 5 lines.

quickstart.py
python
1from evidor import Agent, OpenAIProvider
2
3agent = Agent(OpenAIProvider(model="gpt-4.1-mini"))
4response = agent.send("Give a one-sentence explanation of dependency inversion.")
5print(response.text)
CONTEXT ENGINE

Native provider compaction. Zero token bloat.

Evidor maps stateful conversations to each model provider's optimal native context mechanism instead of managing synthetic local summaries:

OpenAI Responses API previous_response_id
Gemini Interactions previous_interaction_id
Claude Ephemeral Prompt Caching (90% savings)
Automated compact_threshold triggers
01
Turn Execution (Delta Only)
Only newest turn messages sent — no re-passing entire conversation histories
Zero Redundant Tokens
02
Provider Native Context Strategy
Transparently mapped to each provider's optimal context infrastructure
agent.strategy
Provider-Native Context & Compaction Engine3 Strategies
OpenAIresponse_chain

Server-side chaining via Responses API previous_response_id. Automatic server-side compaction at compact_threshold.

Google Geminiinteraction_chain

Server-side state chaining via Interactions API previous_interaction_id. Google manages state persistence across turns.

Anthropic Claudestateless_replay

Ephemeral Prompt Caching (cache_control) cuts cost by 90%. Emits native compaction blocks to prune older turns.

04
Automated Compaction Triggered
Cross-turn tokens evaluated against native compact_threshold without hitting limits
Native Compaction
Native Compaction

Configurable Token Thresholds

Configure native compaction on OpenAIProvider or AnthropicProvider via compact_threshold, or pass it directly to the Agent facade.

compaction_setup.py
python
1from evidor import Agent, OpenAIProvider, AnthropicProvider
2
3# 1. OpenAI: Automatic server-side compaction
4openai_agent = Agent(
5 OpenAIProvider(model="gpt-6-astra", compact_threshold=100000)
6)
7
8# 2. Anthropic Claude: Threshold compaction with optional custom instructions
9claude_agent = Agent(
10 AnthropicProvider(
11 model="claude-3-7-sonnet-20250219",
12 compact_threshold=150000,
13 compact_instructions="Focus on preserving key architecture decisions and code snippets.",
14 )
15)
16
17# Compaction threshold can also be set directly on the Agent facade
18agent = Agent(OpenAIProvider(model="gpt-6-astra"), compact_threshold=100000)
State Inspection

Inspecting Strategy & Response IDs

Inspect the underlying provider context strategy (agent.strategy), current interaction/response ID (agent.last_response_id), or reset state with agent.reset().

inspect_state.py
python
1from evidor import Agent, OpenAIProvider
2
3agent = Agent(OpenAIProvider(model="gpt-6-astra"))
4agent.send("Hello!")
5
6# Inspect provider context strategy ('response_chain', 'interaction_chain', 'stateless_replay')
7print(agent.strategy) # "response_chain"
8
9# Inspect the latest provider response/interaction ID
10print(agent.last_response_id) # e.g. "resp_12345"
11
12# Inspect message history captured during this session
13for msg in agent.messages:
14 print(f"{msg.role}: {msg.content}")
15
16# Reset conversation state and provider response chain
17agent.reset() # or agent.clear_history()
18print(agent.last_response_id) # None
ADAPTERS & ECOSYSTEM

One interface. Your stack.

Install only what you need with isolated package extras for models, MCP, and observability.

OpenAI

openai>=1.0.0
OpenAIProvider

Responses API exclusively with previous_response_id context chaining, reasoning_effort, and server-side compact_threshold.

Model:gpt-6-astra / gpt-4.1-mini
Env:OPENAI_API_KEY

Anthropic

anthropic>=0.25.0
AnthropicProvider

Messages API with ephemeral prompt caching (cache_control), budget/adaptive thinking, and native compaction summary blocks.

Model:claude-3-7-sonnet-20250219
Env:ANTHROPIC_API_KEY

Gemini

google-genai>=1.0.0
GeminiProvider

Google Interactions API exclusively with previous_interaction_id server-side chaining and thinking_level enum.

Model:gemini-3.8-flash / gemini-3.5-flash-lite
Env:GEMINI_API_KEY

Custom

Async Protocol
ModelProvider

Async-first protocol: implement generate_async() or synchronous generate() to integrate any custom or local model.

Model:Self-hosted / Any LLM
Env:Custom
EXTENSIBLE ECOSYSTEM

Modular Extras for MCP & Telemetry

Model Context Protocol (MCP)

Connect agents to external MCP servers over stdio, modern Streamable HTTP, or SSE.

OpenTelemetry & OpenInference

Distributed tracing spans compliant with OpenTelemetry GenAI and OpenInference standards.

Langfuse Observability

LLM trace trees, prompt engineering, generation tracking, and cost evaluation.

Arize Phoenix

Local and cloud agent inspection with OpenInference UI and token tracking.

Prometheus Metrics

Operational metrics (retries, tokens, latency, agent runs) exported for Prometheus & Grafana.

All Adapters & Toolkits

Install all model adapters, MCP clients, and telemetry sinks in one command.

Extensibility

Implement ModelProvider Protocol

Any class that implements generate(request) can be passed into Agent.

custom_provider.py
python
1from evidor import GenerationRequest, GenerationResponse, ModelProvider
2
3class CustomAsyncProvider(ModelProvider):
4 """Implements the Evidor ModelProvider protocol with async-first support."""
5 def __init__(self, model: str = "custom-model") -> None:
6 self.model = model
7
8 def with_model(self, model: str) -> "CustomAsyncProvider":
9 return CustomAsyncProvider(model=model)
10
11 async def generate_async(self, request: GenerationRequest) -> GenerationResponse:
12 # Asynchronously call custom model backend
13 prompt_text = request.prompt
14 return GenerationResponse(text="Custom async response", model=self.model)
LIVE PYPI RELEASES & CHANGELOG

Published on PyPI, actively evolving.

Evidor is officially published to PyPI as evidor. Stable releases are published from main via trusted publishing.

v1.10.1·PyPI Release·2026-10-20
Automated CI/CD Pipeline
python-semantic-release
main BranchPyPI Stable

Production releases published to PyPI via GitHub Actions trusted publishing using Conventional Commits.

dev BranchTestPyPI Prerelease

PR merges to dev build and publish -dev.N candidate tags to TestPyPI.

Conventional Commits SemVer Rules
fix:
PATCH
feat:
MINOR
feat!:
MAJOR
Install specific PyPI releasev1.10.1
$pip install "evidor==1.10.1"
v1.10.12026-10-20Current PyPI
Bug Fixes
  • •
    Fix Gemini streaming empty message and TTFT latency calculation issuesff00671
v1.10.02026-10-20
Features
  • •
    Token streaming engine across OpenAI, Anthropic, and Gemini via stream=Truefb5b58f
  • •
    Streaming intermediate reasoning/thought tokens via chunk.thinkingfdb1992
  • •
    Real-time tool invocation indicators in streams via chunk.tool_calls with silent argument accumulation2c89965
  • •
    Precise time_to_first_token_ms (TTFT) tracking and zero-flooding boundary telemetry21b8a97
v1.9.12026-10-19
Bug Fixes
  • •
    Telemetry: add missing cached token count to Phoenix sink536d1fe
  • •
    MCP: clean up unused dependencies and connection guardsc42cfc3
v1.9.02026-10-19
Features
  • •
    Persistent connection pooling: internal daemon event loop reuses HTTP/2 connections across turnsd89840a
  • •
    Eliminate TCP/TLS handshake latency on subsequent turns without tearing down sockets between callsef15b9a
Bug Fixes
  • •
    Fix client connection caching in multi-turn agent sessions0984fa9
v1.8.02026-10-17
Features
  • •
    Async-first execution engine: native send_async, provider generate_async, and async tools without thread hops85e9800
  • •
    Concurrent multi-tool execution via asyncio.gather() when model emits multiple calls in a single turncb3e4e1
  • •
    Event loop guards: synchronous calls in active event loops raise explicit RuntimeError immediately9ebac60
  • •
    Two execution paradigms: stateful conversations (Agent) and direct stateless calls (provider.generate)ea58896
v1.7.12026-10-16
Bug Fixes
  • •
    Enable native provider context compaction for OpenAI and Anthropic Claude via compact_thresholdf09c398
v1.7.02026-10-16
Features
  • •
    Update agent providers to modern SDKs: OpenAI Responses API and Google Gemini Interactions API167a886
  • •
    Server-side context chaining: previous_response_id for OpenAI and previous_interaction_id for Geminic39dfbb
v1.6.32026-10-15
Bug Fixes
  • •
    Cryptographic thought signature persistence and replaying for Anthropic and Gemini multi-turn reasoningd8886c2
v1.6.02026-10-13
Features
  • •
    Ephemeral prompt caching (cache_control={"type": "ephemeral"}) with telemetry tracking for Anthropic Claude172ff90
v1.5.02026-10-12
Features
  • •
    Added read_webpage HTML cleaning tool and in-memory EvidenceStore for research agents37b2c31
v1.4.02026-10-10
Features
  • •
    Decoupled telemetry actor runtime (<1µs overhead) with OpenTelemetry, Langfuse, Phoenix, and Prometheus adapters124deb0
  • •
    Privacy and PII protection mode with sink-level capture_content=False6ae868f
  • •
    Python 3.14 official support83cfe8e
v1.3.02026-10-08
Features
  • •
    First-class Model Context Protocol (MCP) integration (stdio, Streamable HTTP, SSE)44ad88d
  • •
    Agent mcp_servers and shared mcp_client support for multi-agent applications843ab00
Bug Fixes
  • •
    Parallel connectivity to MCP for synchronous process execution83a4173
v1.2.02026-10-04
Release
  • •
    Published stable release on PyPI with web search, filesystem tools, and async runtimec04fc45
v1.1.02026-10-04
Features
  • •
    Web search tool integration (Tavily, Exa, Brave adapters via standard library)e5f051b
  • •
    Scoped filesystem tools (list, read, search, create, write, delete)ccc0ef9
  • •
    Built-in calculator and current time tools6fb96c2
v1.0.02026-09-30
Features
  • •
    Stable release with tool primitives (@tool, Tool, execution loop)ccb21cb
  • •
    Async agent conversations (send_async) and async tool execution loops5ad1759
Source: Static PyPI dataView CHANGELOG.md on GitHub
ROADMAP & FUTURE DIRECTIONS

Where Evidor is headed

Planned architectural enhancements building on top of the v1.10.1 runtime foundation.

ROADMAP

Distributed Agent Clusters

Cross-process supervision hierarchies, persistent task queues, and distributed checkpointing for large agent fleets.

ROADMAP

Multi-Agent Topologies

Coordination patterns for agent handoffs, supervisor orchestrations, and specialized worker delegations.

ROADMAP

Structured Output Validation

Native JSON schema and Pydantic model validation guarantees for deterministic agent response extraction.

ROADMAP

Local Inference Adapters

Dedicated high-performance adapters for local vLLM, Ollama, and specialized quantized engine endpoints.

ROADMAP

Sandboxed Tool Execution

Isolated environments and containerized execution limits for executing untrusted tool code securely.

ROADMAP

Pluggable State Persistence

External serialization adapters to hydrate and persist conversation history into Redis, SQLite, or PostgreSQL.

Build agents on an open, provider-agnostic runtime.

Evidor is open-source under the MIT license and published to PyPI. Check out the core repository on GitHub or install the package with pip.