Introducing Go-Calque: An Idiomatic Streaming Multi-Agent AI Framework for Go.

Go-Calque

An Idiomatic 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.

Go Mascots

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 middleware 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 the theory of 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

Built-In Middleware

LLMs

Connect to leading models

Prompt Templates

Flexible prompt generation

Memory

Efficient state management

Flow Control

Pipeline error handling

Multi-Agent

Coordinate multiple agents

Tools

Function calling and integrations

Converters

Transform data between formats

Observability

Monitor and debug flows

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):

25%

faster (small)

58%

less memory (small)

88%

faster (large)

88%

less memory (large)

Well-designed middleware composition outperforms hand-coded algorithms while remaining maintainable and composable.

Ready to Build AI Agents with Go-Calque?

Get Started