+0
日增长
9,779
stars
1,166
forks
77
watchers
1,067
prs
457
issues
22
releases
README
🎉 Join our new official Discord community! Connect with other LangChain Go developers, get help and contribute: Join Discord
🦜️🔗 LangChain Go
⚡ Building applications with LLMs through composability, with Go! ⚡
🤔 What is this?
This is the Go language implementation of LangChain.
📖 Documentation
- Documentation Site
- API Reference
🎉 Examples
See ./examples for example usage.
go
package main
import (
"context"
"fmt"
"log"
"github.com/tmc/langchaingo/llms"
"github.com/tmc/langchaingo/llms/openai"
)
func main() {
ctx := context.Background()
llm, err := openai.New()
if err != nil {
log.Fatal(err)
}
prompt := "What would be a good company name for a company that makes colorful socks?"
completion, err := llms.GenerateFromSinglePrompt(ctx, llm, prompt)
if err != nil {
log.Fatal(err)
}
fmt.Println(completion)
}
shell
$ go run .
Socktastic
Resources
Join the Discord server for support and discussions: Join Discord
Here are some links to blog posts and articles on using Langchain Go:
- Using Gemini models in Go with LangChainGo - Jan 2024
- Using Ollama with LangChainGo - Nov 2023
- Creating a simple ChatGPT clone with Go - Aug 2023
- Creating a ChatGPT Clone that Runs on Your Laptop with Go - Aug 2023
Contributors
There is a momentum for moving the development of langchaingo to a more community effort, if you are interested in being a maintainer or you are a contributor please join our Discord and let us know.Top issues
#1071Community development37 comments · 2024-11-22#820vectorstores: Support chromem-go14 comments · 2024-05-05#1110Add Support for DeepSeek LLM Integration10 comments · 2025-01-22#369Splitting langchaingo into sub-modules10 comments · 2023-11-23#119[feature request] possible to use golang openai client? 10 comments · 2023-06-08#1225Agents executor can't finished before max iterations9 comments · 2025-04-14#1103Proposing a new package called Toolbox which facilitates using a group of tools9 comments · 2025-01-15#580Conversation With Memory9 comments · 2024-01-29
Discussions
#1470How to output the thought process when building an agent?0 comments · 2026-02-01#1459DuckDB based VectorStore?0 comments · 2026-01-07#1458Is there a WithSystemPrompt option in any of the llm's?0 comments · 2026-01-07#1410Is there a way to list all available models?0 comments · 2025-09-29#1354Streaming for the agent. Help needed1 comments · 2025-08-09#1282RFC: Making langchaingo More Modular, Extensible, and Developer-Friendly4 comments · 2025-05-31#1256How intgerate googleapis/go-genai with langchaingo0 comments · 2025-05-16#1212Use Deepseek with langchaingo1 comments · 2025-04-08
Latest release
v0.1.15 v0.1.15 2026-10-05A patch release that replaces three retired default models, adds typed reasoning content and OpenAI web search, and fixes a number of provider bugs. Action required googleai, vertex: default embedding model is now gemini-embedding-001. embedding-001 now returns 404. The new model produces 3072-dimension vectors that are not comparable with the old ones, so indexes built with the old default must be re-embedded (and fixed-size vector columns resized). googleai, vertex: default chat model is now gemini-2.5-flash. gemini-2.0-flash is retired. Gemini 2.5 thinks by default and thinking counts t