langchain-ai / langchain-nextjs-template

LangChain + Next.js starter template
https://langchain-nextjs-template.vercel.app
MIT License
1.28k stars 253 forks source link

Chat history #12

Open AliSiddique opened 8 months ago

AliSiddique commented 8 months ago

I am trying to add chat history, but i keep getting errors. Is there a way to add chat history in this app? I am using upstash redis for memory store.

rossanodr commented 1 month ago

did you find this out?

I am trying to add chat history, but i keep getting errors. Is there a way to add chat history in this app? I am using upstash redis for memory store.

AliSiddique commented 1 month ago

did you find this out?

I am trying to add chat history, but i keep getting errors. Is there a way to add chat history in this app? I am using upstash redis for memory store.

This repo is using the legacy adapter, so you can use the event callbacks: https://sdk.vercel.ai/docs/reference/stream-helpers/langchain-stream. You can easily integrate redis when using the callbacks to add chat to a certain chat. An example is https://github.com/saasunderone/ai-saasunderone/blob/main/src/app/api/chat/route.ts. Hope this helps!