# Go Calque

> A composable multi-agent AI framework for Go that makes it easy to build production-ready AI applications.

- **Type:** MCP server
- **Install:** `agentstack add mcp-calque-ai-go-calque`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [calque-ai](https://agentstack.voostack.com/s/calque-ai)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MPL-2.0
- **Upstream author:** [calque-ai](https://github.com/calque-ai)
- **Source:** https://github.com/calque-ai/go-calque
- **Website:** https://calque.ai/developer

## Install

```sh
agentstack add mcp-calque-ai-go-calque
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Go-Calque

  

  
    
    
    
    
    
    
    
    
  

A **composable AI agent framework** for Go that makes it easy to build production-ready AI applications.

_Developed by [Calque AI](https://calque.ai)_

## The Problem

Building AI apps in Go means wrestling with:

- **Provider lock-in** - Switching between OpenAI, Gemini, or local models requires rewriting code
- **Conversation state** - Managing chat history and context windows across requests
- **Tool calling** - Connecting AI to your Go functions with proper error handling
- **Structured outputs** - Getting reliable JSON responses that match your types
- **RAG pipelines** - Coordinating document retrieval, embedding, and generation

Go-Calque solves these with a simple, composable middleware pattern that feels native to Go.

## Installation

```bash
go get github.com/calque-ai/go-calque
```

## Quickstart

```go
package main

import (
    "context"
    "fmt"
    "log"

    "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() {
    client, err := ollama.New("llama3.2:3b")
    if err != nil {
        log.Fatal(err)
    }

    flow := calque.NewFlow().Use(ai.Agent(client))

    var result string
    err = flow.Run(context.Background(), "What's the capital of France?", &result)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(result)
}
```

Three lines to set up, one line to run.

## What You Can Build

### Chatbot with Memory

```go
convMem := memory.NewConversation()

flow := calque.NewFlow().
    Use(convMem.Input(userID)).
    Use(ai.Agent(client)).
    Use(convMem.Output(userID))
```

### AI with Tool Calling

```go
calculator := tools.Simple("calc", "Math", calcFn)
weather := tools.Simple("weather", "Weather", weatherFn)

flow := calque.NewFlow().
    Use(ai.Agent(client, ai.WithTools(calculator, weather)))
```

### Structured Output

```go
flow := calque.NewFlow().
    Use(ai.Agent(client, ai.WithSchema(&MyType{})))

var result MyType
flow.Run(ctx, "Analyze this", convert.FromJSONSchema(&result))
```

### RAG Pipeline

```go
flow := calque.NewFlow().
    Use(retrieval.VectorSearch(store, opts)).
    Use(prompt.Template(ragTemplate)).
    Use(ai.Agent(client))
```

📖 **[See Getting Started Guide →](docs/getting-started.md)**

## Why Go-Calque?

| Challenge               | Raw SDK                    | Go-Calque                                |
| ----------------------- | -------------------------- | ---------------------------------------- |
| **Provider switching**  | Rewrite API calls          | Change one line: `ollama.New()` → `openai.New()` |
| **Conversation memory** | Manual state management    | `convMem.Input()` / `convMem.Output()`   |
| **Tool calling**        | Parse, match, handle errors| `ai.WithTools(...)` - automatic          |
| **Structured output**   | Hope AI follows instructions| `ai.WithSchema()` - guaranteed types    |
| **Retries & fallbacks** | Custom logic               | `ctrl.Retry()`, `ctrl.Fallback()`        |

## Features

### Core
- **[AI Agents](docs/middleware.md#ai-agents)** - OpenAI, Gemini, Ollama with unified interface
- **[Tool Calling](docs/middleware.md#tool-integration)** - Auto-discovery and execution of Go functions
- **[Memory](docs/middleware.md#memory)** - Conversation history with configurable limits

### Data Processing
- **[RAG & Retrieval](docs/middleware.md#retrieval)** - Vector search, context building, semantic filtering
- **[Converters](docs/middleware.md#converters)** - JSON, YAML, Protobuf, JSONSchema, SSE
- **[Flow Control](docs/middleware.md#flow-control)** - Retry, timeout, fallback, parallel, chain

### Production
- **[Observability](docs/middleware.md#observability)** - Metrics, tracing, health checks, structured logging
- **[MCP Support](docs/middleware.md#mcp)** - Model Context Protocol client
- **[Multi-Agent](docs/middleware.md#multi-agent)** - Agent routing and load balancing

📖 **[See Full Middleware Reference →](docs/middleware.md)**

## Performance

Go-Calque is built for **production AI workloads** where LLM latency dominates.

| Metric | Value |
|--------|-------|
| **Framework Overhead** | 
  

## Star History

 
   
   
   
 

## License

Mozilla Public License 2.0 - see [LICENSE](LICENSE) file for details.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [calque-ai](https://github.com/calque-ai)
- **Source:** [calque-ai/go-calque](https://github.com/calque-ai/go-calque)
- **License:** MPL-2.0
- **Homepage:** https://calque.ai/developer

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-calque-ai-go-calque
- Seller: https://agentstack.voostack.com/s/calque-ai
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
