Go SDK Reference
BaseURL), or leave BaseURL empty and it starts uvx memanto serve on first use, like the TypeScript SDK.
Prerequisites
- Go 1.24+
uvxon PATH, only if the client starts the server itself. Install uv, which shipsuvx.
Installation
Quick Start
Recall right after a Remember may not return them yet.
On the first call, the client:
- Starts the server, unless
BaseURLis set: picks a free port, runsuvx memanto serve --host 127.0.0.1 --port <port>, and waits for/health. - Creates the agent if it does not exist (unless
DisableAutoCreateis set). - Activates a session and sends its token with each memory call. If the server rejects the token, the client activates a new session and retries once.
Client is safe for concurrent use from multiple goroutines.
Memanto allows one session per agent. Activating a session signs out every other client of that agent (the CLI, MCP, IDE hooks), and the other way round. Use a separate agent for your Go program if other tools use the same agent at the same time.
Connecting to a Running Server
To use a server you started withmemanto serve (or Docker), set BaseURL. The client then never starts a server, and Close leaves yours running:
APIKey is sent as X-Api-Key on every request. A server reachable beyond localhost requires it to create or activate agents.
On-Prem
No API key is needed on the on-prem backend. Runuvx memanto once and choose On-Prem; a server the client starts inherits that config from ~/.memanto/:
Client
Options
New does not contact the server; that happens on the first call.
Every method takes a
context.Context first. Responses are typed with the generated package github.com/moorcheh-ai/memanto/sdks/go/api; endpoints without a response schema return map[string]any.
Memory Write Methods
RememberInput, Confidence defaults to 0.8, Source to agent, and Provenance to explicit_statement.
Memory Read Methods
AsOf and Since take YYYY-MM-DD or an ISO 8601 datetime.
Optional numbers where zero is a meaningful value (MinSimilarity, Threshold, Temperature) are pointers. Leave them nil for the server default, or set one with memanto.Ptr:
Analysis Methods
Action is one of keep_old, keep_new, keep_both, remove_both, manual.
Agent & Session Lifecycle
Errors
A failed call returns anil result and an error. When the server answers with a non-2xx status, the error is a *memanto.APIError carrying StatusCode and the server’s message in Detail:
uvx is not installed, the first call returns an error telling you to install uv.
Versioning
Each Memanto releasevX.Y.Z also tags the Go SDK as sdks/go/vX.Y.Z, so the SDK version matches the memanto release on PyPI:
PackageSpec: "memanto==<version>".