Building Compound AI systems

Building Compound AI systems

Introduction

In this article, I will explain how I think about building and optimizing compound AI pipelines with Langtrace , DSPy and CrewAI . I strongly believe that this is how compound AI systems optimized for high performance and reliability will be built in the future.

Composing the pipeline

Create individual projects for each block of the pipeline in Langtrace. This represents the individual blocks of my pipeline.

Langtrace - Projects view

Setting up DSPy projects

I think of each block as a set of inputs and outputs. For tasks that have well defined/structured input(s) and output(s), I use DSPy where I pick an optimizer and write an evaluation function that optimizes for the given metric. I create 'DSPy' projects on Langtrace for this and run experiments until I get what I want.

Langtrace - DSPy Experiments

The nice thing about Langtrace is, each time I run my experiments, it automatically captures the checkpoints. Checkpoints can be directly copied and deployed to production once I achieve the desired metric. Additionally, I can also keep track of my cost so I know when to switch to a lower cost model if I need to lower my cost.

Langtrace - Cost tracking for DSPy Experiments

Setting up CrewAI projects

For open ended tasks like doing a research on a particular topic where I don't look for a specific format, I use CrewAI and I create a 'CrewAI' project on Langtrace to capture sessions and tweak/iterate it until I get what I need consistently.

Langtrace - CrewAI dashboard

Within the CrewAI dash, I can track every session, the agent(s) deployed and it's associated tasks and tools, along with a session drill down of what's actually going under the hood. This helps me identify issues like prompt front loading, latency etc. and iterate until I achieve the ideal outcome. Once I get there, I just deploy the CrewAI agent out to production.

Langtrace - CrewAI Session drilldown

Conclusion

Finally, if you are interested in building Compound AI pipelines like these, check out Langtrace and leave any feedback you have. It's free to get started and I am happy to provide additional credits if needed.



Zachary Gonzales

Cloud Computing, Virtualization, Containerization & Orchestration, Infrastructure-as-Code, Configuration Management, Continuous Integration & Deployment, Observability, Security & Compliance

5 个月

Composing AI services unlocks potential, enabling reliability and performance. Karthik Kalyanaraman

要查看或添加评论,请登录

Karthik Kalyanaraman的更多文章

  • Evaluate CrewAI Agents using Langtrace

    Evaluate CrewAI Agents using Langtrace

    With the latest update, you can now evaluate both entire agent sessions and individual operations across your entire…

  • Attribute Extraction from Images using DSPy

    Attribute Extraction from Images using DSPy

    Introduction DSPy recently added support for VLMs in beta. A quick thread on attributes extraction from images using…

    1 条评论
  • Automatic Prompt Generation using DSPy

    Automatic Prompt Generation using DSPy

    Introduction In this post, I will show you a simple implementation of "automatic prompt generation" for solving math…

    1 条评论
  • OpenAI launches Evals, Tracing & Fine tuning

    OpenAI launches Evals, Tracing & Fine tuning

    Introduction ?? OpenAI makes an official entry into application specific Evals and LLM Ops tooling. OpenAI announced…

  • Why you need OpenTelemetry based Observability for your AI apps

    Why you need OpenTelemetry based Observability for your AI apps

    Introduction With the advent of LLMs, modern software development is going through an important shift - from mostly…

  • Evaluating the AI Oracle approach

    Evaluating the AI Oracle approach

    Recently, I came across this tweet about the AI Oracle approach for improving the accuracy and quality of responses for…

  • The year of Podcasts and Audio as UX vs the rest

    The year of Podcasts and Audio as UX vs the rest

    In 2019, I think the biggest threat to social media is going to be digital audio streaming (Podcasts and digital music…

    2 条评论
  • LinkedIn’s nifty new feature?—?Career Advice

    LinkedIn’s nifty new feature?—?Career Advice

    Recently, I was dabbling with LinkedIn’s features when I came across this new spot on my profile’s “Your Dashboard”…

    5 条评论

社区洞察

其他会员也浏览了