Skip to main content

A robust, asynchronous multi-agent development framework

Project description

AgentSys Framework

A robust, extensible framework for building AI agents with memory, state management, and middleware capabilities.

Features

  • Flexible Agent Architecture

    • BaseAgent: Core functionality and lifecycle management
    • TaskAgent: Task-specific agent implementation base
    • Memory System: Both working and long-term storage
    • State Management: Full agent lifecycle control
  • Extensible Components

    • Middleware: Caching, retries, and telemetry
    • Plugins: Routing and storage backends
    • Protocols: Messaging and streaming support
    • Configuration: Flexible settings management
  • Built-in Memory Management

    • Working Memory: Fast, in-memory storage
    • Long-term Memory: Persistent storage with JSON serialization
    • Memory Manager: Unified memory interface

Documentation

  • Core API: Comprehensive guide to BaseAgent, TaskAgent, and the memory system. Learn how to create custom agents and manage state.
  • Middleware: Cache responses, implement retries, and monitor performance with the middleware system.
  • Plugins: Extend functionality with routing and storage plugins. Build custom plugins for your specific needs.
  • Protocols: Implement inter-agent communication and real-time data streaming with the protocol system.

Installation

pip install agentsys

Quick Start

from agentsys.core import TaskAgent
from typing import Any

class MyAgent(TaskAgent):
    async def _run_task(self, input_data: Any) -> Any:
        # Implement your agent's logic here
        return processed_result

# Create and use your agent
agent = MyAgent(
    name="MyAgent",
    description="A custom agent",
    task_description="Process specific tasks"
)

result = await agent.execute(input_data)

Framework Components

Core (agentsys.core)

  • BaseAgent: Foundation class with lifecycle management
  • TaskAgent: Base class for task-specific agents
  • Memory System: Working and long-term memory management

Middleware (agentsys.middleware)

  • Cache: Response caching for performance
  • Retry: Automatic retry logic
  • Telemetry: Performance monitoring

Plugins (agentsys.plugins)

  • Router: Agent communication and task routing
  • Storage: Custom storage backends

Protocols (agentsys.protocols)

  • Messaging: Inter-agent communication
  • Streaming: Real-time data handling

Example Implementations

Check the examples/ directory for various agent implementations:

  • ChatAgent: OpenAI-powered chat agent
  • More examples coming soon

Building Custom Agents

  1. Inherit from TaskAgent:
class CustomAgent(TaskAgent):
    async def _run_task(self, input_data: Any) -> Any:
        # Your implementation here
        pass
  1. Use Memory:
# Store in working memory
await self.memory.working_memory.store("key", value)

# Store in long-term memory
if self.memory.long_term_memory:
    await self.memory.long_term_memory.store("key", value)
  1. Handle State:
# State is automatically managed in execute()
try:
    self.state = AgentState.RUNNING
    result = await self._run_task(input_data)
    self.state = AgentState.COMPLETED
    return result
except Exception as e:
    self.state = AgentState.ERROR
    raise e

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentsys-0.5.0.tar.gz (592.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentsys-0.5.0-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file agentsys-0.5.0.tar.gz.

File metadata

  • Download URL: agentsys-0.5.0.tar.gz
  • Upload date:
  • Size: 592.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for agentsys-0.5.0.tar.gz
Algorithm Hash digest
SHA256 26c1b2de9decf65f6045972d838315ab16494e1e1e43100edd653bd039a35670
MD5 99037e0da735b8924fdf6c0c1780bc03
BLAKE2b-256 8f3630efb9e4d660690c4ff65188b94868db73324dc043c775785341a37c65f2

See more details on using hashes here.

File details

Details for the file agentsys-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: agentsys-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for agentsys-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ac09c79bdabbbdaf9c2e6cdaa248f7c8e7e8a3ae47f1d613a01fcc7050f4b57
MD5 3988d1a8269a03fb0ed30cd5ccf6ffce
BLAKE2b-256 e91348d6947cabfcedded33535681a9fcfd410397650bc50400184d29a77345e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page