AI Agents with LangChain & Autonomous Workflows · Урок

Когнитивные архитектуры для агентов

Погрузитесь в изучение устоявшихся когнитивных архитектур, например SOAR и ACT-R, моделирующих человекоподобные процессы рассуждения и обучения агентов искусственного интеллекта.

Урок 4 из 612 шагов

«Когнитивные архитектуры для агентов» — бесплатный урок AI Agents with LangChain & Autonomous Workflows на CoddyKit. Это урок 4 из 6. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения AI Agents with LangChain & Autonomous Workflows, и твой прогресс синхронизируется между веб-версией и приложением CoddyKit. Курс AI Agents with LangChain & Autonomous Workflows содержит 6 уроков всего.

Части этого урока еще не переведены и отображаются на английском.

Intro to Cognitive Agents

Welcome! Today, we'll explore Cognitive Architectures. These aren't just simple programs; they're frameworks designed to mimic human-like reasoning, learning, and decision-making in AI agents.

They bridge the gap between reactive agents and truly intelligent systems capable of complex problem-solving.

Why Cognitive Architectures?

Simple agents react to immediate percepts. But what if an agent needs to plan, learn from mistakes, or understand complex situations?

  • Human-like Intelligence: Model how humans think.
  • General Problem Solving: Tackle diverse tasks, not just one.
  • Learning & Adaptation: Improve performance over time.
  • Robustness: Handle unexpected situations.

Core Components of Cognition

Most cognitive architectures share common building blocks, inspired by human psychology:

  • Perceptual System: How the agent "sees" the world.
  • Memory Systems: Short-term (working) and long-term knowledge.
  • Decision-Making: How the agent chooses its next action.
  • Motor System: How the agent acts on the world.

SOAR: State, Operator, Result

SOAR (State, Operator, And Result) is a classic cognitive architecture. It views all intelligence as a continuous process of problem-solving, represented as searching through a state space.

SOAR operates in decision cycles, constantly choosing operators to apply to the current state to reach a desired result.

SOAR's Working Memory

SOAR's working memory holds the agent's current understanding of the world, its goals, and the current problem state. It's temporary and constantly updated.

Think of it as the agent's "consciousness" at any given moment. Here's a simplified representation:

public class SoarWorkingMemory {
  String goal;
  String currentState;
  boolean obstacleDetected;

  public SoarWorkingMemory(String goal, String state) {
    this.goal = goal;
    this.currentState = state;
    this.obstacleDetected = false;
  }

  public void updateState(String newState) {
    this.currentState = newState;
  }

  public String toString() {
    return "Goal: " + goal + ", State: " + currentState +
           ", Obstacle: " + obstacleDetected;
  }

  public static void main(String[] args) {
    SoarWorkingMemory wm = new SoarWorkingMemory("ReachExit", "StartRoom");
    System.out.println(wm);
    wm.updateState("Corridor");
    System.out.println(wm);
  }
}

SOAR's Production Rules

SOAR uses production rules (if-then rules) in its long-term memory to propose and select operators. When a rule's if condition matches the working memory, its then part proposes an action or modifies the state.

This example shows a simple rule for moving an agent:

public class SoarProductionRule {
  public static void main(String[] args) {
    String currentState = "near_door";
    String goal = "exit_room";

    System.out.println("Current State: " + currentState);
    System.out.println("Goal: " + goal);

    // A simple SOAR-like production rule
    if (currentState.equals("near_door") && goal.equals("exit_room")) {
      System.out.println("Rule Fired: Propose 'open_door_operator'");
      System.out.println("Action: Agent opens the door.");
      currentState = "door_open"; // State update
    } else {
      System.out.println("No matching rule fired.");
    }
    System.out.println("New State: " + currentState);
  }
}

SOAR's Learning: Chunking

A unique feature of SOAR is chunking. When the agent encounters an impasse (a situation where it can't decide what to do), it enters a sub-state to resolve it.

Once the impasse is resolved, SOAR "chunks" the experience, creating a new production rule that directly solves that type of impasse in the future. This is how SOAR learns!

ACT-R: Adaptive Control of Thought

ACT-R (Adaptive Control of Thought—Rational) is another prominent cognitive architecture. It's designed to model human cognition at a finer grain, focusing on psychological data and predicting human behavior.

ACT-R emphasizes a modular structure, with distinct memory systems and processes working together.

ACT-R's Memory Modules

ACT-R has several key modules, including:

  • Declarative Memory: Stores factual knowledge (e.g., "Paris is the capital of France") as discrete units called chunks.
  • Procedural Memory: Stores "how-to" knowledge (e.g., "how to tie a shoe") as production rules.
  • Goal Module: Manages the agent's current goals.
  • Imaginal Module: Holds temporary problem representations.

Activation & Utility in ACT-R

Unlike SOAR's pure rule-matching, ACT-R's modules interact based on activation and utility:

  • Activation: Chunks in declarative memory have an activation level, influencing how quickly they can be retrieved. More relevant or recent chunks have higher activation.
  • Utility: Production rules in procedural memory have a utility value, reflecting their past success. Rules with higher utility are more likely to be chosen.

Cognitive Arch. Check

Let's check your understanding of these cognitive architectures.

Recap: Cognitive Agents

We've explored Cognitive Architectures, frameworks that aim for human-like intelligence. We looked at:

  • SOAR: Problem-solving as search, using production rules and learning via chunking.
  • ACT-R: A modular system with declarative and procedural memory, guided by activation and utility.

These architectures provide powerful models for building agents that can reason, learn, and adapt in complex ways.

Можно начать бесплатно

Изучай AI Agents with LangChain & Autonomous Workflows с ИИ-репетитором — бесплатно

Пиши и запускай код прямо в браузере, получай мгновенную помощь от ИИ-репетитора 24/7 и продолжи учиться на сайте или в приложении.

Курсы
12
Уроки
50

Часто задаваемые вопросы

Урок «Когнитивные архитектуры для агентов» бесплатный?

Да — полный текст урока «Когнитивные архитектуры для агентов» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс AI Agents with LangChain & Autonomous Workflows, подпишись на CoddyKit PRO. Курс AI Agents with LangChain & Autonomous Workflows содержит 6 уроков всего.

Чему я научусь в уроке «Когнитивные архитектуры для агентов»?

Погрузитесь в изучение устоявшихся когнитивных архитектур, например SOAR и ACT-R, моделирующих человекоподобные процессы рассуждения и обучения агентов искусственного интеллекта. Ты практикуешь AI Agents with LangChain & Autonomous Workflows с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.

Нужен ли мне опыт, чтобы начать AI Agents with LangChain & Autonomous Workflows?

Предыдущий опыт не требуется. AI Agents with LangChain & Autonomous Workflows на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 4 из 6.

Сколько времени занимает урок «Когнитивные архитектуры для агентов»?

Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.

Можно ли писать и запускать код в этом уроке AI Agents with LangChain & Autonomous Workflows?

Да. Каждый урок AI Agents with LangChain & Autonomous Workflows включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.

Все уроки этого курса

  1. Агенты ReAct и планирования с выполнением
  2. Иерархические архитектуры агентов
  3. Агенты самокоррекции и рефлексии
  4. Когнитивные архитектуры для агентов
  5. Шаблоны взаимодействия нескольких агентов
  6. Гибридные системы агентов
← Назад к AI Agents with LangChain & Autonomous Workflows