Chains and agents

Concetti di LLMOps

Max Knobbout, PhD

Applied Scientist, Uber

LLM lifecyle: Chains and agents

Overview of the LLM application lifecycle phases

Concetti di LLMOps

From prompts to applications

Prompt template for dish calorie classification

 

  • To use this template, we need:
    • Examples
    • Input
  • We go through a few steps:
    1. Receiving input
    2. Searching examples
    3. Prompt creation
    4. Output retrieval
    5. Output parsing
Concetti di LLMOps

A chain using our template

 

A LLM application using a chain where we retrieve similar dishes from database

Concetti di LLMOps

The need for chains

 

A playful image of three cartoon characters drawing a chain

 

 

  • Develop sophisticated applications
  • Establish a modular design, enhancing scalability and operational efficiency
  • Unlock endless possibilities for customization
Concetti di LLMOps

Agents

 

 

A playful image of a cartoon riding a robot mouse

 

  • Agents consist of:
    • Multiple actions (or tools)
    • An LLM deciding which action to take

 

  • Useful when:
    • There are many actions
    • The optimal sequence of steps is unknown
    • We are uncertain about the inputs
Concetti di LLMOps

Agents

An agent architecture where we have two actions

Concetti di LLMOps

Agents

An agent architecture where we have two actions

Concetti di LLMOps

Agents

An agent architecture where we have two actions

Concetti di LLMOps

The difference between chains and agents

 

 

Chains 🔗 Agents 🤖
Nature Deterministic Adaptive
Complexity   Low High
Flexibility Low High
Risk Lower (due to predictability)                 Higher (due to adaptability)                
Concetti di LLMOps

The development cycle

Development cycle where we have added the activity of prompt engineering

Concetti di LLMOps

The development cycle

Development cycle with chain and agents.

Concetti di LLMOps

The development cycle

Development cycle where we added the activity of chain and agent development

Concetti di LLMOps

Let's practice!

Concetti di LLMOps

Preparing Video For Download...