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

langchain Agents #20

Open
zlapp opened this issue Jun 20, 2023 · 7 comments
Open

langchain Agents #20

zlapp opened this issue Jun 20, 2023 · 7 comments

Comments

@zlapp
Copy link

zlapp commented Jun 20, 2023

Thanks for the great repository.
Does langcorn support langchain agents?

@nb-programmer
Copy link

I tried to use an Agent. Initially I got an error due to input_key missing. But I then modified the api file with input_keys. It worked, but I don't know how memory is handled, because the API has a memory input as well

@msoedov
Copy link
Owner

msoedov commented Jul 12, 2023

Thx for the feedback @zlapp ! I just added and tested an example agent https://github.com/msoedov/langcorn/blob/main/examples/ex7_agent.py. It works

@knitish619

This comment was marked as resolved.

@nb-programmer
Copy link

I tried to use an Agent. Initially I got an error due to input_key missing. But I then modified the api file with input_keys. It worked, but I don't know how memory is handled, because the API has a memory input as well

what modifications have you made in api file?

It was a while ago and just a quick workaround, but this is what I had changed (in api.py of the package).

image

@knitish619
Copy link

how did you handle memory ?

@msoedov
Copy link
Owner

msoedov commented Aug 21, 2023

You can store memory on the client side and pass it every time with the request. The updated memory state will be returned from the response.

@nb-programmer
Copy link

nb-programmer commented Aug 21, 2023

Just as an FYI, it is possible to add chat history memory in the chain that will store in a DB itself, without passing the burden to client
https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db

You need to pass the session id to the xyzChatMessageHistory class instantiation.

message_history = RedisChatMessageHistory(
    url="redis://localhost:6379/0", ttl=600, session_id="my-session"
)

memory = ConversationBufferMemory(
    memory_key="chat_history", chat_memory=message_history
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants