Skip to content

Commit bcf33a2

Browse files
committed
feat: Add code-first prompt templates for agent code execution
This commit adds optimized prompt templates that guide agents to write code instead of making direct tool calls, enabling the Code Execution with MCP approach for massive token reduction. New features: - Code execution prompts module in terraphim_multi_agent - TypeScript system prompt with complete MCP tool documentation - Python system prompt with type-annotated tool usage - Task analysis for automatic execution mode selection - Anti-patterns guidance to avoid token waste - Examples showing in-environment data processing Key capabilities: - Agents can now be configured for code-first behavior - Prompts emphasize processing data in-environment - Return only minimal results (not raw data) - Parallel execution patterns for efficiency - Error handling and robustness guidelines This completes the foundation for Code Execution with MCP: 1. ✅ MCP code generation (TypeScript/Python wrappers) 2. ✅ Runtime bridge for VM environments 3. ✅ Code-first prompts for agents 4. 🔲 VM integration (next phase) 5. 🔲 End-to-end testing (next phase) Expected token reduction: 98% for complex workflows
1 parent 9dcddee commit bcf33a2

3 files changed

Lines changed: 481 additions & 0 deletions

File tree

crates/terraphim_multi_agent/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pub mod genai_llm_client;
3535
pub mod history;
3636
pub mod llm_types;
3737
pub mod prompt_sanitizer;
38+
pub mod prompts;
3839
pub mod vm_execution;
3940
// pub mod llm_client; // Disabled - uses rig-core
4041
// pub mod simple_llm_client; // Disabled - uses rig-core

0 commit comments

Comments
 (0)