Create a memory
client.Beta.MemoryStores.Memories.New(ctx, memoryStoreID, params) (*BetaManagedAgentsMemory, error)POST/v1/memory_stores/{memory_store_id}/memories
Create a memory
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaManagedAgentsMemory, err := client.Beta.MemoryStores.Memories.New(
context.TODO(),
"memory_store_id",
anthropic.BetaMemoryStoreMemoryNewParams{
Content: anthropic.String("content"),
Path: "xx",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaManagedAgentsMemory.ID)
}{
"id": "id",
"content_sha256": "content_sha256",
"content_size_bytes": 0,
"created_at": "2019-12-27T18:11:19.117Z",
"memory_store_id": "memory_store_id",
"memory_version_id": "memory_version_id",
"path": "path",
"type": "memory",
"updated_at": "2019-12-27T18:11:19.117Z",
"content": "content"
}Returns Examples
{
"id": "id",
"content_sha256": "content_sha256",
"content_size_bytes": 0,
"created_at": "2019-12-27T18:11:19.117Z",
"memory_store_id": "memory_store_id",
"memory_version_id": "memory_version_id",
"path": "path",
"type": "memory",
"updated_at": "2019-12-27T18:11:19.117Z",
"content": "content"
}