Developers
GUIDE & REFERENCE

Go

Use the Go client surface and an explicit HTTP request for capability-authenticated Minds.

The Go module is github.com/l1feai/minds-go-sdk; its package is akasha. The module declares Go 1.21. Use the module source approved for your project and keep the selected version pinned.

Add the module

go get github.com/l1feai/minds-go-sdk/akasha

This is the checked-in module path, not a claim that an arbitrary remote branch has been verified. A local checkout can be selected with a Go module replace directive during development.

Client structure

client := akasha.NewClient(managementURL, credential)
runtime := client.Runtime(instanceURL)

The client separates ControlPlane() from Runtime(instanceURL). NewClientWithConfig accepts a timeout and optional tenant, reservoir, agent, and dataspace header values. All operations take a context.Context, so call them with a deadline appropriate to the work.

The default transport places its APIKey value in Authorization Bearer. It does not set the capability header required by a secured dedicated Mind. Use an explicit HTTP request for that connection in this source version.

Read memory through the current daemon contract

package main

import (
    "bytes"
    "context"
    "encoding/json"
    "fmt"
    "net/http"
    "os"
    "strings"
    "time"
)

func main() {
    ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
    defer cancel()
    body := []byte(`{"name":"recall","arguments":{"query":"launch review","limit":5}}`)
    endpoint := strings.TrimRight(os.Getenv("MINDS_INSTANCE_URL"), "/")
    req, err := http.NewRequestWithContext(ctx, http.MethodPost,
        endpoint+"/v1/mcp/tools/call", bytes.NewReader(body))
    if err != nil { panic(err) }
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("x-akasha-capability", os.Getenv("MINDS_CAPABILITY"))
    resp, err := http.DefaultClient.Do(req)
    if err != nil { panic(err) }
    defer resp.Body.Close()
    if resp.StatusCode < 200 || resp.StatusCode >= 300 {
        panic(fmt.Errorf("recall: HTTP %d", resp.StatusCode))
    }
    var output struct {
        IsError bool `json:"is_error"`
        Result struct { Memories []json.RawMessage `json:"memories"` } `json:"result"`
    }
    if err := json.NewDecoder(resp.Body).Decode(&output); err != nil { panic(err) }
    if output.IsError { panic("recall tool failed") }
    fmt.Println("matches:", len(output.Result.Memories))
}

The example uses Go's standard HTTP library and checks both HTTP and tool errors. Replace panics with your application's error handling. It counts returned matches without logging their private contents.

Choosing SDK methods

The package includes typed clients for control-plane resources and runtime services. The complete Go reference lists public functions, receivers, request/result structures, and source locations. Read Compatibility first: APIs and result shapes are not guaranteed to match the TypeScript, Python, or Rust packages.

On this page