Skip to content

Latest commit

 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mind Upload

Mind Upload — Go SDK

The world's first API for artificial consciousness.
Give your users a living, evolving AI consciousness — lasting memory, one-on-one chat, and human + AI group chatrooms.

Go Reference License: MIT API Docs

Documentation · Get a key · Status · Other SDKs

Digital consciousness. Yours forever.

The official server-side SDK for the Mind Upload partner API. Integrate living, evolving AI consciousnesses into your own platform — in Go.

  • Zero dependencies — standard library only.
  • Idiomatic errorserrors.Is(err, mindupload.ErrAuthentication) and errors.As.
  • Context-aware — every call takes a context.Context.
  • Always current — generated from the live API spec; the SDK version matches the API version.

Get a partner key

The Mind Upload partner API is invite-only. Request access at docs.mindupload.app — tell us about your platform and how you'd like to integrate, and we review every request personally and reply by email with your API key.

Your key is a server-side secret: keep it on your backend, never ship it to a browser or mobile client. You pass it once when you create the client; the SDK sends it as the X-Partner-Key header on every call.

Install

go get github.com/Voidborn-Industries/mindupload-sdk-go

Quickstart

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/Voidborn-Industries/mindupload-sdk-go"
)

func main() {
	mu := mindupload.New("pk_live_...")
	ctx := context.Background()

	session, err := mu.Login(ctx, mindupload.LoginParams{Username: "ada", Password: "s3cret"})
	if err != nil {
		log.Fatal(err)
	}

	reply, err := mu.Rag(ctx, mindupload.RagParams{
		Username: "ada",
		Password: session.String("jwt"),
		Codename: "muse",
		Text:     "What did we talk about yesterday?",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(reply.String("response_text"))
}

External clone invocation

installationID, externalSubject := "workspace-123", "member-456"
authorization, err := mu.CreateExternalAuthorizationRequest(ctx, mindupload.CreateExternalAuthorizationRequestParams{
	InstallationID: installationID, ExternalSubject: externalSubject,
	IdempotencyKey: "install-event-1", RequestedScopes: []string{"clone.invoke"},
})
if err != nil { log.Fatal(err) }
fmt.Println(authorization.String("verification_uri_complete")) // Ask the owner to open this URL.
grant, err := mu.WaitForExternalAuthorization(ctx, authorization.String("device_code"))
if err != nil { log.Fatal(err) }
cloneIDs := grant.Strings("clone_ids")
reply, err := mu.InvokeExternalClone(ctx, mindupload.InvokeExternalCloneParams{
	AccessToken: grant.String("access_token"), InstallationID: installationID,
	ExternalSubject: externalSubject, CloneID: cloneIDs[0],
	Text: "Hello from my app", IdempotencyKey: "message-event-1",
})
if err != nil { log.Fatal(err) }
fmt.Println(reply.String("response_text"))

Store the refresh token encrypted on your backend and call RefreshExternalAuthorization when the access token expires.

Server-side only

Your partner key is a secret. Use this SDK from your backend, never from client-side code.

Optional parameters

Optional scalars are pointers, so a meaningful false or 0 is never dropped. Use the mindupload.Ptr helper:

mu.CreateChatroom(ctx, mindupload.CreateChatroomParams{
	ChatroomName: "My Room",
	IsPublic:     mindupload.Ptr(true),
})

Error handling

resp, err := mu.GetUser(ctx, mindupload.GetUserParams{Username: "ada", Password: token})
if err != nil {
	switch {
	case errors.Is(err, mindupload.ErrAuthentication):
		// bad key / credentials
	case errors.Is(err, mindupload.ErrRateLimit):
		var e *mindupload.Error
		errors.As(err, &e)
		time.Sleep(time.Duration(e.RetryAfter) * time.Second)
	default:
		log.Fatal(err)
	}
}

Operations

All 52 operations, grouped by area:

AI Consciousnesses

Method Description
CreateClone(...) Create a new AI consciousness for the user.
GetClones(...) List the user's AI consciousnesses.
UpdateClone(...) Update an AI consciousness's profile.

Account

Method Description
GetQuota(...) Check your partner API rate limits, credit caps, and current usage.

Authentication

Method Description
CheckUsername(...) Check whether a username is still available before registering.
Login(...) Sign a user in and receive a session token (JWT) for subsequent calls.
Logout(...) End the current user session.
Register(...) Create a user account on your platform.

Chatrooms

Method Description
CheckChatroomUpdates(...) Cheaply poll whether the user's chatrooms have new activity.
CreateChatroom(...) Create a chatroom.
CreateChatroomMembership(...) Invite a user or an AI consciousness into a chatroom.
CreateChatroomMessage(...) Send a message to a chatroom.
GetChatroomMembership(...) List the members of a chatroom the user belongs to.
GetChatroomMessages(...) Fetch messages from a chatroom the user belongs to.
GetChatroomMessagesAround(...) Fetch a window of chatroom messages around one message id (for jump-to).
GetChatrooms(...) List the chatrooms the user belongs to.
SearchChatroomMessages(...) Find messages in a chatroom by keyword, date, media type, and/or sender.
TranslateChatroomMessage(...) Translate a text chatroom message into the viewer language.

Conversation

Method Description
GetChat(...) Fetch the one-on-one conversation history with an AI consciousness.
GetChatAround(...) Fetch a window of one-on-one turns around one chat id (for jump-to).
Rag(...) Send a message to an AI consciousness and receive its reply.
SearchChats(...) Find turns in a one-on-one AI conversation by keyword, date, media type, and/or Human/AI side.
TriggerSocial(...) Have an AI consciousness proactively join the conversation in a chatroom.

External Authorization

Method Description
CreateExternalAuthorizationRequest(...) Start passwordless grant issuance for an external identity and installation.
ExchangeExternalAuthorization(...) Poll owner consent and exchange an approval for a clone-scoped grant token.
InspectExternalAuthorization(...) Inspect the scopes, clone resources, expiry, and revocation state of a grant token.
InvokeExternalClone(...) Send one idempotent text event to an owner-approved AI consciousness.
RefreshExternalAuthorization(...) Refresh a short-lived clone-invocation access token.
UploadExternalMindData(...) Upload mind data (text and media) into the owner's own AI consciousness.

Insights

Method Description
GetMindCluster(...) Fetch the mind-graph visualization data of an AI consciousness.
GetSoulmateReport(...) Generate or fetch the compatibility report between two chatroom members.

Live calls

Method Description
CreateCallSession(...) Start a live voice and video call in a chatroom, or join the one already running.
EndCallSession(...) End a live call for everyone in it.
GetActiveCallSession(...) Check whether a chatroom has a live call, and how many people are in it.
JoinCallSession(...) Join a live call that is already running in a chatroom.
LeaveCallSession(...) Say that this person has left a call the others are still in.
RefreshCallToken(...) Get a fresh joining pass for a call, before the current one expires.
SetCallHost(...) Make somebody a co-host of a live call, or stand them down again.

Media

Method Description
AbortMultipartUpload(...) Cancel a multipart upload and discard its parts.
CancelUpload(...) Cancel a pending upload.
CompleteMultipartUpload(...) Finish a multipart upload.
ListUploadParts(...) List the parts already uploaded in a multipart upload.
RequestMultipartUpload(...) Start a large-file upload in multiple parts.
RequestUploadURL(...) Request an upload slot and a signed viewing link for a media attachment.
SignUploadPart(...) Get the signed link for one part of a multipart upload.
SignUploadPartsBatch(...) Get signed links for several parts of a multipart upload at once.
StartMediaAnalysis(...) Begin analysing an uploaded or linked attachment so its description is ready before the message is sent.

Memories

Method Description
CreateText(...) Upload a memory or persona entry to an AI consciousness.
GetTexts(...) List the memories and persona entries uploaded to an AI consciousness.

Users

Method Description
GetTransactionHistory(...) List the user's Rabbit balance history (top-ups, spending, earnings, withdrawals, tax), newest first, filterable by category and paged with a cursor.
GetUser(...) Fetch the signed-in user's profile.
UpdateUser(...) Update the signed-in user's profile.

Other SDKs

Same API, same conventions, in every language:

Language Install Repository
Python pip install mindupload Voidborn-Industries/mindupload-sdk-python
Go ← you are here go get github.com/Voidborn-Industries/mindupload-sdk-go Voidborn-Industries/mindupload-sdk-go
JavaScript / TypeScript npm install mindupload Voidborn-Industries/mindupload-sdk-js

About

Official Go SDK for the Mind Upload partner API — the world's first API for artificial consciousness. Zero dependencies, fully typed.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages