{"id":16728282,"url":"https://github.com/tmc/langgraphgo","last_synced_at":"2025-08-11T20:31:18.858Z","repository":{"id":228871361,"uuid":"749135518","full_name":"tmc/langgraphgo","owner":"tmc","description":"langgraph for Go","archived":false,"fork":false,"pushed_at":"2024-04-23T17:04:58.000Z","size":15,"stargazers_count":58,"open_issues_count":3,"forks_count":11,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-12-01T10:23:34.778Z","etag":null,"topics":["langchain","langchaingo"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-27T17:25:24.000Z","updated_at":"2024-11-17T07:10:29.000Z","dependencies_parsed_at":"2024-03-20T22:24:46.551Z","dependency_job_id":"e0991892-de2a-4775-9d56-0a5ea12481d8","html_url":"https://github.com/tmc/langgraphgo","commit_stats":null,"previous_names":["tmc/langgraphgo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Flanggraphgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Flanggraphgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Flanggraphgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Flanggraphgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmc","download_url":"https://codeload.github.com/tmc/langgraphgo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229586761,"owners_count":18096678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["langchain","langchaingo"],"created_at":"2024-10-12T23:09:39.923Z","updated_at":"2024-12-13T18:34:47.628Z","avatar_url":"https://github.com/tmc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦜️🔗 LangGraphGo\n\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/tmc/langgraphgo)\n\n\n## Quick Start\n\n\nThis is a simple example of how to use the library to create a simple chatbot that uses OpenAI to generate responses.\n\n```go\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/tmc/langchaingo/llms\"\n\t\"github.com/tmc/langchaingo/llms/openai\"\n\t\"github.com/tmc/langchaingo/schema\"\n\t\"github.com/tmc/langgraphgo/graph\"\n)\n\nfunc main() {\n\tmodel, err := openai.New()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tg := graph.NewMessageGraph()\n\n\tg.AddNode(\"oracle\", func(ctx context.Context, state []llms.MessageContent) ([]llms.MessageContent, error) {\n\t\tr, err := model.GenerateContent(ctx, state, llms.WithTemperature(0.0))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn append(state,\n\t\t\tllms.TextParts(schema.ChatMessageTypeAI, r.Choices[0].Content),\n\t\t), nil\n\n\t})\n\tg.AddNode(graph.END, func(ctx context.Context, state []llms.MessageContent) ([]llms.MessageContent, error) {\n\t\treturn state, nil\n\t})\n\n\tg.AddEdge(\"oracle\", graph.END)\n\tg.SetEntryPoint(\"oracle\")\n\n\trunnable, err := g.Compile()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\t// Let's run it!\n\tres, err := runnable.Invoke(ctx, []llms.MessageContent{\n\t\tllms.TextParts(schema.ChatMessageTypeHuman, \"What is 1 + 1?\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res)\n\n\t// Output:\n\t// [{human [{What is 1 + 1?}]} {ai [{1 + 1 equals 2.}]}]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmc%2Flanggraphgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmc%2Flanggraphgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmc%2Flanggraphgo/lists"}