Introduction
An AI agent is an autonomous system that can perceive its environment, make decisions, and take actions to achieve goals. In Shannon, agents are the fundamental execution units that process tasks using Large Language Models (LLMs) and tools.Agent Capabilities
Shannon agents can:Reason
Use LLMs to analyze tasks, plan solutions, and make decisions
Execute Tools
Call functions, run code, search the web, and interact with APIs
Collaborate
Work with other agents to solve complex multi-step problems
Learn
Improve over time through pattern learning and cached results
Agent Lifecycle
Here’s how an agent processes a task:1
Task Analysis
Agent receives task and analyzes what needs to be done
2
Planning
LLM creates a plan, potentially breaking down into steps
3
Tool Selection
Agent identifies which tools are needed
4
Execution
Iteratively executes tools and processes results
5
Synthesis
Combines results into final answer
Agent Types in Shannon
Single Agent (Simple Mode)
A single agent handles the entire task without decomposition. Best for:- Simple queries
- Fact retrieval
- Basic calculations
- Quick responses
Shannon automatically selects single-agent mode for simple queries.
Multi-Agent (Standard/Complex Mode)
Multiple specialized agents work together, coordinated by Shannon’s orchestrator. Best for:- Complex research
- Multi-step workflows
- Tasks requiring different expertise
- Tasks needing parallel processing
Shannon automatically decomposes complex queries into multi-agent workflows based on query complexity.
Agent Components
1. LLM Brain
The decision-making core powered by language models:- Model Selection: Shannon auto-selects models based on task complexity
- Small tasks →
gpt-5-mini,claude-haiku - Complex tasks →
gpt-5,claude-opus
- Small tasks →
- Context Management: Automatically manages context windows
- Caching: Reuses previous LLM responses when applicable
2. Tool System
Agents can execute various tools: Built-in Tools:- Python code execution (WASI sandboxed)
- Web search (Google/Serper/Bing/Exa/Firecrawl)
- Document retrieval
- Mathematical calculations
3. Memory System
Agents maintain two types of memory: Session Memory:- Short-term context within a conversation
- Stored in Redis with configurable TTL (default 30 days)
- Enables multi-turn dialogues
- Long-term semantic memory in Qdrant
- Cross-session retrieval
- MMR diversity for relevant context
Platform Configuration
Shannon behavior is configured via environment variables. Common examples:Model Tiers
Shannon automatically selects models based on the configured tier:| Tier | Models | Use Case | Cost |
|---|---|---|---|
| SMALL | gpt-5-mini, claude-haiku | Simple queries, high volume | $ |
| MEDIUM | gpt-5, claude-sonnet | General purpose | $$ |
| LARGE | gpt-5-thinking, claude-opus | Complex reasoning, critical tasks | $$$ |
Shannon’s intelligent router selects the most cost-effective model for each task, often yielding 60–90% savings compared to always using premium models (workload‑dependent).
Agent Coordination Patterns
Shannon uses proven cognitive patterns for multi-agent coordination:Chain-of-Thought (CoT)
Sequential reasoning where each step builds on the previous:Tree-of-Thoughts (ToT)
Exploration with backtracking for complex problem-solving:ReAct (Reasoning + Acting)
Interleaved reasoning and action for dynamic tasks:Security and Isolation
Shannon agents run in secure environments:WASI Sandbox
All code execution happens in WebAssembly System Interface sandboxes with:
- No network access
- Read-only filesystem
- Memory limits
- Execution timeouts
OPA Policy Enforcement
Control what agents can do:Best Practices
1. Choose the Right Mode
- Simple: Single-step tasks, fast responses
- Standard: Multi-step tasks, moderate complexity
- Complex: Research, analysis, advanced reasoning
2. Set Budget Limits
Configure token and cost limits at the platform level to prevent unexpected charges:3. Use Sessions for Context
For multi-turn conversations, use consistentsession_id: