Skip to content

Add multi-agent orchestration recipe#1048

Open
GerardoRdz96 wants to merge 1 commit into
meta-llama:mainfrom
GerardoRdz96:add-multi-agent-orchestration-recipe
Open

Add multi-agent orchestration recipe#1048
GerardoRdz96 wants to merge 1 commit into
meta-llama:mainfrom
GerardoRdz96:add-multi-agent-orchestration-recipe

Conversation

@GerardoRdz96
Copy link
Copy Markdown

What

A recipe demonstrating multi-agent orchestration using Llama models, featuring:

  • Context Layers: 4-layer system (identity → state → relevant → archive) for persistent agent behavior
  • Agent Cards: JSON capability descriptors for agent discovery and routing
  • Safety Guards: Output validation, cost tracking, and rollback for production reliability
  • Phase-Gated Pipeline: Research → Build → Review with quality gates

Why

Llama 4 is positioned for powering agentic systems, but the cookbook doesn't have examples of multi-agent orchestration with context engineering. This recipe fills that gap with production-tested patterns from PA·co, a 22-agent system running in production.

How to Test

pip install -r recipes/multi_agent_orchestration/requirements.txt
export LLAMA_BASE_URL=http://localhost:11434/v1
export LLAMA_MODEL=llama3.2
python recipes/multi_agent_orchestration/orchestrator.py "Build a CLI tool that converts CSV to JSON"

Works with Ollama, vLLM, or any OpenAI-compatible endpoint. Zero heavy dependencies (only requests).

Files

File What
context_layers.py 4-layer context system with pre-built agent identities
agent_cards.py Capability discovery and routing (inspired by A2A protocol)
safety_guard.py Output validation, cost tracking, rollback manager
orchestrator.py 3-agent pipeline with phase gates
requirements.txt Single dependency: requests

Built by PA·co — A Penguin Alley System.

…, and safety guards

A recipe demonstrating multi-agent orchestration using Llama models:

- **context_layers.py**: 4-layer context system (identity → state → relevant → archive)
  for persistent agent behavior across sessions
- **agent_cards.py**: JSON capability descriptors for agent discovery and routing
  (inspired by A2A protocol)
- **safety_guard.py**: Output validation, cost tracking, and rollback for
  production-grade reliability
- **orchestrator.py**: 3-agent pipeline (Researcher → Builder → Reviewer) with
  phase gates and quality checks

Works with Ollama, vLLM, or any OpenAI-compatible endpoint.
Zero heavy dependencies (only `requests`).

Patterns are production-tested in PA·co, a 22-agent system running
at Penguin Alley (penguinalley.com).

Built by PA·co — A Penguin Alley System.
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 12, 2026

Hi @GerardoRdz96!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 12, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the cla signed label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant