Blades
A Go framework for composing multimodal agents from models, tools, memory, middleware, and workflows.
What does this agent do, and when should you use it?
Blades is a multimodal AI Agent framework for Go, not a separately hosted chat application. Its common Agent execution contract is Run(context.Context, *Invocation), which returns Generator[*Message, error], and Agent, Chain, and ModelProvider can be composed around that model. The framework exposes pluggable ModelProvider, Tool, Memory, and Middleware components, while flow coordinates multi-step reasoning and transfers data and control between Agents. Model output can be collected in full with Generate or consumed incrementally through NewStreaming; the supplied example runs an OpenAI-backed agent through Runner in application code. It fits teams building agent behavior inside Go services, but the README does not document a standalone deployment, CLI, or installation command.
An application creates a ModelProvider, such as openai.NewModel("gpt-5", openai.Config{APIKey: os.Getenv("OPENAI_API_KEY")}), then creates an agent with blades.NewAgent plus WithModel and WithInstruction. The caller builds a blades.UserMessage, invokes blades.NewRunner(agent).Run(context.Background(), input), and reads Text() from the returned message. For extensions, Tool uses InputSchema and Handle to represent callable external capabilities; Memory saves and searches messages by session; Middleware adds behavior around Runner execution. Skills can be loaded with skills.NewFromDir("./skills") or skills.NewFromEmbed(embed.FS) and passed through WithSkills(...).
- A Go backend team embedding an OpenAI-backed, multi-turn question-answering agent in an existing service.
- A developer connecting several Agents or Chains into a multi-step reasoning workflow in a Go application.
- A team exposing database queries or API calls as model-callable functions with an InputSchema for invocation parameters.
- An application that needs session-scoped conversation memory so later turns can retain context.
- An engineering team adding logging, monitoring, authentication, or rate limiting around agent execution without changing Runner core logic.
What are this agent's strengths and limitations?
- A shared Agent interface and Generator-based output model connect Agent, Chain, and ModelProvider as composable execution units.
- The ModelProvider abstraction is explicitly pluggable, with OpenAI, DeepSeek, and Gemini named as services it can integrate.
- It combines tools, session memory, streaming generation, and middleware for Go applications that need agent capabilities.
- Skills can be loaded from a directory or packaged into the binary with embed.FS.
- The README lacks installation commands, a Go version, module-version guidance, and a standalone deployment path, leaving initial project setup to adopters.
- The OpenAI example requires network access and OPENAI_API_KEY; cost and availability depend on the chosen model provider.
- Persistent and more advanced memory strategies are left to extensions; the README explicitly identifies only an InMemory implementation.
- No CLI, HTTP service surface, or production operations configuration is shown, so adopters must define the application boundary themselves.
How do you install or deploy this agent?
The README does not provide a copyable installation command, a required Go version, or module setup instructions, so an exact dependency-installation procedure is undocumented. The explicit prerequisites are a Go environment and, for the OpenAI example, OPENAI_API_KEY; the application must also be able to import github.com/go-kratos/blades and github.com/go-kratos/blades/contrib/openai.
How do you use this agent?
In a Go program, read OPENAI_API_KEY and create openai.NewModel("gpt-5", openai.Config{APIKey: os.Getenv("OPENAI_API_KEY")}). Create an agent with blades.NewAgent("Blades Agent", blades.WithModel(model), blades.WithInstruction("You are a helpful assistant that provides detailed and accurate information.")). Build input with blades.UserMessage("What is the capital of France?"), then run runner := blades.NewRunner(agent) followed by runner.Run(context.Background(), input). After checking err, call output.Text() to obtain the text response.