SDK Integration Patterns

Plug bRRAIn into your stack

Build extensions in Go with the Platform SDK, and connect the rest of your stack through governed gateways, so every system that touches your organization's memory follows its rules.

Building extensions

The Platform SDK is a Go client with no framework dependency. Build one client when your extension starts and use it from any handler.

Go

net/http (stdlib)

A search endpoint for your extension's interface, using only the standard library.

mux := http.NewServeMux()
mux.HandleFunc("GET /api/apps/hello-notes/search", func(w http.ResponseWriter, r *http.Request) {
	res, err := c.Vault().Search(r.Context(), platformsdk.VaultSearchRequest{
		Query: r.URL.Query().Get("q"),
		Path:  "extensions/hello-notes",
		Limit: 20,
	})
	if err != nil {
		http.Error(w, "search is unavailable right now", http.StatusServiceUnavailable)
		return
	}
	json.NewEncoder(w).Encode(res.Hits)
})
Full net/http guide →
Go

Gin, Echo and other routers

The same pattern works in any Go router: one client built at start-up, handed to your handlers, with each call tied to the incoming request so cancelled requests stop their platform calls too.

Router guide →
Go

Models under your rules

Use the model your organization chose as its default, or bRRAIn's own Handler. Commercial models are only ever your organization's opt-in.

models, err := c.LLM().Models(ctx)
if err != nil {
	log.Fatal(err)
}
id := "brrain-handler" // the Handler, unless the org set a default
for _, m := range models {
	if m.Default {
		id = m.ID
	}
}
out, err := c.LLM().Call(ctx, platformsdk.LLMCall{
	ProviderID: id,
	System:     "Summarize as decisions and actions.",
	Prompt:     notes,
})
if err != nil {
	log.Fatal(err)
}
fmt.Println(out["reply"])
Models guide →
Other languages

Node.js, Python and more

There is no official Node.js or Python package. Code in other languages can reach the same platform services the Go SDK uses, or connect through MCP from any MCP-capable client.

Other languages →

Connecting your data

Query the systems you already run in place, and bring documents into the knowledge base under your organization's rules.

Data Pipe

Databases, warehouses and SaaS

Live, governed queries across 31 connectors, including PostgreSQL, MySQL, SQL Server, Oracle, Snowflake, BigQuery, MongoDB, Elasticsearch, S3, Salesforce and HubSpot, without copying the data. Available to extensions and to AI assistants.

Connecting external systems →
Ingestion

Documents and records

Commit incoming content through your organization's ingestion rules and security gate, from PDFs and Office files to records from a custom source.

_, err := c.Ingestion().Commit(ctx, platformsdk.IngestionCommitRequest{
	OrgID:      orgID,
	SourceSlug: "queue-sync",
	RecordID:   "msg-" + offset,
	TargetPath: "projects/Ops/events/" + offset + ".json",
	Content:    payload,
})
if err != nil {
	log.Printf("commit %s: %v", offset, err)
}
Vault and ingestion guide →

Events and streams

React to what happens in your other systems, with credentials that never leave the platform.

Webhooks

Vendor events

Subscribe to events from a connected vendor. The platform handles the vendor-side setup using your organization's own connection.

sub, err := c.Integrations().Subscribe(ctx, platformsdk.SubscribeRequest{
	IntegrationSlug: "github",
	Events:          []string{eventSlug},
	CallbackURL:     callbackURL,
})
if err != nil {
	log.Fatal(err)
}
fmt.Println(sub.Status, sub.Instructions)
Examples →
Streams

Kafka and custom queues

Query Kafka topics through Data Pipe, or write an extension that consumes any queue and commits each message through governed ingestion, keeping its own position in the vault.

Connecting external systems →

Missing your system?

Connect it through a governed gateway, or build an extension for it with the Platform SDK. Every organization gets five free developer seats.