https://github.com/ziteh/agent-pyramid-scheme
Agents delegating to agents, assigning tasks to a sub-agent, keep the context clean and reduce token costs
https://github.com/ziteh/agent-pyramid-scheme
multi-agent subagents
Last synced: 5 days ago
JSON representation
Agents delegating to agents, assigning tasks to a sub-agent, keep the context clean and reduce token costs
- Host: GitHub
- URL: https://github.com/ziteh/agent-pyramid-scheme
- Owner: ziteh
- License: mit
- Created: 2026-06-12T17:01:58.000Z (21 days ago)
- Default Branch: main
- Last Pushed: 2026-06-14T03:46:43.000Z (19 days ago)
- Last Synced: 2026-06-14T05:19:20.039Z (19 days ago)
- Topics: multi-agent, subagents
- Language: TypeScript
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Agent Pyramid Scheme (APS)
Agents delegating to agents — hand off implementation work to a sub-agent, keeping your main agent's context clean and your token costs down.
A layered agent architecture: the main agent (e.g. Claude Opus, Fable, the powerful and expensive models) handles planning and review, while well-scoped implementation tasks are delegated to a sub-agent (e.g. Qwen3-Coder, DeepSeek-V4, the cheap or local models). This keeps the main agent's context window focused and reduces token costs for repetitive implementation work.
## Usage
**Build:**
```bash
pnpm install
pnpm build
```
**MCP config:**
```json
{
"mcpServers": {
"agent-pyramid-scheme": {
"type": "stdio",
"command": "node",
"args": [
"/path/to/agent-pyramid-scheme/build/index.js",
"--base-url", "http://localhost:11434/v1",
"--model", "gemma4:26b",
"--project-dir", "/path/to/your/project"
]
}
}
}
```
API key env: `AGENT_PYRAMID_SCHEME_LLM_API_KEY`
**Inspector:**
```bash
AGENT_PYRAMID_SCHEME_LLM_API_KEY="$OPENROUTER_API_KEY" pnpm inspector node build/index.js \
--base-url "https://openrouter.ai/api/v1" \
--model "nvidia/nemotron-3-super-120b-a12b:free" \
--project-dir "/path/to/project/"
```
**Guide:**
Paste the contents of [USAGE.md](USAGE.md) into your `AGENTS.md` or `CLAUDE.md` to let the LLM know how to use APC.
## TODO
- [x] Abort task feature
- [ ] WebUI
- [ ] Assigning tasks based on expertise: Multiple distinct LLMs can be configured—some excel at critical thinking, others at coding, and still others at providing quick responses—and the main agent can select the appropriate one based on the task requirements.