---
title: "agency"
type: "tool"
slug: "operand-agency"
canonical_url: "https://www.graphcanon.com/tools/operand-agency"
github_url: "https://github.com/operand/agency"
homepage_url: "https://createwith.agency"
stars: 487
forks: 28
primary_language: "Python"
license: "MIT"
categories: ["developer-tools", "ai-agents"]
tags: ["agent-integration", "python", "actor", "multi-processing", "minimal"]
updated_at: "2026-07-07T19:48:36.599195+00:00"
---

# agency

> A Python library for building agentic systems using Actor model with easy API and support for multi-processing.

Agency is a minimalist framework designed to assist developers in creating highly customizable, agent-based applications by providing a flexible actor-model architecture that integrates AI-driven agents within traditional software systems efficiently.

## Facts

- Repository: https://github.com/operand/agency
- Homepage: https://createwith.agency
- Stars: 487 · Forks: 28 · Open issues: 19 · Watchers: 7
- Primary language: Python
- License: MIT
- Last pushed: 2026-06-10T20:36:18+00:00

## Categories

- [Developer Tools](/categories/developer-tools.md)
- [AI Agents](/categories/ai-agents.md)

## Tags

agent-integration, python, actor, multi-processing, minimal

## Related tools

- [ECC](/tools/affaan-m-ecc.md) - The agent harness performance optimization system (★ 226,991)
- [hermes-agent](/tools/nousresearch-hermes-agent.md) - The self-improving AI agent built by Nous Research (★ 210,911)
- [AutoGPT](/tools/significant-gravitas-autogpt.md) - AutoGPT: Build, Deploy, and Run AI Agents (★ 185,420)
- [ollama](/tools/ollama-ollama.md) - Get up and running with Kimi-K2.6, GLM-5.1, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models. (★ 175,664)
- [prompts.chat](/tools/f-prompts-chat.md) - The world's largest open-source prompt library for AI (★ 165,025)
- [JavaGuide](/tools/snailclimb-javaguide.md) - Snailclimb/JavaGuide: 面试 & 后端通用面试指南，覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发 (★ 156,863)
- [langflow](/tools/langflow-ai-langflow.md) - Langflow is a powerful platform for building and deploying AI-powered agents and workflows. (★ 151,311)
- [dify](/tools/langgenius-dify.md) - Production-ready platform for agentic workflow development (★ 148,074)

## README (excerpt)

```text
# Summary

Agency is a python library that provides an [Actor
model](https://en.wikipedia.org/wiki/Actor_model) framework for creating
agent-integrated systems.

The library provides an easy to use API that enables you to connect agents with
traditional software systems in a flexible and scalable way, allowing you to
develop any architecture you need.

Agency's goal is to enable developers to create custom agent-based applications
by providing a minimal foundation to both experiment and build upon. So if
you're looking to build a custom agent system of your own, Agency might be for
you.

## Features

### Easy to use API
* Straightforward class/method based agent and action definition
* [Up to date documentation](https://createwith.agency) and [examples](./examples/demo/) for reference

### Performance and Scalability
* Supports multiprocessing and multithreading for concurrency
* AMQP support for networked agent systems

### Observability and Control
* Action and lifecycle callbacks
* Access policies and permission callbacks
* Detailed logging

### Demo application available at [`examples/demo`](./examples/demo/)
* Multiple agent examples for experimentation
  * Two OpenAI agent examples
  * HuggingFace transformers agent example
  * Operating system access
* Includes Gradio UI
* Docker configuration for reference and development


# API Overview

In Agency, all entities are represented as instances of the `Agent` class. This
includes all AI-driven agents, software interfaces, or human users that may
communicate as part of your application.

All agents may expose "actions" that other agents can discover and invoke at run
time. An example of a simple agent could be:

```python
class CalculatorAgent(Agent):
    @action
    def add(a, b):
        return a + b
```

This defines an agent with a single action: `add`. Other agents will be able
to call this method by sending a message to an instance of `CalculatorAgent` and
specifying the `add` action. For example:

```python
other_agent.send({
    'to': 'CalcAgent',
    'action': {
        'name': 'add',
        'args': {
            'a': 1,
            'b': 2,
        }
    },
})
```

Actions may specify an access policy, allowing you to control access for safety.

```python
@action(access_policy=ACCESS_PERMITTED) # This allows the action at any time
def add(a, b):
    ...

@action(access_policy=ACCESS_REQUESTED) # This requires review before the action
def add(a, b):
    ...
```

Agents may also define callbacks for various purposes:

```python
class CalculatorAgent(Agent):
    ...
    def before_action(self, message: dict):
        """Called before an action is attempted"""

    def after_action(self, message: dict, return_value: str, error: str):
        """Called after an action is attempted"""

    def after_add(self):
        """Called after the agent is added to a space and may begin communicating"""

    def before_remove(self):
        """Called before the agent is removed from the space"""
```

A `Space` is how you connect your agents together. An agent cannot communicate
with others until it is added to a common `Space`.

There are two included `Space` implementations to choose from:
* `LocalSpace` - which connects agents within the same application.
* `AMQPSpace` - which connects agents across a network using an AMQP
  server like RabbitMQ.

Finally, here is a simple example of creating a `LocalSpace` and adding two
agents to it.

```python
space = LocalSpace()
space.add(CalculatorAgent, "CalcAgent")
space.add(MyAgent, "MyAgent")
# The agents above can now communicate
```

These are just the basic features that Agency provides. For more information
please see [the help site](https://createwith.agency).


# Install

```sh
pip install agency
```
or
```sh
poetry add agency
```


# The Demo Application

The demo application is maintained as an experimental development environment
and a showcase for library features. It includes multiple agent examples which
may communicate w
```

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/operand-agency`](/api/graphcanon/tools/operand-agency)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
