LOGOS needs to orchestrate tens of thousands of AI agents programmatically. You can't do that by clicking in an IDE.
The solution: Anthropic's Claude Agent SDK - the same technology that powers Cursor's agent mode, but accessible from Python code.
| Component | Purpose | Location |
|---|---|---|
| Agent Orchestrator | Invoke single agents | /Cortex/agent_orchestrator.py |
| Bot Factory | Templates & fleet management | /Cortex/bot_factory.py |
| REST API | HTTP access to agents | /Cortex/agent_api_bp.py |
| CLI Tool | Command-line invocation | /scripts/invoke_agents.py |
pip install claude-agent-sdk
cd /root/Winbusiness && python3 scripts/invoke_agents.py --help
cd /root/Winbusiness && python3 scripts/invoke_agents.py --task "List files in the current directory" --personality Default
cd /root/Winbusiness && python3 scripts/invoke_agents.py --task "Review app.py for security issues" --personality Sage
curl http://localhost:5000/logos/api/agent/status
┌─────────────────────────────────────────────────────────┐
│ Your Python Code │
│ (Scripts, Flask routes, async jobs) │
└────────────────────────┬────────────────────────────────┘
│
┌──────────────┼──────────────┐
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ CLI │ │ REST API │ │ Direct │
│ Tool │ │ /api/ │ │ Import │
└────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ │
└──────────────┼──────────────┘
│
▼
┌─────────────────┐
│ Bot Factory │ ← Templates, fleet mgmt
└────────┬────────┘
│
▼
┌─────────────────┐
│ Agent │ ← Single invocation
│ Orchestrator │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Claude Agent │ ← Anthropic SDK
│ SDK │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Tool Execution │ ← Read, Write, Edit,
│ │ Bash, Grep, Glob
└─────────────────┘
# Single agent invocation
import asyncio
from winbusiness.Logos.Cortex.agent_orchestrator import AgentOrchestrator
async def main():
orchestrator = AgentOrchestrator(
default_working_directory="/root/Winbusiness"
)
result = await orchestrator.invoke_agent(
task="Fix the bug in auth.py",
personality="Sage", # Uses LOGOS personality
allowed_tools=["Read", "Write", "Edit", "Bash", "Grep", "Glob"],
)
print(f"Success: {result.success}")
print(f"Output: {result.output}")
print(f"Cost: ${result.total_cost_usd:.4f}")
asyncio.run(main())
# Spawn a fleet of bots
import asyncio
from winbusiness.Logos.Cortex.bot_factory import BotFactory
async def main():
factory = BotFactory(max_concurrent_bots=50)
# Spawn 100 security auditor bots
bots = await factory.spawn_fleet("SecurityAuditor", count=100)
# Create tasks for each bot
tasks = [
{"bot_id": bot.bot_id, "task": f"Audit module_{i}.py"}
for i, bot in enumerate(bots)
]
# Execute in parallel
results = await factory.parallel_execute(tasks)
print(f"Completed: {sum(1 for r in results if r.success)}/{len(results)}")
asyncio.run(main())
| Template | Specialty | Tools |
|---|---|---|
| SecurityAuditor | Security & vulnerabilities | Read, Grep, Glob |
| CodeRefactorer | Refactoring & cleanup | Read, Write, Edit, Grep, Glob |
| TestWriter | Test generation | Read, Write, Edit, Grep, Glob, Bash |
| Documenter | Documentation | Read, Write, Edit, Grep, Glob |
| BugHunter | Bug detection & fixing | Read, Write, Edit, Bash, Grep, Glob |
| PerformanceOptimizer | Performance tuning | Read, Write, Edit, Bash, Grep, Glob |
| APIIntegrator | API integration | Read, Write, Edit, Bash, Grep, Glob, WebFetch |
| DatabaseMigrator | Database migrations | Read, Write, Edit, Bash, Grep, Glob |
When Flask is running, these endpoints are available at /logos/api/agent/
curl http://localhost:5000/logos/api/agent/status
curl http://localhost:5000/logos/api/agent/templates
curl -X POST http://localhost:5000/logos/api/agent/invoke \
-H "Content-Type: application/json" \
-d '{
"prompt": "List all Python files in the project",
"personality": "Default",
"working_directory": "/root/Winbusiness"
}'
curl -X POST http://localhost:5000/logos/api/agent/batch \
-H "Content-Type: application/json" \
-d '{
"tasks": [
{"prompt": "Review auth.py", "personality": "Sage"},
{"prompt": "Document api.py", "personality": "Quill"}
],
"max_concurrent": 5
}'
curl -X POST http://localhost:5000/logos/api/fleet/spawn \
-H "Content-Type: application/json" \
-d '{
"template_name": "BugHunter",
"count": 10,
"id_prefix": "hunter-"
}'
#!/usr/bin/env python3
"""Security audit across multiple files"""
import asyncio
from winbusiness.Logos.Cortex.bot_factory import BotFactory
async def security_audit():
factory = BotFactory()
# Files to audit
files = ["app.py", "config.py", "routes.py"]
tasks = [
{
"template_name": "SecurityAuditor",
"task": f"Perform a security audit of {f}. Look for: SQL injection, XSS, hardcoded secrets, improper input validation."
}
for f in files
]
results = await factory.parallel_execute(tasks, max_concurrent=3)
# Compile report
print("=" * 60)
print("SECURITY AUDIT REPORT")
print("=" * 60)
for i, result in enumerate(results):
print(f"\n--- {files[i]} ---")
print(result.output[:500] if result.output else "No issues found")
asyncio.run(security_audit())
#!/usr/bin/env python3
"""Generate documentation for all Python files in a directory"""
import asyncio
from winbusiness.Logos.Cortex.agent_orchestrator import AgentOrchestrator
async def generate_docs():
orchestrator = AgentOrchestrator(
default_working_directory="/root/Winbusiness"
)
result = await orchestrator.invoke_agent(
task="""
Find all Python files in winbusiness/Logos/Cortex/ and create
a documentation summary for each one. Include:
- Purpose of the file
- Main classes and functions
- Usage examples
Save the documentation to a file called API_DOCS.md
""",
personality="Quill", # Documentation specialist
)
print(result.output)
asyncio.run(generate_docs())
cd /root/Winbusiness && python3 scripts/invoke_agents.py --interactive --personality Sage
This starts an interactive session where you can have a multi-turn conversation with an agent. The agent remembers context between messages.