Add sub-agent orchestration, MCP tools, and critical bug fixes

Major Features:
- Sub-agent orchestration system with dynamic specialist spawning
  * spawn_sub_agent(): Create specialists with custom prompts
  * delegate(): Convenience method for task delegation
  * Cached specialists for reuse
  * Separate conversation histories and focused context

- MCP (Model Context Protocol) tool integration
  * Zettelkasten: fleeting_note, daily_note, permanent_note, literature_note
  * Search: search_vault (hybrid search), search_by_tags
  * Web: web_fetch for real-time data
  * Zero-cost file/system operations on Pro subscription

Critical Bug Fixes:
- Fixed max tool iterations (15 → 30, configurable)
- Fixed max_tokens error in Agent SDK query() call
- Fixed MCP tool routing in execute_tool()
  * Routes zettelkasten + web tools to async handlers
  * Prevents "Unknown tool" errors

Documentation:
- SUB_AGENTS.md: Complete guide to sub-agent system
- MCP_MIGRATION.md: Agent SDK migration details
- SOUL.example.md: Sanitized bot identity template
- scheduled_tasks.example.yaml: Sanitized task config template

Security:
- Added obsidian vault to .gitignore
- Protected SOUL.md and MEMORY.md (personal configs)
- Sanitized example configs with placeholders

Dependencies:
- Added beautifulsoup4, httpx, lxml for web scraping
- Updated requirements.txt

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 07:43:31 -07:00
parent 911d362ba2
commit 50cf7165cb
11 changed files with 1987 additions and 103 deletions

View File

@@ -1,85 +1,63 @@
# Scheduled Tasks Configuration (EXAMPLE)
# Copy this to scheduled_tasks.yaml and customize with your values
# Scheduled Tasks Configuration
# Tasks that require the Agent/LLM to execute
#
# Copy this file to scheduled_tasks.yaml and customize with your settings
# scheduled_tasks.yaml is gitignored to protect personal information
tasks:
# Morning briefing - sent to Slack/Telegram
- name: morning-weather
prompt: |
Good morning! Please provide a weather report and daily briefing:
Check the user profile ([username].md) for the location. Use the get_weather tool to fetch current weather.
1. Current weather (you can infer or say you need an API key)
2. Any pending tasks from yesterday
3. Priorities for today
4. A motivational quote to start the day
Format the report as:
Keep it brief and friendly.
🌤️ **Weather Report for [Your City]**
- Current: [current]°F
- High: [high]°F
- Low: [low]°F
- Conditions: [conditions]
- Recommendation: [brief clothing/activity suggestion]
Keep it brief and friendly!
schedule: "daily 06:00"
enabled: true
send_to_platform: "telegram"
send_to_channel: "YOUR_TELEGRAM_USER_ID" # Replace with your Telegram user ID
send_to_platform: "telegram" # or "slack"
send_to_channel: "YOUR_TELEGRAM_USER_ID"
# Evening summary
- name: evening-report
# Daily Zettelkasten Review
- name: zettelkasten-daily-review
prompt: |
Good evening! Time for the daily wrap-up:
Time for your daily zettelkasten review! Help process fleeting notes:
1. What was accomplished today?
2. Any tasks still pending?
3. Preview of tomorrow's priorities
4. Weather forecast for tomorrow (infer or API needed)
1. Use search_by_tags to find all notes tagged with "fleeting"
2. Show the list of fleeting notes
3. For each note, ask: "Would you like to:
a) Process this into a permanent note
b) Keep as fleeting for now
c) Delete (not useful)"
Keep it concise and positive.
schedule: "daily 18:00"
enabled: false
Keep it conversational and low-pressure!
schedule: "daily 20:00"
enabled: true
send_to_platform: "telegram"
send_to_channel: "YOUR_TELEGRAM_USER_ID"
# Hourly health check (no message sending)
- name: system-health-check
# Daily API cost report
- name: daily-cost-report
prompt: |
Quick health check:
Generate a daily API usage and cost report:
1. Are there any tasks that have been pending > 24 hours?
2. Is the memory system healthy?
3. Any alerts or issues?
Read the usage_data.json file to get today's API usage statistics.
Respond with "HEALTHY" if all is well, otherwise describe the issue.
schedule: "hourly"
Format the report with today's costs, token usage, and budget tracking.
Warn if cumulative cost exceeds 75% of budget.
Keep it clear and actionable!
schedule: "daily 23:00"
enabled: false
username: "health-checker"
# Weekly review on Friday
- name: weekly-summary
prompt: |
It's Friday! Time for the weekly review:
1. Major accomplishments this week
2. Challenges faced and lessons learned
3. Key metrics (tasks completed, etc.)
4. Goals for next week
5. Team shoutouts (if applicable)
Make it comprehensive but engaging.
schedule: "weekly fri 17:00"
enabled: false
send_to_platform: "slack"
send_to_channel: "YOUR_SLACK_CHANNEL_ID"
# Custom: Midday standup
- name: midday-standup
prompt: |
Midday check-in! Quick standup report:
1. Morning accomplishments
2. Current focus
3. Any blockers?
4. Afternoon plan
Keep it brief - standup style.
schedule: "daily 12:00"
enabled: false
send_to_platform: "slack"
send_to_channel: "YOUR_SLACK_CHANNEL_ID"
send_to_platform: "telegram"
send_to_channel: "YOUR_TELEGRAM_USER_ID"
# Configuration notes:
# - schedule formats: