Agents according to Anthropic and Pocketflow

How Anthropic defines agents and how PocketFlow abstracts them

Anthropic says…

One thing I have run across before starting this journey, was the distinction between a workflow and an agent. Specifically, from Anthropic:

  • Workflows are systems where LLMs and tools are orchestrated through predefined code paths.
  • Agents, on the other hand, are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks.

These definitions come from a longer piece on Building Effective Agents, which I’ve not read yet. For now, I like their lens. The workflow is static and the agent is dynamic.

Pocketflow finds the abstraction

Today, I read a substack post from PocketFlow

This has been in my queue for a while, mostly because they abstracted the core pattern at the center of several agent frameworks. Here’s the extract:

If you dig deeper, you’ll uncover these hidden graphs in overcomplicated frameworks:

  • OpenAI Agents: run.py#L119 for a workflow in graph.
  • Pydantic Agents: _agent_graph.py#L779 organizes steps in a graph.
  • Langchain: agent_iterator.py#L174 demonstrates the loop structure.
  • LangGraph: agent.py#L56 for a graph-based approach.

Now, I’m not looking for implementation tools and systems at this point. I’m looking for understanding of the fundamentals for orchestrating LLMs and tool use.

I didn’t walk away from this post with great insights. It did help illustrate something I’ve seen elsewhere, which is that agents are “simply” about an LLM making decisions on taking actions.

In fact, the examples about providing and selecting a tool were all within the main prompt. So that has introduced a new question about informal vs formal tool calling. I’ll be keeping an eye out for that in future investigation.

The post did a good job of showing how shared state between steps is important. In fact, the shared state reminds me of the reference to a blackboard system, recently made by my internet friend Manuel (aka @ProgramWithAI).

A blackboard system is an artificial intelligence approach based on the blackboard architectural model, where a common knowledge base, the “blackboard”, is iteratively updated by a diverse group of specialist knowledge sources, starting with a problem specification and ending with a solution.

When I glance at the PocketFlow core code, it’s really abstract. It’s cool for a library implementation, but it’s a bit too abstract to help me with learning how an agent works internally. I suspect I would like using the library though, when it comes time to do my own concrete implementations.

I do appreciate the commitment to “it’s just 100 lines of code that lets you see exactly how agents work!”

the 100 lines of pocketflow core

More links:

Close

Today I wrote the background entry as well as this entry. My journey is off to a good start.