AI Agents with LangChain & Autonomous Workflows · Ders

Aracı Türleri ve Karar Verme

Farklı aracı türlerini (ör. ReAct, sohbet tabanlı) ve hangi aracın kullanılacağına karar vermelerini sağlayan temel mekanizmaları keşfedin.

2. ders / 411 adım

Aracı Türleri ve Karar Verme, CoddyKit'te ücretsiz bir AI Agents with LangChain & Autonomous Workflows dersidir. Bu, 4 dersinin 2. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, AI Agents with LangChain & Autonomous Workflows öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. AI Agents with LangChain & Autonomous Workflows kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Agent's Brain: How They Decide

Welcome! In this lesson, we'll dive into the fascinating world of how AI agents make decisions. It's what makes them seem 'smart' and capable of complex tasks.

Think of an agent as having a 'brain' that processes information and chooses the best next step from a set of options, often involving tools.

LLM: The Core Decision Maker

At the heart of most AI agents is a Large Language Model (LLM). The LLM isn't just for generating text; it's also the agent's primary decision-making engine.

  • It interprets your request.
  • It considers the available tools.
  • It generates a 'thought' process to decide what to do.

This 'thought' guides the agent's next action.

ReAct Agents: Reason & Act

One of the most common and powerful agent architectures is ReAct. This stands for Reasoning and Acting.

A ReAct agent works in a loop:

  1. Thought: The LLM reasons about the current situation and what to do next.
  2. Action: Based on the thought, the LLM chooses a tool and its input.
  3. Observation: The tool executes, and its output is returned to the LLM.

This cycle repeats until the agent reaches a final answer.

ReAct in Action: A Simple Loop

Imagine you ask an agent: 'What is the current weather in London?'

  • Thought: 'The user wants weather info. I have a 'weather_tool'.'
  • Action: 'Call weather_tool with city='London'.'
  • Observation: 'Weather in London: 15°C, cloudy.'
  • Thought: 'I have the answer. I should respond to the user.'
  • Action: 'Respond: 'The weather in London is 15°C and cloudy'.'

This iterative process allows agents to tackle complex tasks step-by-step.

Code: Simulating Agent Decisions

This Python code simulates a simplified agent's decision process based on user input and available tools. Notice how it 'thinks' and decides on an 'action'.

def run_agent_cycle(user_input, available_tools):
    print(f"User Input: \"{user_input}\"")
    print("Agent's Thought Process:")

    if "search" in user_input.lower() and "web_search" in available_tools:
        thought = "User wants to search. Use 'web_search' tool."
        action = "web_search(query='LangChain agents')"
    elif "calculate" in user_input.lower() and "calculator" in available_tools:
        thought = "User wants calculation. Use 'calculator' tool."
        action = "calculator(expression='5+3')"
    else:
        thought = "No specific tool. Respond directly."
        action = "Respond: 'I can help with searches/calculations.'"

    print(f"  Thought: {thought}")
    print(f"  Action: {action}")
    print("-" * 20)

if __name__ == "__main__":
    print("--- Simulating Agent Decision Making ---")
    tools_available = ["web_search", "calculator"]

    run_agent_cycle("What is the capital of France?", tools_available)
    run_agent_cycle("Calculate 10 times 5.", tools_available)
    run_agent_cycle("Tell me a joke.", tools_available)

Conversational Agents: Remembering Context

While ReAct is powerful, some agents need to maintain a continuous conversation, remembering past interactions. These are conversational agents.

Their decision-making isn't just about the current turn; it's also heavily influenced by the conversation history (their 'memory').

How Conversational Agents Decide

For conversational agents, the LLM receives not only the user's latest input but also a summary or full transcript of the previous turns.

  • This memory helps the agent understand context.
  • It allows for follow-up questions and avoids repetition.
  • The decision to use a tool or generate a direct response is informed by the entire chat history.

We'll explore memory in detail in a later course!

Other Agent Architectures (Briefly)

Beyond ReAct and basic conversational agents, there are other sophisticated architectures:

  • Plan-and-Execute Agents: First create a multi-step plan, then execute it.
  • Self-Correction Agents: Evaluate their own outputs and try again if they detect errors.
  • Tree-of-Thought Agents: Explore multiple reasoning paths before committing to an action.

Each type offers different strengths for various complex tasks.

Factors Influencing Decisions

An agent's decision-making process is influenced by several key factors:

  • User Prompt: The clarity and specificity of the user's request.
  • Available Tools: The functions and capabilities the agent has access to.
  • Memory/Context: Past interactions that provide background.
  • LLM Capabilities: The model's reasoning abilities and knowledge.

Effective agent design means balancing these elements.

Quick Check: Agent Decision Types

Consider an agent designed to answer complex, multi-step questions that might require several tool calls, and also needs to maintain a consistent persona throughout a long conversation.

Recap: Agent Decision Making

Great job! You've learned how AI agents make decisions, moving beyond just text generation.

  • The LLM acts as the agent's 'brain', interpreting input and choosing actions.
  • ReAct agents use a 'Thought-Action-Observation' loop for step-by-step problem solving.
  • Conversational agents integrate memory to maintain context over time.
  • Various factors like prompts, tools, and memory influence an agent's choices.

Understanding these decision mechanisms is key to building powerful AI applications!

Başlamak ücretsiz

Yapay zeka eğitmeniyle AI Agents with LangChain & Autonomous Workflows öğren — ücretsiz

Tarayıcında gerçek kod yaz ve çalıştır, 7/24 yapay zeka eğitmeninden anında yardım al; web'de ya da uygulamada kaldığın yerden devam et.

Kurslar
12
Dersler
50

Sıkça Sorulan Sorular

“Aracı Türleri ve Karar Verme” dersi ücretsiz mi?

Evet — “Aracı Türleri ve Karar Verme” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve AI Agents with LangChain & Autonomous Workflows kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. AI Agents with LangChain & Autonomous Workflows kursu toplamda 4 dersten oluşur.

“Aracı Türleri ve Karar Verme” dersinde ne öğreneceğim?

Farklı aracı türlerini (ör. ReAct, sohbet tabanlı) ve hangi aracın kullanılacağına karar vermelerini sağlayan temel mekanizmaları keşfedin. AI Agents with LangChain & Autonomous Workflows ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

AI Agents with LangChain & Autonomous Workflows öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te AI Agents with LangChain & Autonomous Workflows, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 2. dersidir.

“Aracı Türleri ve Karar Verme” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu AI Agents with LangChain & Autonomous Workflows dersinde kod yazıp çalıştırabilir miyim?

Evet. Her AI Agents with LangChain & Autonomous Workflows dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Araçları Tanımlama ve Kullanma
  2. Aracı Türleri ve Karar Verme
  3. Önceden Oluşturulmuş Araç Setlerinden Yararlanma
  4. Hata Yönetimi ve Güvenli Araç Çalıştırma
← AI Agents with LangChain & Autonomous Workflows Sayfasına Dön