-
2abec3eThanks @davidkpiano! - "Strategy" has been renamed to "policy", and "score" has been renamed to "reward". -
56ebde3Thanks @davidkpiano! - Set ai as peer dependency
ea0c45eThanks @davidkpiano! - You can now add insights for observations made. Insights are additional context about the observations made, which can be useful for agent decision making.
4a79bacThanks @davidkpiano! - - ThemachineandmachineHashproperties were removed fromAgentObservationandAgentObservationInput- The
defaultOptionsproperty was removed fromAgent AgentDecideOptionswas renamed toAgentDecideInput- The
executeproperty was removed fromAgentDecideInput - The
episodeIdoptional property was added toAgentDecideInput,AgentObservationInput, andAgentFeedbackInput decisionIdwas added toAgentObservationInputandAgentFeedbackInput
- The
-
bf6b468Thanks @davidkpiano! - Thestatecan no longer be specified inagent.interact(...), since the actual state value is already observed and passed to thestrategyfunction.The
contextprovided to agent decision functions, likeagent.decide({ context })and inagent.interact(...), is now used solely to override thestate.contextprovided to the prompt template.
1287a6dThanks @davidkpiano! - Addscoreandcommentfields for feedback
-
5b5a8e7Thanks @davidkpiano! - Thescoreis now required for feedback:agent.addFeedback({ score: 0.5, goal: "Win the game", observationId: "...", });
-
5b5a8e7Thanks @davidkpiano! - The entire observedstatemust be provided, instead of onlycontext, for any agent decision making functions:agent.interact(actor, (obs) => { // ... return { goal: "Some goal", // instead of context state: obs.state, }; });
-
9d65d71Thanks @davidkpiano! - Removegoalfrom feedback input
-
4d870feThanks @davidkpiano! - planner -> strategy agent.addPlan -> agent.addDecision agent.getPlans -> agent.getDecisionsThe word "strategy" is now used instead of "planner" to make it more clear what the agent is doing: it uses a strategy to make decisions. The method
agent.addPlan(…)has been renamed toagent.addDecision(…)andagent.getPlans(…)has been renamed toagent.getDecisions(…)to reflect this change. Additionally, you specify thestrategyinstead of theplannerwhen creating an agent:const agent = createAgent({ - planner: createSimplePlanner(), + strategy: createSimpleStrategy(), ... }); -
f1189cbThanks @davidkpiano! - For feedback, thegoal,observationId, andattributesare now required, andfeedbackandrewardare removed since they are redundant. -
7b16326Thanks @davidkpiano! - You can specifyallowedEventsinagent.decide(...)to allow from a list of specific events to be sent to the agent. This is useful when usingagent.decide(...)without a state machine.const agent = createAgent({ // ... events: { PLAY: z.object({}).describe("Play a move"), SKIP: z.object({}).describe("Skip a move"), FORFEIT: z.object({}).describe("Forfeit the game"), }, }); // ... const decision = await agent.decide({ // Don't allow the agent to send `FORFEIT` or other events allowedEvents: ["PLAY", "SKIP"], // ... });
6a9861dThanks @davidkpiano! - You can specifymaxAttemptsinagent.decide({ maxAttempts: 5 }). This will allow the agent to attempt to make a decision up to the specified number ofmaxAttemptsbefore giving up. The default value is2.
-
8c3eab8Thanks @davidkpiano! - Thenamefield increateAgent({ name: '...' })has been renamed toid. -
8c3eab8Thanks @davidkpiano! - Thedescriptionfield increateAgent({ description: '...' })is now used for thesystemprompt in agent decision making when asystemprompt is not provided.
- #51
574b6fdThanks @davidkpiano! - -agent.generateText(…)is removed in favor of using the AI SDK'sgenerateText(…)function with a wrapped model.agent.streamText(…)is removed in favor of using the AI SDK'sstreamText(…)function with a wrapped model.- Custom adapters are removed for now, but may be re-added in future releases. Using the AI SDK is recommended for now.
- Correlation IDs are removed in favor of using OpenTelemetry with the AI SDK.
- The
createAgentMiddleware(…)function was introduced to facilitate agent message history. You can also useagent.wrap(model)to wrap a model with Stately Agent middleware.
- #54
140fdceThanks @XavierDK! - - Addressing an issue where the fullStream property was not properly copied when using the spread operator (...). The problem occurred because fullStream is an iterator, and as such, it was not included in the shallow copy of the result object.- Update all packages
- #49
ae505d5Thanks @davidkpiano! - Updateaipackage
- #47
185c149Thanks @davidkpiano! - Updateaiandxstatepackages
- #45
3c271f3Thanks @davidkpiano! - Fix reading the actor logic
- #43
8e7629cThanks @davidkpiano! - Update dependencies
- #41
b2f2b73Thanks @davidkpiano! - Update dependencies
-
#39
3cce30fThanks @davidkpiano! - Added four new methods for easily retrieving agent messages, observations, feedback, and plans:agent.getMessages()agent.getObservations()agent.getFeedback()agent.getPlans()
The
agent.select(…)method is deprecated in favor of these methods. -
#40
8b7c374Thanks @davidkpiano! - Correlation IDs are now provided as part of the result fromagent.generateText(…)andagent.streamText(…):const result = await agent.generateText({ prompt: "Write me a song", correlationId: "my-correlation-id", // ... }); result.correlationId; // 'my-correlation-id'
These correlation IDs can be passed to feedback:
// ... agent.addFeedback({ reward: -1, correlationId: result.correlationId, });
-
#40
8b7c374Thanks @davidkpiano! - Changes to agent feedback (theAgentFeedbackinterface):goalis now optionalobservationIdis now optionalcorrelationIdhas been added (optional)rewardhas been added (optional)attributesare now optional
-
#38
21fb17cThanks @davidkpiano! - You can now addcontextZod schema to your agent. For now, this is meant to be passed directly to the state machine, but in the future, the schema can be shared with the LLM agent to better understand the state machine and its context for decision making.Breaking: The
contextandeventstypes are now inagent.typesinstead of ~~agent.eventTypes.const agent = createAgent({ // ... context: { score: z.number().describe("The score of the game"), // ... }, }); const machine = setup({ types: agent.types, }).createMachine({ context: { score: 0, }, // ... });
-
5f863bbThanks @davidkpiano! - Use nanoid -
#37
dafa815Thanks @davidkpiano! - Messages are now properly included inagent.decide(…), when specified.
-
#32
537f501Thanks @davidkpiano! - First minor release of@statelyai/agent! The API has been simplified from experimental earlier versions. Here are the main methods:createAgent({ … })creates an agentagent.decide({ … })decides on a plan to achieve the goalagent.generateText({ … })generates text based on a promptagent.streamText({ … })streams text based on a promptagent.addObservation(observation)adds an observation and returns a full observation objectagent.addFeedback(feedback)adds a feedback and returns a full feedback objectagent.addMessage(message)adds a message and returns a full message objectagent.addPlan(plan)adds a plan and returns a full plan objectagent.onMessage(cb)listens to messagesagent.select(selector)selects data from the agent contextagent.interact(actorRef, getInput)interacts with an actor and makes decisions to accomplish a goal
-
#22
8a2c34bThanks @davidkpiano! - ThecreateSchemas(…)function has been removed. ThedefineEvents(…)function should be used instead, as it is a simpler way of defining events and event schemas using Zod:import { defineEvents } from "@statelyai/agent"; import { z } from "zod"; import { setup } from "xstate"; const events = defineEvents({ inc: z.object({ by: z.number().describe("Increment amount"), }), }); const machine = setup({ types: { events: events.types, }, schema: { events: events.schemas, }, }).createMachine({ // ... });
- #18
dcaababThanks @davidkpiano! -contextis now optional forcreateSchemas(…)
- #16
3ba5fb2Thanks @davidkpiano! - Update to XState 5.8.0
-
#9
d8e7b67Thanks @davidkpiano! - Addadapter.fromTool(…), which creates an actor that chooses agent logic based on a input.const actor = adapter.fromTool(() => "Draw me a picture of a donut", { // tools makeIllustration: { description: "Makes an illustration", run: async (input) => { /* ... */ }, inputSchema: { /* ... */ }, }, getWeather: { description: "Gets the weather", run: async (input) => { /* ... */ }, inputSchema: { /* ... */ }, }, }); //...
-
#5
ae473d7Thanks @davidkpiano! - Simplify API (WIP) -
#5
687bed8Thanks @davidkpiano! - AddcreateSchemas,createOpenAIAdapter, and changecreateAgent
- #1
3dc2880Thanks @mellson! - Adds a convenient way to run the examples withpnpm example ${exampleName}. If no example name is provided, the script will print the available examples. Also, adds a fun little loading animation to the joke example.
- e125728: Added
createAgent(...)