terraphim / terraphim/terraphim-ai
feat: Implement workflow execute() methods in terraphim_multi_agent
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 62
- Forks
- 5
- Avg merge
- 2h 27m
- Merged PRs (30d)
- 1
Description
Problem
MultiAgentWorkflow::execute() in terraphim_multi_agent/src/workflows.rs is a placeholder that returns todo!() for all 5 workflow patterns:
- RoleChaining: sequential agent execution, output of N feeds input of N+1
- RoleRouting: condition-based routing to specialist agents
- RoleParallelization: concurrent agent execution with result aggregation
- LeadWithSpecialists: lead agent delegates subtasks, aggregates results
- RoleWithReview: proposal agent + review agent with feedback loop
The enum and pattern definitions exist but none execute. This blocks any actual multi-agent workflow orchestration.
Proposed Change
Implement actual workflow execution for each pattern:
- RoleChaining: Chain agents sequentially. Each agent receives the previous agent's output as context. Final output is the last agent's response.
- RoleRouting: Evaluate routing conditions against input, dispatch to the matched specialist agent.
- RoleParallelization: Spawn all agents concurrently via
tokio::join_all, aggregate results (configurable: merge, vote, or pick-best). - LeadWithSpecialists: Lead agent decomposes task, delegates subtasks to specialists, receives results, and synthesizes final output.
- RoleWithReview: Proposal agent generates output, review agent critiques, loop until approval or max iterations.
Scope
crates/terraphim_multi_agent/src/workflows.rs(currently 84 lines, expected expansion to ~400-500 lines)- Unit tests for each workflow pattern
Context
This is UPLIFT-6 from the medgemma-competition multi-agent integration plan. These workflow patterns are essential for clinical reasoning pipelines (e.g., RoleChaining for diagnosis->PGx->treatment, RoleWithReview for safety validation).
Related upstream issues: #534, #535, #536
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading terraphim_multi_agent/src/workflows.rs and the existing workflow pattern and enum definitions. Implement and test execute() for RoleChaining, RoleRouting, RoleParallelization, LeadWithSpecialists, and RoleWithReview; done means each pattern runs its described orchestration and has a unit test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100