Skip to content

Upgrading my web app template to include agent capabilities⚓︎

I've previously discussed my Web App Guide that I created to understand how to build a basic scaffold for various web app projects using Go, gqlgen, and Next (see the tutorial here). Now, this guide includes agent functionalities using LangChain!

This guide shows an example of how to create a basic LangChain agent in Typescript using the ChatOpenAI interface. With this in place, we can use any OpenAI compatible providers - and since I like to work locally and out from behind a paywall, I show how to use locally served LLMs with LM Studio.

Besides creating a basic agent, I also show how to give it memory so that it can follow along with previous chat histories. I then show how to put everything together on the frontend by creating chat thread routing (so that the UI displays the selected chat thread and the agent only has memory of this selected chat) and creating chat components to display everything with some nice visuals.

Soon, I plan on adding a more in-depth tutorial outlining some of the more complex logic. If time permits, I might also include how to persist our data with a Postgres DB, so stay tuned! You can also check out some of my other in-depth tutorials covering various aspects of AI .