Go-Calque: Pre-release 0.3.0 launched!
Go-Calque: Pre-release 0.3.0 launched!
Go-Calque
A streaming multi-agent AI framework for Go
Memory-efficient, streaming-first AI agent framework written in pure Go. Built for real-time AI workflows with LLM filters and concurrency primitives.

Key Features
Streaming-first
Handle tokens through your pipeline as it arrives, no buffering needed
Memory-Efficient
Gracefully handle large agent responses at scale
True Concurrency
Run tasks with true goroutine concurrency
Go-idiomatic
Built with Go's native primitives - no Python-like API ports
Composable
Chain middleware like HTTP handlers
AI-Native
Built to support LLMs, memory storage, templates, tool calling and more
Installation
go get github.com/calque-ai/go-calque
A Minimal Example
package main
import (
"context"
"log"
"time"
"github.com/calque-ai/go-calque/pkg/calque"
"github.com/calque-ai/go-calque/pkg/middleware/ai"
"github.com/calque-ai/go-calque/pkg/middleware/ai/ollama"
)
func main() {
// Initialize AI client
client, err := ollama.New("llama3.2:3b")
if err != nil {
log.Fatal(err)
}
// Create AI flow
flow := calque.NewFlow().
Use(ai.Agent(client)).
var result string
err = flow.Run(context.Background(), "Summarize relativity.", &result)
if err != nil {
log.Fatal(err)
}
}
Philosophy
Chain middleware like HTTP handlers, but for streaming data.
flow := calque.NewFlow().
Use(middleware1).
Use(middleware2).
Use(middleware3)
err := flow.Run(ctx, input, &output)
- Brings HTTP middleware patterns to AI and data processing
- Processes streaming data through io.Pipe connections
- Compose flows instead of handling HTTP requests
flow := calque.NewFlow().
Use(middleware1).
Use(middleware2).
Use(middleware3)
err := flow.Run(ctx, input, &output)
Built-In Middleware
LLMs
Connect to Ollama, Gemini, and more
Prompt Templates
Dynamic prompt formatting with Go templates
Memory
Conversation memory and custom storage backends
Flow Control
Timeouts, retries, branching
Multi-Agent
Routing, load balancing
Tools
Built-in function calling
Structured Output
JSON, YAML, and schema validation
Observability
Streaming, buffered logging, and log adapters
Performance vs Hand-Coded Algorithms
Go-Calque's optimized middleware composition delivers both performance and memory efficiency. Benchmarks from our anagram processing example show improvements across small datasets (29 words) and large datasets (1000 words):
faster (small)
less memory (small)
faster (large)
less memory (large)
Well-designed middleware composition outperforms hand-coded algorithms while remaining maintainable and composable.