Please describe the purpose of this pull request.
This PR aims to resolve bugs resulting from inconsistent agent state and blocks, as well as simplifying the agent creation REST API route.
This PR refactors the schemas related to the agent's state:
PersistedAgentState: This is the schema defining what is persisted in the agents table
CreateAgent: This is the schema defining the route for agent creation. This PR simplifies is so that memory is created by passing in a list of CreateBlock objects, rather than a Memory object
AgentState: This schema contains all the state related to an agent contained in process memory, that is passed into Agent to instantiate an agent. It contains additional objects like the Memory object, sources, tools, and tags - since information for these is also contained in separate tables. We use this to both create the Agent class and also as the return on the client GET for agents.
This PR also cleans up the routes related to blocks:
Blocks should primarily be edited via the block_id - the block routes are on /blocks/{block_id}
Agent-block routes (e.g. attaching a block to an agent, editing an agen't block) are done via the /agents/blocks/{block_label} route, using the block_label as the reference
How to test
How can we test your PR during review? What commands should we run? What outcomes should we expect?
Have you tested this PR?
Have you tested the latest commit on the PR? If so please provide outputs from your tests.
Related issues or PRs
Please link any related GitHub issues or PRs.
Is your PR over 500 lines of code?
If so, please break up your PR into multiple smaller PRs so that we can review them quickly, or provide justification for its length.
Additional context
Add any other context or screenshots about the PR here.
Please describe the purpose of this pull request. This PR aims to resolve bugs resulting from inconsistent agent state and blocks, as well as simplifying the agent creation REST API route.
This PR refactors the schemas related to the agent's state:
PersistedAgentState
: This is the schema defining what is persisted in the agents tableCreateAgent
: This is the schema defining the route for agent creation. This PR simplifies is so that memory is created by passing in a list ofCreateBlock
objects, rather than aMemory
objectAgentState
: This schema contains all the state related to an agent contained in process memory, that is passed intoAgent
to instantiate an agent. It contains additional objects like theMemory
object, sources, tools, and tags - since information for these is also contained in separate tables. We use this to both create theAgent
class and also as the return on the clientGET
for agents.This PR also cleans up the routes related to blocks:
block_id
- the block routes are on/blocks/{block_id}
/agents/blocks/{block_label}
route, using theblock_label
as the referenceHow to test How can we test your PR during review? What commands should we run? What outcomes should we expect?
Have you tested this PR? Have you tested the latest commit on the PR? If so please provide outputs from your tests.
Related issues or PRs Please link any related GitHub issues or PRs.
Is your PR over 500 lines of code? If so, please break up your PR into multiple smaller PRs so that we can review them quickly, or provide justification for its length.
Additional context Add any other context or screenshots about the PR here.