A Golang client for interacting with the Mem0 Memory API.
- Store memories
- Query memories
- Flexible configuration
- Supports user, organization, and project IDs
- Debug logging
go get github.com/matigumma/mem0-go-client/mem0client
MEM0_API_KEY
: Required API keyMEM0_USER_ID
: Optional custom user IDMEM0_ORG_ID
: Optional organization IDMEM0_PROJECT_ID
: Optional project ID
- Use default configurations
- Provide custom configurations via option functions
- Override environment variables programmatically
// Using environment variables
client := NewMem0Client(os.Getenv("MEM0_API_KEY"))
// Custom configuration
client := NewMem0Client(apiKey,
WithUserID("custom-user"),
WithOrganizationID("org-123"),
WithProjectID("project-456")
)
WithBaseURL(url string)
: Customize the base API URLWithHTTPClient(client *http.Client)
: Use a custom HTTP clientWithDebug(debug bool)
: Enable debug loggingWithUserID(userID string)
: Set a custom user IDWithOrganizationID(orgID string)
: Set a custom organization IDWithProjectID(projectID string)
: Set a custom project ID