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.4.0.tar.gz (591.1 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.4.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agentsys-0.4.0.tar.gz
Algorithm Hash digest
SHA256 39b03c36195b423229734724eafe24fe038b631a3e0b90f62e6931d5dbe87614
MD5 5cf6bc94f2127a9e393e62e0ab3d0f82
BLAKE2b-256 82029beeb896781f17e4f75d82d9522871b59e762b00cdca249f69ae49961116

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentsys-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 25.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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73b58e1770f64d444756aab7a16d2b12fbe9e4a8d10a0a8cfd9a5cb362f14a63
MD5 729397b672097aa274d6276332e615fd
BLAKE2b-256 998caf2bf001d4b43e3ae6706a5787bf391646983f98a6663068cf138786724e

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