Orchestrating Work
This blog post, "Architecting Agentic AI Workflows (Part 5)," builds upon previous discussions of the AI computer and LLM as an operating system. It shifts focus from single LLM interactions to creating complex, multi-step AI solutions using AI Agents.
Managing AI Tasks: Building Smart AI Systems, Part 5
Recap: The AI Computer, Its Operating System, and Building Apps
In Part 1: The AI Transistor, we looked inside the AI computer to see how it's built. Then, in Part 2: The Pattern Matching Computer, we learned how it works by finding patterns in data. In Part 3: The Large Language Model Operating System, we talked about large language models (LLMs) as a new type of computer system that handles digital information and tools. Most recently, in Part 4: Building Apps: Your Code and the LLM API, we learned how to write code to work with this LLM system. We used things like APIs (Application Programming Interfaces), prompt engineering, tool calling, the Model Context Protocol, and the Vercel AI SDK.
Now that we know how to build apps that connect to one LLM system at a time, the next big step in AI development is building systems that can do difficult tasks that have many steps. These tasks often need to talk to the LLM system many times or even manage several LLMs and tools working together. This is what we call Agentic AI Workflows.
Introduction to AI Agents: From Simple Orders to Working Together
Until now, we've mostly used the LLM system for one-time questions or simple chats. But what if we need the AI to do a complex job that needs planning, repeated actions, and smart choices over time? This is where the idea of an AI agent becomes important.
An AI agent is a computer program that uses an LLM as its 'brain.' It uses this brain to understand its surroundings (by watching or using tools), make choices (using the LLM's thinking ability), take steps (by using tools), and keep trying until it reaches a goal. They work in a continuous cycle, going beyond just asking and answering questions.
Key components of an AI agent often include:
- Memory: To remember information over time (both short and long-term).
- Planning: The ability to break down big goals into smaller steps.
- Tool use: The ability to choose and use other tools (like APIs, databases, or code interpreters) to do things or get information.
- Reasoning: The LLM's ability to understand, decide, and create explanations.
- Repeated actions: The agent does one step, sees what happens, and then plans the next step.
Building the Team: Tools for Managing AI Work
Building AI agents from the beginning can be complex, involving complicated repeating steps, 'if-then' rules, and keeping track of information. Luckily, special tools have been created to make it easier to manage these AI systems that do many tasks.
LangChain is one of the most popular tools for building apps that use LLMs. It offers a set of building blocks and connections to link LLMs with data sources, tools, and agents. Its main strength is that it can connect with many other systems and is flexible in combining different features.
LangGraph, a newer tool built on LangChain, helps solve problems with AI agent apps that remember information and have many steps. It lets developers set up agents as points in a diagram, clearly controlling how information and actions move between different steps, LLM requests, and tool uses. This makes it great for building complex, reliable AI systems where agents need to remember what they're doing and make choices based on changing situations. It's especially powerful for creating strong and fixable multi-step processes.
These tools help us go beyond one LLM system working alone (like a single question and answer) to manage a 'team' of smart actions.
Making Systems Reliable: How 'Effect' Helps in AI Agent Design
When designing complex AI systems that do many tasks, especially those with multiple steps, using outside tools, and things that might go wrong, making sure they are reliable and can recover from problems is super important. This is where the ideas from Systemically Sound Programming with Effect-TS (which we talked about in another series) are very helpful.
Effect provides powerful ways for:
- Running at the same time: Handling many AI agent tasks or tool uses at the same time without them getting in each other's way.
- Clear error handling: Making sure all possible problems in an agent's process are clearly dealt with.
- Managing resources: Making sure that outside resources (like API connections that tools open) are correctly taken and given back, even if there are errors.
- Providing what's needed: Building agents that are easy to change and test by clearly saying what outside services they need and giving them those services.
Using Effect lets developers build complex AI systems that do many tasks with certainty. They know that the system is strong, can be tested, and can handle problems, even with the unpredictable nature of the real world and how LLMs act.
The Future of Collaboration: Your AI Buddies
The idea behind these managed AI systems brings us to the concept of AI Buddies. This is where my own tools, BuddyTalk and BuddyAgents, come in. Buddy is a TypeScript agent tool based on Effect, with a React interface for chatting with agents. It aims to make it easier to create these strong AI systems that run many tasks at once, letting developers build advanced AI helpers that can do many steps. This next generation of apps will change how we use technology in a big way, moving towards a real teamwork and smart partnership.
Conclusion: Next Steps in the Series
Designing AI systems that do many tasks is the next big step in creating smart apps. By using tools like LangChain and LangGraph, and using ideas for strong systems (like those from Effect), developers can go beyond simple LLM chats to create complex, reliable agents. These agents are the basis for a new time of teamwork between people and technology. In the next, optional part of this series, "The Human Element: When Wetware Meets Software," we will look at the deep philosophical and practical effects of this teamwork, and how it changes our very existence.