Favicon of LangChainGo

LangChainGo

An open-source Go library for building LLM applications with Ollama, OpenAI and Gemini, plus components for agents and document retrieval. MIT licensed.

LangChainGo is a Go implementation of LangChain for developers building LLM applications in their own software. It connects Go programs to model backends, including Ollama for local LLM use and cloud services such as OpenAI and Gemini. It's a library, so its audience is developers who want to build an application rather than use a ready-made chat interface.

Its main draw is the set of components around model calls. Prompt templates and chains help developers combine prompts with other application steps. Agent components support tool calling, while memory and output parsers cover conversation context and processing model responses. The OpenAI integration also supports web search tools.

For applications that answer questions about documents, the library includes document loaders, text splitters, embeddings and vector store integrations. These cover the stages between reading source material and retrieving relevant text for a model. Named storage integrations include Milvus and Azure AI Search, and a recursive directory loader can read documents across nested folders.

The choice of backend matters for deployment: Ollama provides a local model route, while OpenAI and Gemini calls use cloud services. LangChainGo is open source under the MIT license. Its documentation includes an API reference and examples, including material on using Ollama and building a chat application that runs on a laptop.

Similar to LangChainGo