Agentic Workflow
by Vuong Ngo

Optimise Cost and Speed of Agentic Workflow - Reversed Engineering Approach

Author: Vuong Ngo Date: 2024-08-03 Categories: #AgenticWorkflow #AIOps #AIAgents #MLOps

Overview

The article explores automating the "Dependencies Upgrade Process" using CrewAI and Langgraph, demonstrating how autonomous agents can streamline tedious engineering tasks. The key focus is on optimizing agentic workflows to reduce costs, improve speed, and minimize hallucinations.

Key Insights

Workflow Optimization Strategies

  • Simplify Communication Flow
  • - Move from bi-directional to uni-directional communication - "For automation, uni-directional communication is more effective, similar to a manufacturing process."
  • Reduce Redundancy
  • - Break down agents into specialized roles - Explicitly pass outputs between agents - Minimize unnecessary LLM calls
  • Memory Optimization
  • - Manage short-term and long-term agent memory - Remove intermediate unnecessary outputs - Reduce prompt context complexity

    Performance Improvements

  • Initial approach: ~$2 per run, 3-minute execution
  • Optimized approach: ~16 cents, 1-minute execution
  • Essential Components for Production

  • Evaluation
  • - Use statistical and model-based checks - Implement unit tests and code coverage
  • Observability
  • - Leverage telemetry tools like OpenTelemetry - Monitor and troubleshoot workflows
  • Human-in-the-Loop
  • - Provide human oversight - Score and label LLM outputs

    Conclusion

    The article emphasizes viewing agentic systems as empowering tools that enhance human capabilities, not replacements. The author calls for careful consideration of social impact and continued collaborative development.

    Full source code available on GitHub