Connect to your Mind.
Create a client with your API URL and token, then choose the dedicated instance your service will use.
Store what your service needs to remember and retrieve it in later requests. The Minds Go SDK connects your application to a dedicated Mind with familiar contexts, HTTP calls, and explicit errors.
Go · explicit request lifetimes
A request, its context, and an outcome your service handles.
01ctx, cancel := context.WithCancel(parent)02defer cancel()03record, err := runtime.KV().Get(ctx, "user:1001")04if err != nil {05 return nil, err06 }07return record.Value, nilcontext.Canceledcontext.WithCancelcreatedGet(ctx, "user:1001")interruptedctx.Done()closeddefer cancel()completeReturn the error, run deferred cleanup, and stop the local work. A canceled request does not roll back an operation that has already completed on the server.
Example KV read with a Go context. Cancellation stops the client waiting; a completed server operation remains completed.
Start with a stored record, then add memory, connected knowledge, or analytics. Keep request cancellation and error handling in your application’s normal flow.
Create a client with your API URL and token, then choose the dedicated instance your service will use.
Use the instance client for data and memory. Use the account client for backups, monitoring, and administration.
Requests use Go’s standard HTTP client and JSON, fitting into existing service configuration and diagnostics.
Pass a context to set deadlines or cancel work. Inspect typed errors to decide how your service should respond.
Read a record by key, analyze stored data with SQL, or follow relationships with a graph query.
Request predictions, classifications, or embeddings from models configured on your Mind, including batch inference.
This standard-library HTTP example makes the request and authentication explicit. Set AKASHA_URL to your MCP-enabled Mind, AKASHA_TOKEN to your access token, and AKASHA_CAPABILITY to a signed credential with memory-read permission.
package main
import (
"context"
"encoding/json"
"fmt"
"net/http"
"os"
"strings"
"time"
)
func main() {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
endpoint := strings.TrimRight(os.Getenv("AKASHA_URL"), "/") + "/v1/mcp/tools/call"
payload := strings.NewReader(`{"name":"recall","arguments":{"query":"What release schedule did we choose?","limit":5}}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint, payload)
if err != nil { panic(err) }
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer " + os.Getenv("AKASHA_TOKEN"))
req.Header.Set("X-Akasha-Capability", os.Getenv("AKASHA_CAPABILITY"))
response, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer response.Body.Close()
if response.StatusCode >= 300 { panic(response.Status) }
var output struct {
IsError bool `json:"is_error"`
Result json.RawMessage `json:"result"`
}
if err := json.NewDecoder(response.Body).Decode(&output); err != nil { panic(err) }
if output.IsError { panic("Memory tool failed") }
fmt.Println(string(output.Result))
}Connect your Go application to a dedicated Mind and bring saved context into your next request.