A FastAPI-based manager-first agent backend and CLI
Project description
Agent Proxy
agent-proxy is a Python CLI for persistent agent workspaces and Codex session coordination.
The primary commands are:
agent-proxy enableagent-proxy restartagent-proxy init <role>agent-proxy hire <role> <name>agent-proxy listagent-proxy statusagent-proxy connect <agent> [working_dir]agent-proxy stop <role>
There is also an internal agent-proxy daemon command used by the systemd service.
Features
agent-proxy init <role>creates a role workspace with memory and daily notesagent-proxy init <role>asks the daemon to spawn Codex and returns the managed PIDagent-proxy hire <role> <name>creates or reuses a named agent and returns its managed PIDagent-proxy enableinstalls and starts thesystemddaemon serviceagent-proxy restartrestarts thesystemddaemon serviceagent-proxy restartalso allows desired roles to come back under the restarted master- if a managed autostart role dies, the daemon will try to restart it after about 10 seconds
agent-proxy listshows initialized agentsagent-proxy statusshows the daemon/agent process treeagent-proxy connect <agent> [working_dir]opens a command-line chatbot for the managed role sessionagent-proxy stop <role>queues a stop request for the monitor daemon- the master also serves an OpenAI Responses-style
POST /v1/responsesAPI and a browser chat UI atGET / - the master also serves
POST /hirefor creating named agents - when the daemon starts, it also starts the default
manageragent
Installation
cd agent-proxy
make install
Installation does not automatically enable the daemon. Use agent-proxy enable explicitly.
Or directly:
pip install -e .
Usage
Initialize a role workspace:
agent-proxy init researcher
This creates:
~/.agent_proxy/researcher/
├── SOUL.md
├── AGENTS.md
├── memory/memory.md
└── notes/daily-YYYY-MM-DD.md
The generated instructions tell the agent to write important long-term information into memory/memory.md and write task summaries into the daily note.
After the workspace is created, agent-proxy init <role> asks the daemon to spawn the role process and prints the managed PID.
Hire a named agent from the CLI:
agent-proxy hire engineer alice
This prints:
engineer_alice 12345
Install and start the systemd service:
agent-proxy enable
agent-proxy enable --ip 0.0.0.0 --port 7011
agent-proxy restart
The command uses sudo internally for the privileged install and systemctl operations.
When the daemon comes up, it also creates or reuses ~/.agent_proxy/manager/ and keeps the manager agent running.
List available agents:
agent-proxy list
agent-proxy status
When the master is running, it also serves:
http://0.0.0.0:7011
HTTP responses API:
curl -N http://127.0.0.1:7011/v1/responses \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"model":"engineer_alice","input":"hello","stream":true}'
/v1/responses follows the OpenAI Responses API shape for request and response payloads.
If AGENT_PROXY_API_KEY is configured for the service, API requests must send Authorization: Bearer <key>.
Open http://127.0.0.1:7011/ in a browser for the streaming chat UI.
Hire a named agent:
curl -s http://127.0.0.1:7011/hire \
-H 'Content-Type: application/json' \
-d '{"role":"engineer","name":"alice"}'
This creates a workspace like:
~/.agent_proxy/engineer_alice/
Queue a connection request for an agent, defaulting to the current directory:
agent-proxy connect researcher
agent-proxy connect researcher /home/li/project/collection-pip
If the agent becomes ready, connect returns its managed PID. If the daemon cannot make it ready, connect exits with not ready.
If the agent becomes ready, connect opens a command-line chatbot loop. If the daemon cannot make it ready, connect exits with not ready.
The optional working_dir argument is task context for the agent. Codex itself still runs from the agent workspace. On connect, the CLI first sends:
Now let us work on working dir: <working_dir>
Queue a stop request for an agent:
agent-proxy stop researcher
Notes
connecttargets a daemon-managed pseudo-terminal session. The daemon records the messageNow let us working on <working_dir>and launches Codex from that directory inside the managed session.- after a daemon restart, roles marked for autostart are spawned again by the master
- the daemon also ensures the default
manageragent is running after startup or restart - if an autostart role crashes, the master retries it after about 10 seconds instead of leaving it down permanently
stopqueues a stop request. The daemon terminates the tracked Codex process for that role if it still exists.initis daemon-managed. It returns a PID instead of entering an interactive shell.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file teamclaw_agent_proxy-0.1.0.tar.gz.
File metadata
- Download URL: teamclaw_agent_proxy-0.1.0.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41362e1770b61af5d32e8061c2d6d37e792e6c28fbaa8f3953e6cdf610ada343
|
|
| MD5 |
263f98d38a8a8adca966f1bc37e2e0cd
|
|
| BLAKE2b-256 |
abd28df14cc523cc82ee44adbfb96eb3e540cb3ebbcdd367ad532b341f2d840e
|
File details
Details for the file teamclaw_agent_proxy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: teamclaw_agent_proxy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ae201860f173d520c8fa1da3a872f09ec7b438f6cc58daddb69027851656e8a
|
|
| MD5 |
b18922f711d7365f87bd2d7a69aeeb2f
|
|
| BLAKE2b-256 |
7946b7c6425b08f726870ebae62c3d8a35de76a8e3333cec6e9090a737991130
|