Observed since 20 Oct, 23:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
agentrspy
Async-native Python SDK for building AI agents, ported from Rust agentrs
agentrspy is the Python port of the Rust project agentrs: an async-native SDK for building AI agents with a unified provider interface, composable tools, MCP integration, pluggable memory, multi-agent orchestration, and YAML-driven runtime loading.
The goal of this port is behavioral fidelity first and Python ergonomics second: keep the same core capabilities, preserve the tested runtime semantics, and expose them through idiomatic Python APIs with type hints.
pip install -e .
Optional extras:
pip install -e ".[redis]"
pip install -e ".[dev]"
pip install -e ".[full]"
from __future__ import annotations
import asyncio
from dotenv import load_dotenv
from agentrspy.prelude import Agent, CalculatorTool, LoopStrategy, OpenAiProvider
async def main() -> None:
load_dotenv()
llm = OpenAiProvider.from_env().build()
agent = (
Agent.builder()
.llm(llm)
.system("You are a concise assistant.")
.tool(CalculatorTool())
.loop_strategy(LoopStrategy.react(max_steps=4))
.build()
)
output = await agent.run("What is 7 * (8 + 1)?")
print(output.text)
if __name__ == "__main__":
asyncio.run(main())
agentrspy/
├── agentrspy/ # import-friendly wrapper package
├── src/agentrspy/core # shared contracts, types, errors, streaming helpers
├── src/agentrspy/llm # provider implementations
├── src/agentrspy/tools # registry, built-ins, decorator-based tools
├── src/agentrspy/mcp # MCP transport, protocol, adapters
├── src/agentrspy/memory # memory backends
├── src/agentrspy/agents # builders and execution loops
├── src/agentrspy/multi # orchestrators, graph routing, event bus
├── src/agentrspy/config.py # YAML runtime loading
├── examples/ # runnable Python examples
├── tests/ # pytest coverage for parity-critical behavior
└── docs/ # rewritten Python documentation
output.text[agent_name]\n<text> blocks separated by blank linesexamples/simple_agent.pyexamples/custom_tool.pyexamples/streaming.pyexamples/multi_agent.pyexamples/mcp_integration.pyexamples/yaml_single_agent.pyexamples/yaml_multi_agent.pyexamples/yaml_runtime.pyRun one with:
python examples/simple_agent.py
python examples/multi_agent.py
python examples/yaml_runtime.py
Or use the module entrypoint:
python -m agentrspy --config examples/configs/single-agent.yaml --input "What is 21 * 2?"
See .env.example for a ready-to-copy template.
Common values:
OPENAI_API_KEYOPENAI_BASE_URLOPENAI_MODELAZURE_OPENAI_ENDPOINTAZURE_OPENAI_KEYAZURE_OPENAI_MODELANTHROPIC_API_KEYGEMINI_API_KEYCONTEXT7_API_KEYdocs/architecture.mddocs/providers.mddocs/tools.mddocs/memory.mddocs/multi-agent.mddocs/yaml.mddocs/migration-from-rust.mddocs/testing.mdpython -m pytest
python -m compileall src agentrspy tests examples
#[tool] workflow becomes a Python @tool(...) decorator.complete() but keep streaming intentionally unsupported, matching the Rust scope.MIT.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
httpxEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | httpx<1,>=0.27 | runtime |
PyYAMLEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | PyYAML<7,>=6 | runtime |
python-dotenvEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | python-dotenv<2,>=1 | runtime |
redisEnvironment{
"extras": "",
"marker": "extra == \"redis\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | redis<6,>=5; extra == "redis" | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | pytest<9,>=8; extra == "dev" | runtime |
redisEnvironment{
"extras": "",
"marker": "extra == \"full\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | redis<6,>=5; extra == "full" | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"full\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | pytest<9,>=8; extra == "full" | runtime |
bdist_wheel · 49.07 KB · Python py3
sdist · 36.18 KB · Python source
Observed since 20 Oct, 23:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:cc671eaa744f94de805c0ec7c8dc6b38c4479b92b93ea88ac78153c7cb76711b