Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Core Agent and Server functionalities..Make agent embeddable #2021

Open
raolak opened this issue Nov 11, 2024 · 3 comments
Open

Separate Core Agent and Server functionalities..Make agent embeddable #2021

raolak opened this issue Nov 11, 2024 · 3 comments
Labels

Comments

@raolak
Copy link

raolak commented Nov 11, 2024

Is your feature request related to a problem? Please describe.
For some of the use cases, we need to execute tools which has local resource dependency...example Code generation, build and deploy etc... At present, we need to deploy entire agent and server code to get this working... Is is possible to isolate [agent+tools] and server code?

Describe the solution you'd like
-Keep agent light weight with ability deploy tools along side agents .

  • One should able to embed agents into their apps.. Example can extend agent base image and add more features as required
  • Agent can talk to letta server to fetch memory, documents/sources , settings etc

Describe alternatives you've considered
I am prototyping building workflow which uses a specific agent ..agent needs to execute tools on local resource, i end setting up letta per workflow, which i think little overkill considering letta already has tenancy/ruser based isolation that I can work with.

@sarahwooders
Copy link
Collaborator

sarahwooders commented Nov 11, 2024

Is the use-cases here that you want to have an ephemeral agent embedding in your application? The reason why we have a lot of stuff related to persistence (and requiring tools to be persistable outside of the application) is so that agents can be fully saved in a DB and reloaded later by the server. Or is it that you want to have persisted agents (agent memories are saved) but tools only exist locally?

The challenge with having the server executing remotely but the tools executing locally is that then there needs to be a way for the server to communicate back to the local code to request that it execute a tool. This could be done by having a listener on the client that allows it to receive requests from the server, or to have internal client code manage multiple requests to the server until the server has completed execution:

[client] call agent 
[server] run agent step(), call tool_A -> send tool_A(args) to client 
[client] execute tool_A(args) -> send response to server 
[server] continue... 

An alternative would be for you to use the LocalClient (if you are using Python) so that the server code is running on your machine, but we have Tool objects actually not be persisted, and the agent has access to a reference to the code you want to run -- and this is used instead of loading the tool code form the DB (what happens now). So

def my_local_function(self, args)
    ... 

# keep a reference to the code, to call from the locally running server
tool = Tool(func=my_local_function, ...) 

agent = client.create_agent(tools=[tool], ...) 

This would require fewer changes to Letta, but would require that the code be written in Python and is a bit hacky (and you also wouldn't be able to interact with a remote server).

Let me know what you think of either of these options, and if I'm understanding your issue correctly.

@raolak
Copy link
Author

raolak commented Nov 15, 2024 via email

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants