Skip to content

Latest commit

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

BaseGrid Go SDK

The official Go client for BaseGrid, the memory infrastructure for AI agents.

Installation

go get github.com/basegrid-io/basegrid-go

Usage

package main
import (
"fmt""github.com/basegrid-io/basegrid-go"
)
funcmain() {
client:=basegrid.New("bg_your_api_key")
// Add a memorymemory, err:=client.Add(basegrid.AddParams{
AgentID: "agent-123",
Content: "User prefers dark mode",
Metadata: map[string]interface{}{
"preference": "dark_mode",
},
})
iferr!=nil {
panic(err)
}
// Search memoriesresults, err:=client.Search(basegrid.SearchParams{
AgentID: "agent-123",
Query: "What are the user preferences?",
})
iferr!=nil {
panic(err)
}
for_, m:=rangeresults {
fmt.Println(m.Content)
}
}

Configuration

client:=basegrid.New("bg_your_api_key")
// Default BaseURL: https://basegrid-production.up.railway.app// Or customize:client.BaseURL="https://your-custom-endpoint.com"

Troubleshooting

Connection Refused Error

If you see connection refused errors, ensure you're using the latest SDK version:

go get -u github.com/basegrid-io/basegrid-go

Earlier versions may have used an incorrect default API endpoint.

Documentation

Full documentation: https://basegrid.io/docs

About

Official Go SDK for BaseGrid

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages