Skip to main content

AgentSys Logo

AgentSys (experimental, educational)

License: MIT

AgentSys is currently an experimental sample framework intended to explore ergonomic interfaces for multi-agent systems. It is not intended to be used in production, and therefore has no official support. (This also means we will not be reviewing PRs or issues!)

The primary goal of AgentSys is to showcase the handoff & routines patterns explored in the Orchestrating Agents: Handoffs & Routines cookbook. It is not meant as a standalone library, and is primarily for educational purposes.

Installation

SSH

pip install git+ssh://git@github.com/lifsys/agentsys.git

HTTPS

pip install git+https://github.com/lifsys/agentsys.git

Project Structure

The project is organized into several key modules:

  • agentsys.orchestration: Core orchestration functionality
    • Swarm: Main orchestration class for managing agent interactions
    • Agent: Base class for defining agents
  • agentsys.models: Model interfaces and implementations
    • BaseModel: Abstract base class for model implementations
    • OpenAIModel: OpenAI model implementation
  • agentsys.config: Configuration management
    • Settings: Configuration settings and utilities
  • agentsys.types: Type definitions and data structures
  • agentsys.util: Utility functions and helpers

Basic Usage

from agentsys import Swarm, Agent

client = Swarm()
agent = Agent(
    name="test",
    instructions="You are a helpful assistant.",
    model="gpt-4",
)

messages = [{"role": "user", "content": "Hello!"}]
response = client.run(agent, messages)
print(response.messages[-1]["content"])

Function Calling

AgentSys supports function calling with both OpenAI's function calling and tool calling APIs:

def get_weather(location: str) -> str:
    """Get the weather for a location."""
    return f"The weather in {location} is sunny!"

agent = Agent(
    name="weather",
    instructions="You can help users check the weather.",
    model="gpt-4",
    functions=[get_weather],
)

messages = [{"role": "user", "content": "What's the weather in San Francisco?"}]
response = client.run(agent, messages)
print(response.messages[-1]["content"])

Configuration

You can configure AgentSys using environment variables or by passing a config object:

from agentsys import Settings

settings = Settings(
    openai_api_key="your-api-key",
    temperature=0.7,
)

Swarm Client

The Swarm class is the main entry point for interacting with agents. It handles:

  • Message routing
  • Function calling
  • Response streaming
  • Error handling

Contributing

This is an experimental project and we are not accepting contributions at this time.

License

MIT

Metadata

Release files for agentsys 0.7.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 agentsys 0.7.0
File Size Uploaded Provenance Actions
agentsys-0.7.0.tar.gz 13.0 kB Without provenance Details for agentsys-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 19.3 kB

Release files / agentsys-0.7.0.tar.gz

Download URL agentsys-0.7.0.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
42fd3ec05817bbee05d7837547cd7ad56e6d5a61e1ecc404a5751b910b4e8c75
BLAKE2b-256 checksum
How to use checksums
8a6bf0772b4df0accd45aaff74746f4d479495d898b4ac3fd1874b6813dd50ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release files / agentsys-0.7.0-py3-none-any.whl

Download URL agentsys-0.7.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77bdd38aeb5394fa90cd74575ae644feb7e9fb5ffcac86a7299b0571c3406a4c
BLAKE2b-256 checksum
How to use checksums
cde53d1b837ed5080d845c1f30039ca8a5ff23117fb2898e81dd11fa203f43b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Security for agentsys 0.7.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