Favicon of LangChainGo

LangChainGo

A Go library for building LLM applications with Ollama or cloud providers, tool-using agents, document search, and conversation memory.

Screenshot of LangChainGo website

LangChainGo is a Go implementation of LangChain for developers adding language models to their own applications. It provides reusable components for connecting models to documents, tools, and conversation history.

  • Model connections: Use Ollama for local models or connect to providers such as OpenAI, Anthropic, Google AI, and AWS Bedrock through a shared interface, with support for streaming responses.
  • Document search and answers: Create text embeddings, store and search documents by similarity, and use retrieved material in question-answering workflows. Supported stores include Chroma, Qdrant, Weaviate, and PostgreSQL with pgvector.
  • Agents and workflows: Link model operations into chains or build agents that use tools such as calculators, databases, and web search through SerpAPI.
  • Conversation memory: Keep conversation history and context across interactions so an application can refer back to earlier messages.

This is a library you embed in Go software, so you'll need to build the application around it. Ollama provides the local model backend; cloud model and embedding providers send requests to their respective services. SerpAPI web search also requires an external service. Your choice of model, embedding provider, and vector store determines which parts run locally. LangChainGo is open source under the MIT license.

Similar to LangChainGo