Notes video
Embabel Agent v1.5 (Rod Johnson)
Video from Rod Johnson.
Structure in 2 Dimensions
Decomposing the flow into multiple steps:
- Try to decompose that flow into multiple steps.
- You can potentially test those steps in isolation.
- You can potentially use smaller models for each of those steps.
- Or even better, you can potentially use no model at all.
How those steps communicate:
- Those steps should take types in and send types out.
- They should take instances of strongly typed objects and return instances of strongly typed objects.
Example: Embabel Flow
An example of an Embabel flow where methods represent steps in that flow, with clearly defined inputs and outputs:
1. Extract Person
Person extractPerson(UserInput input, AI ai);
UserInputis a special Embabel type.- Uses AI to parse and extract a strongly typed
Personfrom the user input.
2. Retrieve Horoscope
Horoscope retrieveHoroscope(Person person);
- Takes the typed
Personinstance from step 1. - Can invoke a traditional service or API without requiring a language model.
3. Step 3
- (Add step 3 here)
Goal-Oriented Action Planning (GOAP) vs State Machines (LangGraph)
Why GOAP? Why is it better than LangGraph’s State Machine?
- State machines are very brittle:
- They are not good at all for business flows that can evolve or change over time.
- Handling unexpected outcomes:
- What happens if one of those steps doesn’t go the way you like? In static state machines, recovering dynamically requires hardcoded fallback paths for every permutation.
Dynamic Routing & Goal Planning
- World State Assessment: At any point in time, GOAP maintains a world state. It assesses the current world state and evaluates where you are trying to go.
@AchievesGoalAnnotation: It is always planning toward a goal. All actions are steps that could potentially get you toward the goal. An action with the@AchievesGoalannotation marks reaching the desired target state.- Deterministic Decisions over Hallucinations:
- The planner at each point assesses whether a valid path to this goal actually exists.
- When no path exists, it stops immediately: “Sorry, cannot reach goal.”
- This is a concrete, valuable decision—not a guess. That is vastly superior to an LLM hallucinating that it can fulfill the request when it cannot.
How Does It Know the World State?
- The Blackboard Architecture:
- It maintains a Blackboard (shared memory state).
- Facts, extracted typed instances, and context are published to the blackboard, giving the planner a reliable snapshot of the world state at every evaluation step.
Pipelines vs Agentic
Pipelines are the past. Agentic is the future.
Actions, Preconditions, Postconditions
- An action cannot run if its preconditions have not been set. But postconditions are a promise and they need to be verified. That’s why world state will be assessed after each action is called.
- Embabel builds on a map and then it can work out how to plan over that.
- You’re gonna end up with a lot of instances of types (records).
- Action steps: It will look at the signature of that method to determine what its preconditions are and what its postconditions are. It is Evidence that will be on blackboard.
- Roles: chat shape, input parser, decision model.
Evaluation
- Evaluation is pretty important.
Jinja
- Jinja: Python prompt externalizer.
RAG
- Past RAG vs Agentic RAG:
- Rather than just putting the chunks in the prompt to start off with, agentic RAG gives the LLM a set of tools that it can use to request things. It has the ability to iterate towards getting the result.
- Embabel Agentic RAG:
- “Give me the next chunk, give me the previous chunk.”
- We need a
SearchOperationsinstance.SearchOperationsis a super interface and the framework will look at any implementation of it and say: “I’ll use anything you can provide: vector search, full text search, chunk retrieval and expansion.” - Out of the box we support: Neo4j, pgvector, Lucene.
Skills & Progressive Disclosure
- Progressive disclosure principle: Don’t add all skills into your project. You don’t feed all of the skills to the model.
Code Mode
- Term coined at Cloudflare blog back in Nov: Idea: rather than making many individual tool calls, LLM should generate code to do multiple things in one go.
- Means that you have to consider how can I help an LLM safely write code against my stuff. You need to execute it in a sandbox.
- One program, not a hundred tool calls.
- Embabel agent experimental repo: support for sandboxes.
Decision Models
- Not every decision is a text generation problem.
- AI interface in Embabel: decision models.
Resources & Links
- hub.embabel.com
- github.com/embabel/dice: agent memory, integrated context engineering
- Embabel agents example repo
- Embabel Java template repo