Agents Overview¶
Agents are the "personalities" of SimpleContext. Each agent is a YAML file that defines how the AI behaves for a specific domain.
How Routing Works¶
When a message arrives, the AgentRouter picks the best agent using TF-IDF keyword matching:
"ada bug di python saya"
│
▼
AgentRouter (TF-IDF)
│
├── coding (score: 0.82) ← keywords: bug, python
├── tutor (score: 0.41)
└── general (score: 0.12)
│
▼
Agent: coding ✅
If no agent scores high enough, it falls back to the default agent (usually general).
Available Agents¶
SimpleContext-Agents provides 15 ready-to-use agents:
Core¶
| Agent | Best For |
|---|---|
🧠 general | Everyday questions, smart routing fallback |
🖥️ coding | Code, debug, review, refactor |
🚀 devops | Docker, CI/CD, Linux, cloud |
✍️ writer | Blog, copy, email, social media |
Knowledge & Research¶
| Agent | Best For |
|---|---|
🔍 researcher | Research, fact-checking, analysis |
📚 tutor | Learning any subject |
📝 summarizer | Articles, reports, meetings |
🌐 translator | Any language pair, cultural context |
Business & Professional¶
| Agent | Best For |
|---|---|
📊 analyst | Reports, KPIs, insights, forecasting |
🎧 customer_service | Support, complaints, returns |
💰 finance | Budgeting, investing, financial planning |
⚖️ legal | Contracts, rights, regulations |
Lifestyle & Creativity¶
| Agent | Best For |
|---|---|
🎨 creative | Ideation, storytelling, naming, worldbuilding |
⚡ productivity | Time management, habits, focus |
💪 health | Fitness, nutrition, sleep, mental health |
Install all agents:
git clone https://github.com/zacxyonly/SimpleContext-Agents
cp SimpleContext-Agents/agents/*.yaml your-project/agents/
Agent Chaining¶
Agents can automatically hand off to each other based on message content:
# In coding.yaml
chain:
- condition: deploy OR server OR nginx OR docker
to: devops
message: This looks like a DevOps question — routing you there.
The chain condition matches against the user's message, not the LLM response.
User: "how do I dockerize my python app"
│
▼
coding agent (handles python context)
│ chain: "docker" detected
▼
devops agent (handles deployment)
│
▼
Final reply
Personality Levels¶
Each agent can have multiple personalities activated by the user's profile level:
sc.memory(user_id).remember("level", "expert")
# Now the coding agent uses personality.expert instead of personality.default
Common personality levels by convention:
| Level | Description |
|---|---|
default | Balanced, works for everyone |
beginner | Simpler language, more examples, more encouragement |
intermediate | Assumes some knowledge |
expert | Skip basics, technical depth, challenge assumptions |
indonesian | Full Indonesian language response |
formal | Formal/professional register |
Hot Reload¶
Agents hot-reload without restarting SimpleContext:
sc = SimpleContext("config.yaml", agents__hot_reload=True)
# Edit coding.yaml → changes take effect on next message
# Add new_agent.yaml → immediately available
Force reload manually: