Documentation
¶
Overview ¶
Package memorylayer is the Go SDK for MemoryLayer.ai — memory infrastructure for LLM-powered agents.
It mirrors the design of the Python (memorylayer-client) and TypeScript (@scitrera/memorylayer-sdk) SDKs: a single Client exposing memory CRUD, semantic recall/reflect, the association graph, sessions, workspaces, chat threads, the context sandbox, the entity registry, API tokens, and the Enterprise document/dataset surfaces, plus the Skills, McpServers, and Knowledgebase (Kb), and Repository Planning Graph (Rpg) namespaces.
Transports ¶
The Client issues every request through a Transport. Two are available:
- The default HTTP transport (constructed automatically) speaks directly to a MemoryLayer server over net/http. It has no third-party dependencies.
- An Aether transport, provided by the companion module github.com/scitrera/memorylayer/memorylayer-sdk-go/aether, routes every request through an existing Aether SDK connection via proxy_http. Pass it with WithTransport. It is a separate module so HTTP-only callers do not pull in the Aether SDK's gRPC dependency tree.
On-behalf-of (OBO) authority ¶
Every request may carry an AuthorityContext. The Client emits it as X-Aether-* headers; the HTTP transport forwards them and the Aether transport translates them into the proxy's structured authorization envelope. Use Client.ActingFor and Client.ForWorkspace to bind authority/workspace to a lightweight proxy without mutating the shared Client.
Basic usage ¶
client, err := memorylayer.NewClient(
memorylayer.WithBaseURL("https://api.memorylayer.ai"),
memorylayer.WithAPIKey("your-api-key"),
memorylayer.WithWorkspaceID("ws_123"),
)
if err != nil {
log.Fatal(err)
}
defer client.Close()
mem, err := client.Remember(ctx, "User prefers Go", memorylayer.RememberOptions{
Type: memorylayer.MemoryTypeSemantic,
Importance: 0.8,
})
results, err := client.Recall(ctx, "coding preferences", memorylayer.RecallOptions{Limit: 5})
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func IsEnterpriseRequired(err error) bool
- func IsNotFound(err error) bool
- func ParseSkillFolder(path string) (*SkillManifest, []SkillFile, error)
- func Ptr[T any](v T) *T
- type APIError
- type AgentSpecification
- type AgentSpecificationCreateInput
- type AgentSpecificationGetOptions
- type AgentSpecificationHistoryOptions
- type AgentSpecificationListOptions
- type AgentSpecificationMutationOptions
- type AgentSpecificationMutationResult
- type AgentSpecificationPage
- type AgentSpecificationReplaceInput
- type AgentSpecificationRevision
- type AgentSpecificationRevisionPage
- type AgentSpecificationsAPI
- func (a *AgentSpecificationsAPI) Create(ctx context.Context, input AgentSpecificationCreateInput, ...) (*AgentSpecificationMutationResult, error)
- func (a *AgentSpecificationsAPI) Delete(ctx context.Context, specificationID string, ...) (*AgentSpecificationMutationResult, error)
- func (a *AgentSpecificationsAPI) Get(ctx context.Context, specificationID string, opts AgentSpecificationGetOptions) (*AgentSpecification, error)
- func (a *AgentSpecificationsAPI) History(ctx context.Context, specificationID string, ...) (*AgentSpecificationRevisionPage, error)
- func (a *AgentSpecificationsAPI) List(ctx context.Context, opts AgentSpecificationListOptions) (*AgentSpecificationPage, error)
- func (a *AgentSpecificationsAPI) Replace(ctx context.Context, specificationID string, ...) (*AgentSpecificationMutationResult, error)
- func (a *AgentSpecificationsAPI) Restore(ctx context.Context, specificationID string, ...) (*AgentSpecificationMutationResult, error)
- type AppendMessagesOptions
- type AssociateOptions
- type Association
- type AuthenticationError
- type AuthorityContext
- type AuthorizationError
- type BudgetSummary
- type ChatMessage
- type ChatMessageContent
- type ChatThread
- type ChatThreadWithMessages
- type Client
- func (c *Client) ActingFor(grantID string, subject *PrincipalRef) *OBOProxy
- func (c *Client) AppendMessages(ctx context.Context, threadID string, messages []map[string]any, ...) ([]ChatMessage, error)
- func (c *Client) Associate(ctx context.Context, sourceID, targetID string, relationship RelationshipType, ...) (*Association, error)
- func (c *Client) BatchMemories(ctx context.Context, operations []map[string]any) (map[string]any, error)
- func (c *Client) CancelDatasetJob(ctx context.Context, jobID string) error
- func (c *Client) CancelJob(ctx context.Context, jobID string) error
- func (c *Client) ClearSession()
- func (c *Client) Close() error
- func (c *Client) CommitSession(ctx context.Context, sessionID string, opts CommitSessionOptions) (map[string]any, error)
- func (c *Client) ContextCheckpoint(ctx context.Context) error
- func (c *Client) ContextCleanup(ctx context.Context) error
- func (c *Client) ContextExec(ctx context.Context, code string, opts ContextExecOptions) (map[string]any, error)
- func (c *Client) ContextInject(ctx context.Context, key string, value any, parseJSON bool) (map[string]any, error)
- func (c *Client) ContextInspect(ctx context.Context, variable string, previewChars int) (map[string]any, error)
- func (c *Client) ContextLoad(ctx context.Context, varName, query string, opts ContextLoadOptions) (map[string]any, error)
- func (c *Client) ContextQuery(ctx context.Context, prompt string, variables []string, ...) (map[string]any, error)
- func (c *Client) ContextRLM(ctx context.Context, goal string, opts ContextRLMOptions) (map[string]any, error)
- func (c *Client) ContextStatus(ctx context.Context) (map[string]any, error)
- func (c *Client) CreateCheckpoint(ctx context.Context, sessionID, transcriptSegment string, ...) (*SessionCheckpoint, error)
- func (c *Client) CreateContext(ctx context.Context, workspaceID, name, description string, ...) (map[string]any, error)
- func (c *Client) CreateMemoryVersioned(ctx context.Context, input SemanticMemoryCreateInput, ...) (*MemoryMutationResult, error)
- func (c *Client) CreateSession(ctx context.Context, opts CreateSessionOptions) (*Session, error)
- func (c *Client) CreateThread(ctx context.Context, opts CreateThreadOptions) (*ChatThread, error)
- func (c *Client) CreateToken(ctx context.Context, name string, opts CreateTokenOptions) (*TokenCreateResult, error)
- func (c *Client) CreateWorkspace(ctx context.Context, name string, tags []string) (*Workspace, error)
- func (c *Client) Decay(ctx context.Context, memoryID string, decayRate float64) (*Memory, error)
- func (c *Client) DecomposeThread(ctx context.Context, threadID, workspaceID string) (*DecompositionResult, error)
- func (c *Client) DeleteAssociation(ctx context.Context, memoryID, associationID string, ...) (bool, error)
- func (c *Client) DeleteContext(ctx context.Context, contextID, workspaceID string) error
- func (c *Client) DeleteDataset(ctx context.Context, datasetID string, deleteMemories bool) error
- func (c *Client) DeleteDocument(ctx context.Context, documentID string, deleteMemories bool) error
- func (c *Client) DeleteMemoryVersioned(ctx context.Context, memoryID string, opts MemoryMutationOptions) (*MemoryMutationResult, error)
- func (c *Client) DeleteMessage(ctx context.Context, threadID, messageID string, opts DeleteMessageOptions) (bool, error)
- func (c *Client) DeleteSession(ctx context.Context, sessionID string) error
- func (c *Client) DeleteThread(ctx context.Context, threadID, workspaceID string) error
- func (c *Client) DeleteToken(ctx context.Context, tokenID string, authority *AuthorityContext) error
- func (c *Client) ExportWorkspace(ctx context.Context, opts ExportWorkspaceOptions) (*WorkspaceExport, error)
- func (c *Client) ExportWorkspaceStream(ctx context.Context, opts ExportWorkspaceOptions, ...) error
- func (c *Client) ForWorkspace(workspaceID string) *OBOProxy
- func (c *Client) Forget(ctx context.Context, memoryID string, hard bool) error
- func (c *Client) GetAssociations(ctx context.Context, memoryID, direction string) ([]Association, error)
- func (c *Client) GetBriefing(ctx context.Context, opts GetBriefingOptions) (*SessionBriefing, error)
- func (c *Client) GetCheckpoint(ctx context.Context, sessionID, checkpointID string) (*SessionCheckpoint, error)
- func (c *Client) GetContext(ctx context.Context, sessionID string, keys []string) (map[string]any, error)
- func (c *Client) GetContextDelta(ctx context.Context, sessionID, cursor string, budgetTokens int) (*ContextDelta, error)
- func (c *Client) GetContextPack(ctx context.Context, sessionID string, opts ContextPackOptions) (*ContextPack, error)
- func (c *Client) GetDataset(ctx context.Context, datasetID string) (*DatasetInfo, error)
- func (c *Client) GetDatasetJob(ctx context.Context, jobID string) (*DatasetJobInfo, error)
- func (c *Client) GetDatasetMemories(ctx context.Context, datasetID string) ([]map[string]any, error)
- func (c *Client) GetDocument(ctx context.Context, documentID string) (*DocumentInfo, error)
- func (c *Client) GetDocumentPages(ctx context.Context, documentID string) ([]DocumentPage, error)
- func (c *Client) GetEntity(ctx context.Context, entityID, workspaceID string, authority *AuthorityContext) (*Entity, error)
- func (c *Client) GetJob(ctx context.Context, jobID string) (*JobInfo, error)
- func (c *Client) GetMemory(ctx context.Context, memoryID string, opts ...GetMemoryOptions) (*Memory, error)
- func (c *Client) GetMessages(ctx context.Context, threadID string, opts GetMessagesOptions) ([]ChatMessage, error)
- func (c *Client) GetPageImage(ctx context.Context, documentID, pageID string) ([]byte, error)
- func (c *Client) GetSession(ctx context.Context, sessionID string) (*Session, error)
- func (c *Client) GetThread(ctx context.Context, threadID, workspaceID string) (*ChatThread, error)
- func (c *Client) GetThreadFull(ctx context.Context, threadID string, opts GetThreadFullOptions) (*ChatThreadWithMessages, error)
- func (c *Client) GetToken(ctx context.Context, tokenID string, authority *AuthorityContext) (*TokenInfo, error)
- func (c *Client) GetWorkspace(ctx context.Context, workspaceID string) (*Workspace, error)
- func (c *Client) GetWorkspaceSchema(ctx context.Context, workspaceID string) (map[string]any, error)
- func (c *Client) ImportWorkspace(ctx context.Context, workspaceID string, data any) (map[string]any, error)
- func (c *Client) ImportWorkspaceStream(ctx context.Context, workspaceID string, lines []map[string]any) (map[string]any, error)
- func (c *Client) IterateMemories(ctx context.Context, pageSize int, opts ListMemoriesOptions, ...) error
- func (c *Client) ListContexts(ctx context.Context, workspaceID string) ([]map[string]any, error)
- func (c *Client) ListDatasetJobs(ctx context.Context, status string, limit int) ([]DatasetJobInfo, error)
- func (c *Client) ListDatasets(ctx context.Context, opts ListDatasetsOptions) ([]DatasetInfo, int, error)
- func (c *Client) ListDocuments(ctx context.Context, opts ListDocumentsOptions) ([]DocumentInfo, int, error)
- func (c *Client) ListEntities(ctx context.Context, opts ListEntitiesOptions) ([]Entity, error)
- func (c *Client) ListJobs(ctx context.Context, status string, limit int) ([]JobInfo, error)
- func (c *Client) ListMemories(ctx context.Context, opts ListMemoriesOptions) (*RecallResult, error)
- func (c *Client) ListSessions(ctx context.Context, opts ListSessionsOptions) ([]map[string]any, error)
- func (c *Client) ListThreads(ctx context.Context, opts ListThreadsOptions) ([]ChatThread, error)
- func (c *Client) ListTokens(ctx context.Context, includeRevoked bool, authority *AuthorityContext) ([]TokenInfo, error)
- func (c *Client) ListUserThreads(ctx context.Context, userID string, opts ListUserThreadsOptions) ([]ChatThread, error)
- func (c *Client) ListWorkspaces(ctx context.Context, tags []string, match string) ([]Workspace, error)
- func (c *Client) MemoryHistory(ctx context.Context, memoryID string, opts MemoryHistoryOptions) (*MemoryRevisionPage, error)
- func (c *Client) MergeEntities(ctx context.Context, sourceID, targetID, reason, workspaceID string, ...) (*Entity, error)
- func (c *Client) QueryDatasetSlice(ctx context.Context, datasetID string, opts QueryDatasetSliceOptions) (*DatasetSliceResult, error)
- func (c *Client) Recall(ctx context.Context, query string, opts RecallOptions) (*RecallResult, error)
- func (c *Client) Reflect(ctx context.Context, query string, opts ReflectOptions) (*ReflectResult, error)
- func (c *Client) Remember(ctx context.Context, content string, opts RememberOptions) (*Memory, error)
- func (c *Client) ReplaceSemanticMemory(ctx context.Context, memoryID string, input SemanticMemoryReplaceInput, ...) (*MemoryMutationResult, error)
- func (c *Client) ReprocessDocument(ctx context.Context, documentID string, opts ReprocessDocumentOptions) (*JobInfo, error)
- func (c *Client) ResolveEntity(ctx context.Context, name, entityType, workspaceID string, ...) (*EntityResolution, error)
- func (c *Client) RestoreMemoryVersioned(ctx context.Context, memoryID string, opts MemoryMutationOptions) (*MemoryMutationResult, error)
- func (c *Client) RevokeToken(ctx context.Context, tokenID string, authority *AuthorityContext) error
- func (c *Client) SearchDocumentPages(ctx context.Context, query string, limit int, docIDs []string) (*PageSearchResult, error)
- func (c *Client) SessionID() string
- func (c *Client) SetContext(ctx context.Context, sessionID, key string, value any, ttlSeconds int) error
- func (c *Client) SetSession(sessionID string)
- func (c *Client) TouchSession(ctx context.Context, sessionID string) (map[string]any, error)
- func (c *Client) TraverseGraph(ctx context.Context, memoryID string, opts TraverseGraphOptions) (map[string]any, error)
- func (c *Client) UpdateAssociation(ctx context.Context, memoryID, associationID string, ...) (bool, error)
- func (c *Client) UpdateMemory(ctx context.Context, memoryID string, opts UpdateMemoryOptions) (*Memory, error)
- func (c *Client) UpdateThread(ctx context.Context, threadID string, opts UpdateThreadOptions) (*ChatThread, error)
- func (c *Client) UpdateWorkspace(ctx context.Context, workspaceID string, opts UpdateWorkspaceOptions) (*Workspace, error)
- func (c *Client) UploadDataset(ctx context.Context, fileData []byte, filename string, ...) (*DatasetInfo, *DatasetJobInfo, error)
- func (c *Client) UploadDocument(ctx context.Context, fileData []byte, filename string, ...) (*DocumentInfo, *JobInfo, error)
- func (c *Client) WorkspaceID() string
- type CommitSessionOptions
- type ConflictError
- type Context
- type ContextDelta
- type ContextExecOptions
- type ContextLoadOptions
- type ContextPack
- type ContextPackItem
- type ContextPackOptions
- type ContextQueryOptions
- type ContextRLMOptions
- type ContradictionDetection
- type CreateCheckpointOptions
- type CreateMcpServerOptions
- type CreateSessionOptions
- type CreateThreadOptions
- type CreateTokenOptions
- type DatasetColumn
- type DatasetInfo
- type DatasetJobInfo
- type DatasetSliceResult
- type DecompositionResult
- type DeleteMessageOptions
- type DocumentInfo
- type DocumentPage
- type EnterpriseRequiredError
- type Entity
- type EntityRelation
- type EntityRelationInput
- type EntityRelationPath
- type EntityRelationWriteResult
- type EntityResolution
- type ExportWorkspaceOptions
- type GenerationSummary
- type GetBriefingOptions
- type GetMemoryOptions
- type GetMessagesOptions
- type GetSkillManifestOptions
- type GetThreadFullOptions
- type JobInfo
- type KbArticle
- type KbBridge
- type KbCentralNode
- type KbCommunity
- type KbGenerateOptions
- type KbGetOptions
- type KbGraphAnalysis
- type KbGraphSnapshot
- type KbGraphStats
- type KbListArticlesOptions
- type KbMetadata
- type KnowledgebaseAPI
- func (k *KnowledgebaseAPI) ExportVault(ctx context.Context, workspaceID string, authority *AuthorityContext) ([]byte, error)
- func (k *KnowledgebaseAPI) Generate(ctx context.Context, opts KbGenerateOptions) (*KbMetadata, error)
- func (k *KnowledgebaseAPI) Get(ctx context.Context, opts KbGetOptions) (*KbMetadata, error)
- func (k *KnowledgebaseAPI) GetArticle(ctx context.Context, articleID, workspaceID string, ...) (*KbArticle, error)
- func (k *KnowledgebaseAPI) GetCommunity(ctx context.Context, communityID int, workspaceID string, ...) (*KbCommunity, error)
- func (k *KnowledgebaseAPI) GetGraphAnalysis(ctx context.Context, workspaceID, contextID string, ...) (*KbGraphAnalysis, error)
- func (k *KnowledgebaseAPI) ListArticles(ctx context.Context, opts KbListArticlesOptions) ([]KbArticle, error)
- type ListDatasetsOptions
- type ListDocumentsOptions
- type ListEntitiesOptions
- type ListMcpServersOptions
- type ListMemoriesOptions
- type ListSessionsOptions
- type ListSkillsOptions
- type ListThreadsOptions
- type ListUserThreadsOptions
- type McpServerModel
- type McpServersAPI
- func (m *McpServersAPI) Create(ctx context.Context, name, transport string, opts CreateMcpServerOptions) (*McpServerModel, error)
- func (m *McpServersAPI) Delete(ctx context.Context, serverID string, authority *AuthorityContext) error
- func (m *McpServersAPI) Get(ctx context.Context, serverID string, authority *AuthorityContext) (*McpServerModel, error)
- func (m *McpServersAPI) List(ctx context.Context, opts ListMcpServersOptions) ([]McpServerModel, error)
- func (m *McpServersAPI) PullJSON(ctx context.Context, outPath, workspaceID, userID, transport string, ...) error
- func (m *McpServersAPI) PushJSON(ctx context.Context, jsonPath, scope, sourceMode, workspaceID, userID string, ...) ([]McpServerModel, error)
- func (m *McpServersAPI) Resolve(ctx context.Context, name, workspaceID string, authority *AuthorityContext) (*McpServerModel, error)
- func (m *McpServersAPI) Update(ctx context.Context, serverID string, opts UpdateMcpServerOptions) (*McpServerModel, error)
- type Memory
- type MemoryHistoryOptions
- type MemoryMutationOptions
- type MemoryMutationResult
- type MemoryRevision
- type MemoryRevisionPage
- type MemorySubtype
- type MemoryType
- type MessageContent
- type NotFoundError
- type OBOKbAPI
- func (k *OBOKbAPI) ExportVault(ctx context.Context, workspaceID string, authority *AuthorityContext) ([]byte, error)
- func (k *OBOKbAPI) Generate(ctx context.Context, opts KbGenerateOptions) (*KbMetadata, error)
- func (k *OBOKbAPI) Get(ctx context.Context, opts KbGetOptions) (*KbMetadata, error)
- func (k *OBOKbAPI) GetArticle(ctx context.Context, articleID, workspaceID string, ...) (*KbArticle, error)
- func (k *OBOKbAPI) GetCommunity(ctx context.Context, communityID int, workspaceID string, ...) (*KbCommunity, error)
- func (k *OBOKbAPI) GetGraphAnalysis(ctx context.Context, workspaceID, contextID string, ...) (*KbGraphAnalysis, error)
- func (k *OBOKbAPI) ListArticles(ctx context.Context, opts KbListArticlesOptions) ([]KbArticle, error)
- type OBOMcpServersAPI
- func (m *OBOMcpServersAPI) Create(ctx context.Context, name, transport string, opts CreateMcpServerOptions) (*McpServerModel, error)
- func (m *OBOMcpServersAPI) Delete(ctx context.Context, serverID string, authority *AuthorityContext) error
- func (m *OBOMcpServersAPI) Get(ctx context.Context, serverID string, authority *AuthorityContext) (*McpServerModel, error)
- func (m *OBOMcpServersAPI) List(ctx context.Context, opts ListMcpServersOptions) ([]McpServerModel, error)
- func (m *OBOMcpServersAPI) Resolve(ctx context.Context, name, workspaceID string, authority *AuthorityContext) (*McpServerModel, error)
- func (m *OBOMcpServersAPI) Update(ctx context.Context, serverID string, opts UpdateMcpServerOptions) (*McpServerModel, error)
- type OBOProxy
- func (p *OBOProxy) ActingFor(grantID string, subject *PrincipalRef) *OBOProxy
- func (p *OBOProxy) AppendMessages(ctx context.Context, threadID string, messages []map[string]any, ...) ([]ChatMessage, error)
- func (p *OBOProxy) DeleteMessage(ctx context.Context, threadID, messageID string, opts DeleteMessageOptions) (bool, error)
- func (p *OBOProxy) ForWorkspace(workspaceID string) *OBOProxy
- func (p *OBOProxy) Kb() *OBOKbAPI
- func (p *OBOProxy) McpServers() *OBOMcpServersAPI
- func (p *OBOProxy) Recall(ctx context.Context, query string, opts RecallOptions) (*RecallResult, error)
- func (p *OBOProxy) Reflect(ctx context.Context, query string, opts ReflectOptions) (*ReflectResult, error)
- func (p *OBOProxy) Remember(ctx context.Context, content string, opts RememberOptions) (*Memory, error)
- func (p *OBOProxy) Skills() *OBOSkillsAPI
- type OBOSkillsAPI
- func (s *OBOSkillsAPI) Delete(ctx context.Context, skillID string, authority *AuthorityContext) error
- func (s *OBOSkillsAPI) Get(ctx context.Context, skillID string, authority *AuthorityContext) (*SkillModel, error)
- func (s *OBOSkillsAPI) GetManifest(ctx context.Context, skillID string) (string, error)
- func (s *OBOSkillsAPI) GetManifestWithOptions(ctx context.Context, skillID string, opts GetSkillManifestOptions) (string, error)
- func (s *OBOSkillsAPI) List(ctx context.Context, opts ListSkillsOptions) ([]SkillModel, error)
- func (s *OBOSkillsAPI) ListFiles(ctx context.Context, skillID string, authority *AuthorityContext) ([]map[string]any, error)
- func (s *OBOSkillsAPI) Resolve(ctx context.Context, name, query, workspaceID string, ...) (*SkillResolution, error)
- func (s *OBOSkillsAPI) ResolveWithOptions(ctx context.Context, opts ResolveSkillOptions) (*SkillResolution, error)
- func (s *OBOSkillsAPI) Save(ctx context.Context, name, description string, opts SaveSkillOptions) (*SkillModel, error)
- type OpenThread
- type Option
- func WithAPIKey(apiKey string) Option
- func WithBaseURL(baseURL string) Option
- func WithDefaultAuthority(a *AuthorityContext) Option
- func WithHTTPClient(hc *http.Client) Option
- func WithMaxRetries(maxRetries int) Option
- func WithSessionID(sessionID string) Option
- func WithTimeout(timeout time.Duration) Option
- func WithTransport(t Transport) Option
- func WithWorkspaceID(workspaceID string) Option
- type PageSearchResult
- type PreconditionFailedError
- type PreconditionRequiredError
- type PrincipalRef
- type PromptNote
- type PromptNoteCreateInput
- type PromptNoteGetOptions
- type PromptNoteHistoryOptions
- type PromptNoteListOptions
- type PromptNoteMutationOptions
- type PromptNoteMutationResult
- type PromptNotePage
- type PromptNoteReplaceInput
- type PromptNoteRevision
- type PromptNoteRevisionPage
- type PromptNotesAPI
- func (p *PromptNotesAPI) Create(ctx context.Context, input PromptNoteCreateInput, ...) (*PromptNoteMutationResult, error)
- func (p *PromptNotesAPI) Delete(ctx context.Context, noteID string, opts PromptNoteMutationOptions) (*PromptNoteMutationResult, error)
- func (p *PromptNotesAPI) Get(ctx context.Context, noteID string, opts PromptNoteGetOptions) (*PromptNote, error)
- func (p *PromptNotesAPI) History(ctx context.Context, noteID string, opts PromptNoteHistoryOptions) (*PromptNoteRevisionPage, error)
- func (p *PromptNotesAPI) List(ctx context.Context, opts PromptNoteListOptions) (*PromptNotePage, error)
- func (p *PromptNotesAPI) Replace(ctx context.Context, noteID string, input PromptNoteReplaceInput, ...) (*PromptNoteMutationResult, error)
- func (p *PromptNotesAPI) Restore(ctx context.Context, noteID string, opts PromptNoteMutationOptions) (*PromptNoteMutationResult, error)
- type QueryDatasetSliceOptions
- type RateLimitError
- type RecallMode
- type RecallOptions
- type RecallResult
- type RefinementEdit
- type RefinementEvidence
- type RefinementExternalReference
- type RefinementRecord
- type RefinementRecordCreateInput
- type RefinementRecordCreateOptions
- type RefinementRecordGetOptions
- type RefinementRecordListOptions
- type RefinementRecordMutationResult
- type RefinementRecordPage
- type RefinementRecordsAPI
- func (r *RefinementRecordsAPI) Create(ctx context.Context, input RefinementRecordCreateInput, ...) (*RefinementRecordMutationResult, error)
- func (r *RefinementRecordsAPI) Get(ctx context.Context, recordID string, opts RefinementRecordGetOptions) (*RefinementRecord, error)
- func (r *RefinementRecordsAPI) List(ctx context.Context, opts RefinementRecordListOptions) (*RefinementRecordPage, error)
- type RefinementResourceSnapshot
- type ReflectOptions
- type ReflectResult
- type RelationshipCategory
- type RelationshipType
- type RememberOptions
- type ReprocessDocumentOptions
- type Request
- type ResolveSkillOptions
- type Response
- type RpgAPI
- func (r *RpgAPI) DeleteEdges(ctx context.Context, associationIDs []string, authority *AuthorityContext) (*RpgDeleteResult, error)
- func (r *RpgAPI) DeleteNodes(ctx context.Context, nodeIDs []string, contextID string, ...) (*RpgDeleteResult, error)
- func (r *RpgAPI) DeleteOverlay(ctx context.Context, contextID string, authority *AuthorityContext) (*RpgOverlayDeleteResult, error)
- func (r *RpgAPI) Enrich(ctx context.Context, opts RpgEnrichOptions) (*RpgEnrichmentResult, error)
- func (r *RpgAPI) GetConflicts(ctx context.Context, taskID string, authority *AuthorityContext) (*RpgConflictResult, error)
- func (r *RpgAPI) GetMergedSubgraph(ctx context.Context, overlayContext, baseContext, path string, depth int, ...) (*RpgSubgraph, error)
- func (r *RpgAPI) GetStatus(ctx context.Context, contextID string, authority *AuthorityContext) (*RpgStatus, error)
- func (r *RpgAPI) GetSubgraph(ctx context.Context, opts RpgSubgraphOptions) (*RpgSubgraph, error)
- func (r *RpgAPI) GetSymbolConflicts(ctx context.Context, taskIDA, taskIDB string, authority *AuthorityContext) (*RpgSymbolConflictResult, error)
- func (r *RpgAPI) ListNodes(ctx context.Context, opts RpgListNodesOptions) (*RpgNodeList, error)
- func (r *RpgAPI) ListOverlays(ctx context.Context, authority *AuthorityContext) (*RpgOverlayList, error)
- func (r *RpgAPI) Maintenance(ctx context.Context, operation RpgMaintenanceOperation, ...) (*RpgMaintenanceResult, error)
- func (r *RpgAPI) Search(ctx context.Context, query string, opts RpgSearchOptions) (*RpgSearchResult, error)
- func (r *RpgAPI) Sync(ctx context.Context, nodes []RpgNodeInput, edges []RpgEdgeInput, ...) (*RpgSyncResult, error)
- type RpgConflict
- type RpgConflictResult
- type RpgDeleteResult
- type RpgEdge
- type RpgEdgeInput
- type RpgEnrichOptions
- type RpgEnrichmentResult
- type RpgListNodesOptions
- type RpgMaintenanceOperation
- type RpgMaintenanceResult
- type RpgNode
- type RpgNodeInput
- type RpgNodeList
- type RpgOverlay
- type RpgOverlayDeleteResult
- type RpgOverlayList
- type RpgSearchOptions
- type RpgSearchResult
- type RpgStatus
- type RpgSubgraph
- type RpgSubgraphOptions
- type RpgSymbolConflict
- type RpgSymbolConflictResult
- type RpgSyncOptions
- type RpgSyncResult
- type SaveSkillOptions
- type SearchTolerance
- type SemanticMemoryCreateInput
- type SemanticMemoryReplaceInput
- type ServerError
- type Session
- type SessionActivity
- type SessionBriefing
- type SessionCheckpoint
- type SkillFile
- type SkillGetOptions
- type SkillHistoryOptions
- type SkillManifest
- type SkillManifestCreateInput
- type SkillManifestMutationOptions
- type SkillManifestReplaceInput
- type SkillModel
- type SkillMutationResult
- type SkillResolution
- type SkillRevision
- type SkillRevisionPage
- type SkillsAPI
- func (s *SkillsAPI) CreateVersioned(ctx context.Context, input SkillManifestCreateInput, ...) (*SkillMutationResult, error)
- func (s *SkillsAPI) Delete(ctx context.Context, skillID string, authority *AuthorityContext) error
- func (s *SkillsAPI) DeleteVersioned(ctx context.Context, skillID string, opts SkillManifestMutationOptions) (*SkillMutationResult, error)
- func (s *SkillsAPI) Get(ctx context.Context, skillID string, authority *AuthorityContext) (*SkillModel, error)
- func (s *SkillsAPI) GetFile(ctx context.Context, skillID, path string) ([]byte, error)
- func (s *SkillsAPI) GetManifest(ctx context.Context, skillID string) (string, error)
- func (s *SkillsAPI) GetManifestWithOptions(ctx context.Context, skillID string, opts GetSkillManifestOptions) (string, error)
- func (s *SkillsAPI) GetWithOptions(ctx context.Context, skillID string, opts SkillGetOptions) (*SkillModel, error)
- func (s *SkillsAPI) History(ctx context.Context, skillID string, opts SkillHistoryOptions) (*SkillRevisionPage, error)
- func (s *SkillsAPI) List(ctx context.Context, opts ListSkillsOptions) ([]SkillModel, error)
- func (s *SkillsAPI) ListFiles(ctx context.Context, skillID string, authority *AuthorityContext) ([]map[string]any, error)
- func (s *SkillsAPI) Materialize(ctx context.Context, targetDir, scope, workspaceID string) ([]string, error)
- func (s *SkillsAPI) Pull(ctx context.Context, name, outDir, workspaceID string) (string, error)
- func (s *SkillsAPI) Push(ctx context.Context, skillDir, scope, sourceMode, workspaceID string) (*SkillModel, error)
- func (s *SkillsAPI) ReplaceManifest(ctx context.Context, skillID string, input SkillManifestReplaceInput, ...) (*SkillMutationResult, error)
- func (s *SkillsAPI) Resolve(ctx context.Context, name, query, workspaceID string, ...) (*SkillResolution, error)
- func (s *SkillsAPI) ResolveWithOptions(ctx context.Context, opts ResolveSkillOptions) (*SkillResolution, error)
- func (s *SkillsAPI) Restore(ctx context.Context, skillID string, opts SkillManifestMutationOptions) (*SkillMutationResult, error)
- func (s *SkillsAPI) Save(ctx context.Context, name, description string, opts SaveSkillOptions) (*SkillModel, error)
- type TokenCreateResult
- type TokenInfo
- type Transport
- type TraverseGraphOptions
- type UpdateAssociationOptions
- type UpdateMcpServerOptions
- type UpdateMemoryOptions
- type UpdateThreadOptions
- type UpdateWorkspaceOptions
- type UploadDatasetOptions
- type UploadDocumentOptions
- type ValidationError
- type Workspace
- type WorkspaceExport
- type WorkspaceObservationListOptions
- type WorkspaceObservationMutationOptions
- type WorkspaceObservationMutationResult
- type WorkspaceVCSObservation
- type WorkspaceView
- type WorkspaceViewCreateInput
- type WorkspaceViewHistoryOptions
- type WorkspaceViewListOptions
- type WorkspaceViewMutationOptions
- type WorkspaceViewMutationResult
- type WorkspaceViewObservation
- type WorkspaceViewObservationInput
- type WorkspaceViewObservationPage
- type WorkspaceViewObservationRevision
- type WorkspaceViewObservationRevisionPage
- type WorkspaceViewPage
- type WorkspaceViewReplaceInput
- type WorkspaceViewRevision
- type WorkspaceViewRevisionPage
- type WorkspaceViewsAPI
- func (w *WorkspaceViewsAPI) Create(ctx context.Context, input WorkspaceViewCreateInput, ...) (*WorkspaceViewMutationResult, error)
- func (w *WorkspaceViewsAPI) CreateObservation(ctx context.Context, viewID, observerID string, ...) (*WorkspaceObservationMutationResult, error)
- func (w *WorkspaceViewsAPI) Delete(ctx context.Context, viewID string, opts WorkspaceViewMutationOptions) (*WorkspaceViewMutationResult, error)
- func (w *WorkspaceViewsAPI) DeleteObservation(ctx context.Context, viewID, observerID string, ...) (*WorkspaceObservationMutationResult, error)
- func (w *WorkspaceViewsAPI) Get(ctx context.Context, workspaceID, viewID string, authority *AuthorityContext) (*WorkspaceView, error)
- func (w *WorkspaceViewsAPI) GetObservation(ctx context.Context, workspaceID, viewID, observerID string, ...) (*WorkspaceViewObservation, error)
- func (w *WorkspaceViewsAPI) History(ctx context.Context, viewID string, opts WorkspaceViewHistoryOptions) (*WorkspaceViewRevisionPage, error)
- func (w *WorkspaceViewsAPI) List(ctx context.Context, opts WorkspaceViewListOptions) (*WorkspaceViewPage, error)
- func (w *WorkspaceViewsAPI) ListObservations(ctx context.Context, viewID string, opts WorkspaceObservationListOptions) (*WorkspaceViewObservationPage, error)
- func (w *WorkspaceViewsAPI) ObservationHistory(ctx context.Context, viewID, observerID string, ...) (*WorkspaceViewObservationRevisionPage, error)
- func (w *WorkspaceViewsAPI) Replace(ctx context.Context, viewID string, input WorkspaceViewReplaceInput, ...) (*WorkspaceViewMutationResult, error)
- func (w *WorkspaceViewsAPI) ReplaceObservation(ctx context.Context, viewID, observerID string, ...) (*WorkspaceObservationMutationResult, error)
- func (w *WorkspaceViewsAPI) Restore(ctx context.Context, viewID string, opts WorkspaceViewMutationOptions) (*WorkspaceViewMutationResult, error)
- func (w *WorkspaceViewsAPI) RestoreObservation(ctx context.Context, viewID, observerID string, ...) (*WorkspaceObservationMutationResult, error)
Constants ¶
const ( // UserChatHomeWorkspace is the storage workspace sentinel for user-owned // chat threads. When a thread is created or appended-to with // ownership="user" (the SDK default), the caller-supplied workspace is // substituted with this sentinel so the thread lives in the cross-workspace // user namespace; the original workspace is preserved on per-message // metadata under MessageMetaAppWorkspaceKey. UserChatHomeWorkspace = "_user_chat" // MessageMetaAppWorkspaceKey is the reserved top-level key on chat message // metadata carrying the originating app workspace at write time. MessageMetaAppWorkspaceKey = "app_workspace" )
Stable constants shared with the MemoryLayer server. These mirror memorylayer_server.models.chat — the values MUST match the server.
const DefaultBaseURL = "http://localhost:61001"
DefaultBaseURL is the base URL used when none is supplied via WithBaseURL.
const Version = "0.2.0"
Version is the SDK version, kept in step with the Python/TypeScript SDKs.
Variables ¶
This section is empty.
Functions ¶
func IsEnterpriseRequired ¶
IsEnterpriseRequired reports whether err is (or wraps) an EnterpriseRequiredError.
func IsNotFound ¶
IsNotFound reports whether err is (or wraps) a NotFoundError.
func ParseSkillFolder ¶
func ParseSkillFolder(path string) (*SkillManifest, []SkillFile, error)
ParseSkillFolder parses a skill directory into its manifest and bundle files. It reads SKILL.md for frontmatter (name, description, version, ...) and body, and walks scripts/, references/, and assets/ plus any root-level files.
Types ¶
type APIError ¶
APIError is the base error type for all MemoryLayer API failures. Every typed error below embeds an *APIError, so errors.As against *APIError matches any of them and exposes the HTTP StatusCode.
type AgentSpecification ¶
type AgentSpecification struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
WorkspaceID string `json:"workspace_id"`
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
Instructions string `json:"instructions"`
InvocationGuidance string `json:"invocation_guidance"`
Model string `json:"model"`
MaxTurns int `json:"max_turns"`
AllowedTools []string `json:"allowed_tools"`
DeniedTools []string `json:"denied_tools"`
Skills []string `json:"skills"`
MCPServers []string `json:"mcp_servers"`
PermissionMode string `json:"permission_mode"`
ExecPolicyHint string `json:"exec_policy_hint"`
Background bool `json:"background"`
Enabled bool `json:"enabled"`
SchemaVersion int `json:"schema_version"`
Metadata map[string]any `json:"metadata"`
Revision int `json:"revision"`
ETag string `json:"etag"`
CreatedBy *string `json:"created_by,omitempty"`
UpdatedBy *string `json:"updated_by,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
DeletedAt *string `json:"deleted_at,omitempty"`
}
AgentSpecification is a typed, revisioned reusable subagent definition.
type AgentSpecificationCreateInput ¶
type AgentSpecificationCreateInput struct {
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
Instructions string `json:"instructions"`
InvocationGuidance string `json:"invocation_guidance,omitempty"`
Model string `json:"model,omitempty"`
MaxTurns int `json:"max_turns,omitempty"`
AllowedTools []string `json:"allowed_tools,omitempty"`
DeniedTools []string `json:"denied_tools,omitempty"`
Skills []string `json:"skills,omitempty"`
MCPServers []string `json:"mcp_servers,omitempty"`
PermissionMode string `json:"permission_mode,omitempty"`
ExecPolicyHint string `json:"exec_policy_hint,omitempty"`
Background bool `json:"background,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
AgentSpecificationCreateInput is the typed content accepted by AgentSpecificationsAPI.Create.
type AgentSpecificationGetOptions ¶
type AgentSpecificationGetOptions = PromptNoteGetOptions
type AgentSpecificationHistoryOptions ¶
type AgentSpecificationHistoryOptions = PromptNoteHistoryOptions
type AgentSpecificationListOptions ¶
type AgentSpecificationListOptions = PromptNoteListOptions
type AgentSpecificationMutationOptions ¶
type AgentSpecificationMutationOptions = PromptNoteMutationOptions
type AgentSpecificationMutationResult ¶
type AgentSpecificationMutationResult struct {
Specification AgentSpecification
Replayed bool
ETag string
}
type AgentSpecificationPage ¶
type AgentSpecificationPage struct {
Specifications []AgentSpecification `json:"specifications"`
NextPageToken string `json:"next_page_token"`
}
type AgentSpecificationReplaceInput ¶
type AgentSpecificationReplaceInput struct {
Name string `json:"name"`
Description string `json:"description"`
Instructions string `json:"instructions"`
InvocationGuidance string `json:"invocation_guidance,omitempty"`
Model string `json:"model,omitempty"`
MaxTurns int `json:"max_turns,omitempty"`
AllowedTools []string `json:"allowed_tools,omitempty"`
DeniedTools []string `json:"denied_tools,omitempty"`
Skills []string `json:"skills,omitempty"`
MCPServers []string `json:"mcp_servers,omitempty"`
PermissionMode string `json:"permission_mode,omitempty"`
ExecPolicyHint string `json:"exec_policy_hint,omitempty"`
Background bool `json:"background,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
AgentSpecificationReplaceInput is a complete semantic replacement. Key is immutable.
type AgentSpecificationRevision ¶
type AgentSpecificationRevision struct {
Specification AgentSpecification `json:"specification"`
Action string `json:"action"`
OperationID string `json:"operation_id"`
}
type AgentSpecificationRevisionPage ¶
type AgentSpecificationRevisionPage struct {
Revisions []AgentSpecificationRevision `json:"revisions"`
NextPageToken string `json:"next_page_token"`
}
type AgentSpecificationsAPI ¶
type AgentSpecificationsAPI struct {
// contains filtered or unexported fields
}
AgentSpecificationsAPI is the typed /v1/agent-specifications namespace.
func (*AgentSpecificationsAPI) Create ¶
func (a *AgentSpecificationsAPI) Create(ctx context.Context, input AgentSpecificationCreateInput, opts AgentSpecificationMutationOptions) (*AgentSpecificationMutationResult, error)
func (*AgentSpecificationsAPI) Delete ¶
func (a *AgentSpecificationsAPI) Delete(ctx context.Context, specificationID string, opts AgentSpecificationMutationOptions) (*AgentSpecificationMutationResult, error)
func (*AgentSpecificationsAPI) Get ¶
func (a *AgentSpecificationsAPI) Get(ctx context.Context, specificationID string, opts AgentSpecificationGetOptions) (*AgentSpecification, error)
func (*AgentSpecificationsAPI) History ¶
func (a *AgentSpecificationsAPI) History(ctx context.Context, specificationID string, opts AgentSpecificationHistoryOptions) (*AgentSpecificationRevisionPage, error)
func (*AgentSpecificationsAPI) List ¶
func (a *AgentSpecificationsAPI) List(ctx context.Context, opts AgentSpecificationListOptions) (*AgentSpecificationPage, error)
func (*AgentSpecificationsAPI) Replace ¶
func (a *AgentSpecificationsAPI) Replace(ctx context.Context, specificationID string, input AgentSpecificationReplaceInput, opts AgentSpecificationMutationOptions) (*AgentSpecificationMutationResult, error)
func (*AgentSpecificationsAPI) Restore ¶
func (a *AgentSpecificationsAPI) Restore(ctx context.Context, specificationID string, opts AgentSpecificationMutationOptions) (*AgentSpecificationMutationResult, error)
Restore reactivates a tombstoned specification without changing its stable identity or semantic content.
type AppendMessagesOptions ¶
type AppendMessagesOptions struct {
WorkspaceID string
// Ownership is "user" (default) or "workspace". With "user", the supplied
// workspace is folded into each message's metadata under
// [MessageMetaAppWorkspaceKey] and the storage workspace becomes
// [UserChatHomeWorkspace].
Ownership string
Authority *AuthorityContext
}
AppendMessagesOptions configures Client.AppendMessages.
type AssociateOptions ¶
type AssociateOptions struct {
Strength float64 // 0.0-1.0; default 0.5 when zero
Metadata map[string]any
// contains filtered or unexported fields
}
AssociateOptions configures Client.Associate.
func (AssociateOptions) WithStrength ¶
func (o AssociateOptions) WithStrength(v float64) AssociateOptions
WithStrength returns a copy of opts with Strength explicitly set.
type Association ¶
type Association struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
SourceID string `json:"source_id"`
TargetID string `json:"target_id"`
Relationship string `json:"relationship"`
Strength float64 `json:"strength"`
Metadata map[string]any `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
}
Association is a relationship (graph edge) between two memories.
type AuthenticationError ¶
type AuthenticationError struct{ *APIError }
AuthenticationError is returned for HTTP 401 responses.
type AuthorityContext ¶
type AuthorityContext struct {
GrantID string
Subject *PrincipalRef
}
AuthorityContext is an on-behalf-of (OBO) authority. The client emits it as X-Aether-* headers; the HTTP transport forwards them and the Aether transport translates them into the proxy's structured authorization envelope.
A nil Subject means direct authority (acting as the grant holder); a non-nil Subject means acting on behalf of that principal.
type AuthorizationError ¶
type AuthorizationError struct{ *APIError }
AuthorizationError is returned for HTTP 403 responses.
type BudgetSummary ¶
type BudgetSummary struct {
Requested *int `json:"requested,omitempty"`
Used int `json:"used"`
Estimator string `json:"estimator"`
TruncatedItems int `json:"truncated_items"`
OmittedItems int `json:"omitted_items"`
}
BudgetSummary describes deterministic token-budget enforcement.
type ChatMessage ¶
type ChatMessage struct {
ID string `json:"id"`
ThreadID string `json:"thread_id"`
MessageIndex int `json:"message_index"`
Role string `json:"role"`
Content MessageContent `json:"content"`
Metadata map[string]any `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
}
ChatMessage is a single message in a chat thread.
type ChatMessageContent ¶
type ChatMessageContent struct {
Type string `json:"type"`
Text *string `json:"text,omitempty"`
Data map[string]any `json:"data,omitempty"`
}
ChatMessageContent is a structured content block within a chat message.
type ChatThread ¶
type ChatThread struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
TenantID string `json:"tenant_id"`
UserID *string `json:"user_id,omitempty"`
ContextID string `json:"context_id"`
ObserverID *string `json:"observer_id,omitempty"`
SubjectID *string `json:"subject_id,omitempty"`
Title *string `json:"title,omitempty"`
Metadata map[string]any `json:"metadata"`
MessageCount int `json:"message_count"`
LastDecomposedAt *time.Time `json:"last_decomposed_at,omitempty"`
LastDecomposedIndex int `json:"last_decomposed_index"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Scope *string `json:"scope,omitempty"`
Ownership string `json:"ownership"`
// ParentThread is the id of this thread's parent (chat_threads.parent_thread),
// or nil for a top-level thread. Set at create time only.
ParentThread *string `json:"parent_thread,omitempty"`
}
ChatThread is a conversation thread.
type ChatThreadWithMessages ¶
type ChatThreadWithMessages struct {
Thread ChatThread `json:"thread"`
Messages []ChatMessage `json:"messages"`
TotalMessages int `json:"total_messages"`
}
ChatThreadWithMessages is a thread with its messages inlined.
type Client ¶
type Client struct {
// Skills exposes the /v1/skills surface.
Skills *SkillsAPI
// McpServers exposes the /v1/mcp-servers surface.
McpServers *McpServersAPI
// Kb exposes the /v1/knowledgebase surface.
Kb *KnowledgebaseAPI
// Rpg exposes the /v1/rpg Repository Planning Graph surface.
Rpg *RpgAPI
// PromptNotes exposes the typed /v1/prompt-notes resource surface.
PromptNotes *PromptNotesAPI
// AgentSpecifications exposes revisioned reusable subagent definitions.
AgentSpecifications *AgentSpecificationsAPI
// RefinementRecords exposes append-only continual-refinement audit records.
RefinementRecords *RefinementRecordsAPI
// WorkspaceViews exposes durable workspace views and observer-published state.
WorkspaceViews *WorkspaceViewsAPI
// contains filtered or unexported fields
}
Client is the Go client for the MemoryLayer.ai API. It is safe for concurrent use. Construct one with NewClient and release it with Client.Close.
The sub-namespaces Skills, McpServers, PromptNotes, AgentSpecifications, RefinementRecords, Kb, and Rpg expose the corresponding server surfaces (client.Skills.List(...), client.Kb.Generate(...), etc.).
func NewClient ¶
NewClient constructs a Client. Unless WithTransport is supplied, it builds the default HTTP transport against the configured base URL.
func (*Client) ActingFor ¶
func (c *Client) ActingFor(grantID string, subject *PrincipalRef) *OBOProxy
ActingFor returns a proxy that carries OBO authority for the given grant and optional subject. A nil subject acts as the grant holder (direct mode).
alice := client.ActingFor("g_abc", &memorylayer.PrincipalRef{Type: "user", ID: "alice"})
alice.Recall(ctx, "preferences", memorylayer.RecallOptions{WorkspaceID: "ws_work"})
func (*Client) AppendMessages ¶
func (c *Client) AppendMessages(ctx context.Context, threadID string, messages []map[string]any, opts AppendMessagesOptions) ([]ChatMessage, error)
AppendMessages appends messages to a thread. Each message is a map with at least "role" and "content" (and optional "metadata").
func (*Client) Associate ¶
func (c *Client) Associate(ctx context.Context, sourceID, targetID string, relationship RelationshipType, opts AssociateOptions) (*Association, error)
Associate links two memories with a relationship.
func (*Client) BatchMemories ¶
func (c *Client) BatchMemories(ctx context.Context, operations []map[string]any) (map[string]any, error)
BatchMemories performs multiple memory operations in a single request. Each operation is a map like {"type": "create", "data": {...}}. The raw result map (per-operation success/error) is returned.
func (*Client) CancelDatasetJob ¶
CancelDatasetJob cancels a queued or running dataset processing job.
func (*Client) ClearSession ¶
func (c *Client) ClearSession()
ClearSession clears the active session ID.
func (*Client) CommitSession ¶
func (c *Client) CommitSession(ctx context.Context, sessionID string, opts CommitSessionOptions) (map[string]any, error)
CommitSession commits session working memory to long-term memory. The raw commit result (extraction statistics) is returned.
func (*Client) ContextCheckpoint ¶
ContextCheckpoint checkpoints the session's sandbox state for persistence.
func (*Client) ContextCleanup ¶
ContextCleanup removes the session's sandbox environment.
func (*Client) ContextExec ¶
func (c *Client) ContextExec(ctx context.Context, code string, opts ContextExecOptions) (map[string]any, error)
ContextExec executes Python code in the session's sandbox. The raw result (output, result, error, variables_changed) is returned.
func (*Client) ContextInject ¶
func (c *Client) ContextInject(ctx context.Context, key string, value any, parseJSON bool) (map[string]any, error)
ContextInject injects a value into the sandbox state. When parseJSON is true, a string value is parsed as JSON server-side.
func (*Client) ContextInspect ¶
func (c *Client) ContextInspect(ctx context.Context, variable string, previewChars int) (map[string]any, error)
ContextInspect inspects sandbox state or a specific variable (all when variable is empty). previewChars defaults to 200 when <= 0.
func (*Client) ContextLoad ¶
func (c *Client) ContextLoad(ctx context.Context, varName, query string, opts ContextLoadOptions) (map[string]any, error)
ContextLoad runs a recall query and stores the results into a sandbox variable. The raw result (count, variable info) is returned.
func (*Client) ContextQuery ¶
func (c *Client) ContextQuery(ctx context.Context, prompt string, variables []string, opts ContextQueryOptions) (map[string]any, error)
ContextQuery sends sandbox variables and a prompt to the LLM. The raw result (response text, token usage) is returned.
func (*Client) ContextRLM ¶
func (c *Client) ContextRLM(ctx context.Context, goal string, opts ContextRLMOptions) (map[string]any, error)
ContextRLM runs a Recursive Language Model loop toward a goal. The raw result (result, iterations, trace) is returned.
func (*Client) ContextStatus ¶
ContextStatus returns the status of the session's sandbox environment.
func (*Client) CreateCheckpoint ¶
func (c *Client) CreateCheckpoint(ctx context.Context, sessionID, transcriptSegment string, opts CreateCheckpointOptions) (*SessionCheckpoint, error)
CreateCheckpoint stores a raw pre-compaction transcript segment before any derived indexing or enrichment work.
func (*Client) CreateContext ¶
func (c *Client) CreateContext(ctx context.Context, workspaceID, name, description string, settings map[string]any) (map[string]any, error)
CreateContext creates a context within a workspace. The raw created context is returned.
func (*Client) CreateMemoryVersioned ¶
func (c *Client) CreateMemoryVersioned(ctx context.Context, input SemanticMemoryCreateInput, opts MemoryMutationOptions) (*MemoryMutationResult, error)
CreateMemoryVersioned conditionally creates one keyed semantic memory.
func (*Client) CreateSession ¶
CreateSession creates a new working-memory session. Workspaces and contexts are auto-created if they do not exist. By default the new session is set as the active session.
func (*Client) CreateThread ¶
func (c *Client) CreateThread(ctx context.Context, opts CreateThreadOptions) (*ChatThread, error)
CreateThread creates a new chat thread. With ownership "user" (the default) the thread is stored under UserChatHomeWorkspace regardless of the supplied workspace.
func (*Client) CreateToken ¶
func (c *Client) CreateToken(ctx context.Context, name string, opts CreateTokenOptions) (*TokenCreateResult, error)
CreateToken creates a new API token. The result includes the one-time plaintext Token secret — store it securely; it cannot be retrieved again.
func (*Client) CreateWorkspace ¶
func (c *Client) CreateWorkspace(ctx context.Context, name string, tags []string) (*Workspace, error)
CreateWorkspace creates a new workspace. tags may be nil.
func (*Client) DecomposeThread ¶
func (c *Client) DecomposeThread(ctx context.Context, threadID, workspaceID string) (*DecompositionResult, error)
DecomposeThread triggers memory decomposition for unprocessed messages.
func (*Client) DeleteAssociation ¶
func (c *Client) DeleteAssociation(ctx context.Context, memoryID, associationID string, authority *AuthorityContext) (bool, error)
DeleteAssociation deletes a graph edge by ID. memoryID must be one of the edge's endpoints. Returns false if the association was not found.
func (*Client) DeleteContext ¶
DeleteContext deletes a context from a workspace (defaults to the client workspace when workspaceID is empty).
func (*Client) DeleteDataset ¶
DeleteDataset deletes a dataset and optionally its extracted memories.
func (*Client) DeleteDocument ¶
DeleteDocument deletes a document and optionally its extracted memories.
func (*Client) DeleteMemoryVersioned ¶
func (c *Client) DeleteMemoryVersioned(ctx context.Context, memoryID string, opts MemoryMutationOptions) (*MemoryMutationResult, error)
DeleteMemoryVersioned conditionally writes a durable semantic tombstone.
func (*Client) DeleteMessage ¶
func (c *Client) DeleteMessage(ctx context.Context, threadID, messageID string, opts DeleteMessageOptions) (bool, error)
DeleteMessage deletes a single message from a thread. Returns false if the message was not found.
func (*Client) DeleteSession ¶
DeleteSession deletes a session and all its context data.
func (*Client) DeleteThread ¶
DeleteThread deletes a thread and its messages.
func (*Client) DeleteToken ¶
func (c *Client) DeleteToken(ctx context.Context, tokenID string, authority *AuthorityContext) error
DeleteToken deletes an API token.
func (*Client) ExportWorkspace ¶
func (c *Client) ExportWorkspace(ctx context.Context, opts ExportWorkspaceOptions) (*WorkspaceExport, error)
ExportWorkspace exports a workspace's memories and associations, parsing the server's NDJSON stream into a single WorkspaceExport.
func (*Client) ExportWorkspaceStream ¶
func (c *Client) ExportWorkspaceStream(ctx context.Context, opts ExportWorkspaceOptions, fn func(map[string]any) error) error
ExportWorkspaceStream exports a workspace as NDJSON, invoking fn for each parsed line (header, memory, association, footer). Returning a non-nil error from fn stops iteration.
func (*Client) ForWorkspace ¶
ForWorkspace returns a proxy with workspaceID baked in (using the client's default authority).
func (*Client) GetAssociations ¶
func (c *Client) GetAssociations(ctx context.Context, memoryID, direction string) ([]Association, error)
GetAssociations returns associations for a memory. direction is "outgoing", "incoming", or "both" (default "both" when empty).
func (*Client) GetBriefing ¶
func (c *Client) GetBriefing(ctx context.Context, opts GetBriefingOptions) (*SessionBriefing, error)
GetBriefing returns a session briefing with recent activity and context.
func (*Client) GetCheckpoint ¶
func (c *Client) GetCheckpoint(ctx context.Context, sessionID, checkpointID string) (*SessionCheckpoint, error)
GetCheckpoint fetches a durable session checkpoint by ID.
func (*Client) GetContext ¶
func (c *Client) GetContext(ctx context.Context, sessionID string, keys []string) (map[string]any, error)
GetContext gets context values from a session.
func (*Client) GetContextDelta ¶
func (c *Client) GetContextDelta(ctx context.Context, sessionID, cursor string, budgetTokens int) (*ContextDelta, error)
GetContextDelta returns collapsed context changes since a pack cursor.
func (*Client) GetContextPack ¶
func (c *Client) GetContextPack(ctx context.Context, sessionID string, opts ContextPackOptions) (*ContextPack, error)
GetContextPack returns a deterministic, hard-budgeted session resume pack.
func (*Client) GetDataset ¶
GetDataset fetches dataset metadata, schema, and profile.
func (*Client) GetDatasetJob ¶
GetDatasetJob returns dataset processing job status and progress.
func (*Client) GetDatasetMemories ¶
func (c *Client) GetDatasetMemories(ctx context.Context, datasetID string) ([]map[string]any, error)
GetDatasetMemories returns memories extracted from a dataset (raw maps).
func (*Client) GetDocument ¶
GetDocument fetches document metadata and processing status.
func (*Client) GetDocumentPages ¶
GetDocumentPages returns all pages for a document.
func (*Client) GetEntity ¶
func (c *Client) GetEntity(ctx context.Context, entityID, workspaceID string, authority *AuthorityContext) (*Entity, error)
GetEntity fetches a single canonical entity by ID.
func (*Client) GetMemory ¶
func (c *Client) GetMemory(ctx context.Context, memoryID string, opts ...GetMemoryOptions) (*Memory, error)
GetMemory fetches a single memory by ID. An optional GetMemoryOptions may carry a per-call OBO authority; without it the client's default authority (if any) applies.
func (*Client) GetMessages ¶
func (c *Client) GetMessages(ctx context.Context, threadID string, opts GetMessagesOptions) ([]ChatMessage, error)
GetMessages fetches messages from a thread.
func (*Client) GetPageImage ¶
GetPageImage returns a page image as raw PNG bytes (Enterprise).
func (*Client) GetSession ¶
GetSession fetches a session by ID.
func (*Client) GetThreadFull ¶
func (c *Client) GetThreadFull(ctx context.Context, threadID string, opts GetThreadFullOptions) (*ChatThreadWithMessages, error)
GetThreadFull fetches a thread with its messages inlined.
func (*Client) GetToken ¶
func (c *Client) GetToken(ctx context.Context, tokenID string, authority *AuthorityContext) (*TokenInfo, error)
GetToken fetches a single API token by ID (without the plaintext secret).
func (*Client) GetWorkspace ¶
GetWorkspace fetches workspace details (defaults to the client workspace when workspaceID is empty).
func (*Client) GetWorkspaceSchema ¶
func (c *Client) GetWorkspaceSchema(ctx context.Context, workspaceID string) (map[string]any, error)
GetWorkspaceSchema returns a workspace's schema (relationship_types, memory_subtypes, can_customize).
func (*Client) ImportWorkspace ¶
func (c *Client) ImportWorkspace(ctx context.Context, workspaceID string, data any) (map[string]any, error)
ImportWorkspace imports memories and associations into a workspace from a previously exported document. The raw import result (counts) is returned.
func (*Client) ImportWorkspaceStream ¶
func (c *Client) ImportWorkspaceStream(ctx context.Context, workspaceID string, lines []map[string]any) (map[string]any, error)
ImportWorkspaceStream imports a workspace from NDJSON lines (each serialized to one line). The raw import result (counts) is returned.
func (*Client) IterateMemories ¶
func (c *Client) IterateMemories(ctx context.Context, pageSize int, opts ListMemoriesOptions, fn func(Memory) error) error
IterateMemories auto-paginates Client.ListMemories, invoking fn for every memory. Returning a non-nil error from fn stops iteration and propagates it. pageSize is clamped to [1, 200].
func (*Client) ListContexts ¶
ListContexts lists all contexts in a workspace as raw maps.
func (*Client) ListDatasetJobs ¶
func (c *Client) ListDatasetJobs(ctx context.Context, status string, limit int) ([]DatasetJobInfo, error)
ListDatasetJobs lists dataset processing jobs in the workspace.
func (*Client) ListDatasets ¶
func (c *Client) ListDatasets(ctx context.Context, opts ListDatasetsOptions) ([]DatasetInfo, int, error)
ListDatasets lists datasets in the workspace, returning the page and the reported total count.
func (*Client) ListDocuments ¶
func (c *Client) ListDocuments(ctx context.Context, opts ListDocumentsOptions) ([]DocumentInfo, int, error)
ListDocuments lists documents in the workspace, returning the page and the reported total count.
func (*Client) ListEntities ¶
ListEntities lists canonical entities in a workspace (ordered by id). Requires the server-side entity registry; otherwise returns an EnterpriseRequiredError.
func (*Client) ListMemories ¶
func (c *Client) ListMemories(ctx context.Context, opts ListMemoriesOptions) (*RecallResult, error)
ListMemories lists/browses memories ordered by recency (no vector search).
The returned TotalCount reflects the size of the returned page, not a grand total — use Client.IterateMemories to walk all pages.
func (*Client) ListSessions ¶
func (c *Client) ListSessions(ctx context.Context, opts ListSessionsOptions) ([]map[string]any, error)
ListSessions lists sessions in a workspace. Each entry is returned as a raw map (the server's session shape varies by deployment).
func (*Client) ListThreads ¶
func (c *Client) ListThreads(ctx context.Context, opts ListThreadsOptions) ([]ChatThread, error)
ListThreads lists chat threads.
func (*Client) ListTokens ¶
func (c *Client) ListTokens(ctx context.Context, includeRevoked bool, authority *AuthorityContext) ([]TokenInfo, error)
ListTokens lists API tokens (without plaintext secrets).
func (*Client) ListUserThreads ¶
func (c *Client) ListUserThreads(ctx context.Context, userID string, opts ListUserThreadsOptions) ([]ChatThread, error)
ListUserThreads lists threads owned by a user across all workspaces. Unlike ListThreads it is keyed on (tenant, user, ownership) and needs no workspace.
func (*Client) ListWorkspaces ¶
func (c *Client) ListWorkspaces(ctx context.Context, tags []string, match string) ([]Workspace, error)
ListWorkspaces lists workspaces, optionally filtered by tag. match is "all" (default) — require every tag — or "any".
func (*Client) MemoryHistory ¶
func (c *Client) MemoryHistory(ctx context.Context, memoryID string, opts MemoryHistoryOptions) (*MemoryRevisionPage, error)
MemoryHistory returns immutable semantic revisions newest first.
func (*Client) MergeEntities ¶
func (c *Client) MergeEntities(ctx context.Context, sourceID, targetID, reason, workspaceID string, authority *AuthorityContext) (*Entity, error)
MergeEntities merges sourceID into targetID and returns the surviving entity.
func (*Client) QueryDatasetSlice ¶
func (c *Client) QueryDatasetSlice(ctx context.Context, datasetID string, opts QueryDatasetSliceOptions) (*DatasetSliceResult, error)
QueryDatasetSlice queries a slice of dataset data using DuckDB (Enterprise).
func (*Client) Recall ¶
func (c *Client) Recall(ctx context.Context, query string, opts RecallOptions) (*RecallResult, error)
Recall searches memories by semantic query.
func (*Client) Reflect ¶
func (c *Client) Reflect(ctx context.Context, query string, opts ReflectOptions) (*ReflectResult, error)
Reflect synthesizes and summarizes memories.
func (*Client) Remember ¶
func (c *Client) Remember(ctx context.Context, content string, opts RememberOptions) (*Memory, error)
Remember stores a new memory.
func (*Client) ReplaceSemanticMemory ¶
func (c *Client) ReplaceSemanticMemory(ctx context.Context, memoryID string, input SemanticMemoryReplaceInput, opts MemoryMutationOptions) (*MemoryMutationResult, error)
ReplaceSemanticMemory atomically replaces the refinement-owned document.
func (*Client) ReprocessDocument ¶
func (c *Client) ReprocessDocument(ctx context.Context, documentID string, opts ReprocessDocumentOptions) (*JobInfo, error)
ReprocessDocument reprocesses a document with optionally different extraction options.
func (*Client) ResolveEntity ¶
func (c *Client) ResolveEntity(ctx context.Context, name, entityType, workspaceID string, authority *AuthorityContext) (*EntityResolution, error)
ResolveEntity resolves a surface name/alias to an existing canonical entity. It never creates an entity, and returns (nil, nil) when no entity matched. entityType defaults to "person" when empty.
func (*Client) RestoreMemoryVersioned ¶
func (c *Client) RestoreMemoryVersioned(ctx context.Context, memoryID string, opts MemoryMutationOptions) (*MemoryMutationResult, error)
RestoreMemoryVersioned conditionally reactivates the exact tombstoned head.
func (*Client) RevokeToken ¶
func (c *Client) RevokeToken(ctx context.Context, tokenID string, authority *AuthorityContext) error
RevokeToken revokes an API token. Revoked tokens are invalidated immediately but remain visible in listings with Revoked=true.
func (*Client) SearchDocumentPages ¶
func (c *Client) SearchDocumentPages(ctx context.Context, query string, limit int, docIDs []string) (*PageSearchResult, error)
SearchDocumentPages searches document pages via ColPali MaxSim visual similarity (Enterprise).
func (*Client) SetContext ¶
func (c *Client) SetContext(ctx context.Context, sessionID, key string, value any, ttlSeconds int) error
SetContext sets a context value in a session. ttlSeconds <= 0 omits the TTL.
func (*Client) SetSession ¶
SetSession sets the active session ID. Subsequent requests include it in the X-Session-ID header, enabling session-based workspace resolution.
func (*Client) TouchSession ¶
TouchSession extends a session's TTL. The raw result (updated expiration) is returned.
func (*Client) TraverseGraph ¶
func (c *Client) TraverseGraph(ctx context.Context, memoryID string, opts TraverseGraphOptions) (map[string]any, error)
TraverseGraph traverses the memory graph from a starting memory. The raw graph result (paths, total_paths, unique_nodes, query_latency_ms) is returned.
func (*Client) UpdateAssociation ¶
func (c *Client) UpdateAssociation(ctx context.Context, memoryID, associationID string, opts UpdateAssociationOptions) (bool, error)
UpdateAssociation updates an association's strength and/or metadata. memoryID must be one of the edge's endpoints. Returns false if the association was not found.
func (*Client) UpdateMemory ¶
func (c *Client) UpdateMemory(ctx context.Context, memoryID string, opts UpdateMemoryOptions) (*Memory, error)
UpdateMemory updates an existing memory.
func (*Client) UpdateThread ¶
func (c *Client) UpdateThread(ctx context.Context, threadID string, opts UpdateThreadOptions) (*ChatThread, error)
UpdateThread updates a thread's metadata (e.g. renames it).
func (*Client) UpdateWorkspace ¶
func (c *Client) UpdateWorkspace(ctx context.Context, workspaceID string, opts UpdateWorkspaceOptions) (*Workspace, error)
UpdateWorkspace updates an existing workspace.
func (*Client) UploadDataset ¶
func (c *Client) UploadDataset(ctx context.Context, fileData []byte, filename string, opts UploadDatasetOptions) (*DatasetInfo, *DatasetJobInfo, error)
UploadDataset uploads a dataset for profiling and memory extraction (Enterprise). Returns the created dataset and its processing job.
func (*Client) UploadDocument ¶
func (c *Client) UploadDocument(ctx context.Context, fileData []byte, filename string, opts UploadDocumentOptions) (*DocumentInfo, *JobInfo, error)
UploadDocument uploads a document for ingestion (Enterprise). Returns the created document and its ingestion job.
func (*Client) WorkspaceID ¶
WorkspaceID returns the client's default workspace ID.
type CommitSessionOptions ¶
type CommitSessionOptions struct {
MinImportance float64 // default 0.5 when zero (and not set)
Deduplicate *bool // default true
Categories []string
MaxMemories int // default 50 when <= 0
// contains filtered or unexported fields
}
CommitSessionOptions configures Client.CommitSession.
func (CommitSessionOptions) WithMinImportance ¶
func (o CommitSessionOptions) WithMinImportance(v float64) CommitSessionOptions
WithMinImportance returns a copy with MinImportance explicitly set.
type ConflictError ¶
type ConflictError struct{ *APIError }
ConflictError is returned for HTTP 409 responses.
type Context ¶
type Context struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Settings map[string]any `json:"settings,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
}
Context is a logical grouping of memories within a workspace.
type ContextDelta ¶
type ContextDelta struct {
Rendered string `json:"rendered"`
Items []ContextPackItem `json:"items"`
BudgetSummary BudgetSummary `json:"budget_summary"`
GenerationSummary GenerationSummary `json:"generation_summary"`
Cursor string `json:"cursor"`
HasMore bool `json:"has_more"`
DegradationNotices []string `json:"degradation_notices"`
}
ContextDelta is the changed session context since a context-pack cursor.
type ContextExecOptions ¶
type ContextExecOptions struct {
ResultVar string
ReturnResult *bool // default true
MaxReturnChars int // default 10000 when <= 0
}
ContextExecOptions configures Client.ContextExec.
type ContextLoadOptions ¶
type ContextLoadOptions struct {
Limit int // default 50 when <= 0
Types []string
Tags []string
MinRelevance *float64
IncludeEmbeddings bool
}
ContextLoadOptions configures Client.ContextLoad.
type ContextPack ¶
type ContextPack struct {
Rendered string `json:"rendered"`
Items []ContextPackItem `json:"items"`
OpenThreads []map[string]any `json:"open_threads"`
UnresolvedContradictions []map[string]any `json:"unresolved_contradictions"`
BudgetSummary BudgetSummary `json:"budget_summary"`
GenerationSummary GenerationSummary `json:"generation_summary"`
Cursor string `json:"cursor"`
DegradationNotices []string `json:"degradation_notices"`
}
ContextPack is a deterministic, hard-budgeted session resume payload.
type ContextPackItem ¶
type ContextPackItem struct {
ID string `json:"id"`
Kind string `json:"kind"`
Content string `json:"content"`
Importance float64 `json:"importance"`
EventTime *time.Time `json:"event_time,omitempty"`
MatchSignals []string `json:"match_signals"`
SourceReferences []string `json:"source_references"`
Tombstone bool `json:"tombstone"`
}
ContextPackItem is one deterministic context-pack or delta item.
type ContextPackOptions ¶
type ContextPackOptions struct {
Topic string
EntityIDs []string
EntityNames []string
BudgetTokens int
SectionLimits map[string]int
IncludeDirectives *bool
IncludeWorkingMemory *bool
IncludeRecentActivity *bool
IncludeContradictions *bool
IncludeSandboxSummary *bool
IncludeCheckpointRecovery *bool
}
ContextPackOptions configures deterministic session context assembly.
type ContextQueryOptions ¶
ContextQueryOptions configures Client.ContextQuery.
type ContextRLMOptions ¶
type ContextRLMOptions struct {
MemoryQuery string
MemoryLimit int // default 100 when <= 0
MaxIterations int // default 10 when <= 0
Variables []string
ResultVar string
DetailLevel string // "brief", "standard" (default), or "detailed"
}
ContextRLMOptions configures Client.ContextRLM.
type ContradictionDetection ¶
type ContradictionDetection struct {
MemoryA string `json:"memory_a"`
MemoryB string `json:"memory_b"`
Relationship string `json:"relationship"`
NeedsResolution bool `json:"needs_resolution"`
}
ContradictionDetection is a detected contradiction between two memories.
type CreateCheckpointOptions ¶
type CreateCheckpointOptions struct {
ContentHash string
IdempotencyKey string
SourceKind string
SourceSequence *int
SourceBoundary *int
}
CreateCheckpointOptions configures a durable raw transcript capture.
type CreateMcpServerOptions ¶
type CreateMcpServerOptions struct {
Command string
Args []string
Env map[string]string
URL string
Headers map[string]string
Description string
Metadata map[string]any
SourceMode string // default "server"
Enabled *bool // default true
WorkspaceID string
UserID string
Authority *AuthorityContext
}
CreateMcpServerOptions configures McpServersAPI.Create.
type CreateSessionOptions ¶
type CreateSessionOptions struct {
TTLSeconds int // default 3600 when <= 0
WorkspaceID string // auto-created if it does not exist
ContextID string // defaults to _default server-side
// AutoSetSession, when true (the default), sets the created session as the
// active session for subsequent requests. Use NoAutoSetSession to disable.
AutoSetSession bool
// contains filtered or unexported fields
}
CreateSessionOptions configures Client.CreateSession.
func (CreateSessionOptions) NoAutoSetSession ¶
func (o CreateSessionOptions) NoAutoSetSession() CreateSessionOptions
NoAutoSetSession returns a copy of opts that will NOT auto-activate the created session.
type CreateThreadOptions ¶
type CreateThreadOptions struct {
WorkspaceID string
ThreadID string
UserID string
ContextID string
ObserverID string
SubjectID string
Title string
Metadata map[string]any
ExpiresAt string // ISO 8601
Scope string
// Ownership is "user" (default — user-owned, cross-workspace) or
// "workspace" (legacy workspace-scoped storage).
Ownership string
// ParentThread, when set, records this thread as a child of another thread
// (chat_threads.parent_thread). NULL/empty means a top-level thread. Parent is
// create-time only — the server has no re-parent endpoint.
ParentThread string
// Authority applies an OBO grant to the create (e.g. writing a user-owned
// thread into _user_chat requires the user's grant). nil uses the client's
// default authority.
Authority *AuthorityContext
}
CreateThreadOptions configures Client.CreateThread.
type CreateTokenOptions ¶
type CreateTokenOptions struct {
PrincipalType string // default "User"
WorkspacePatterns []string // default ["*"]
Scopes []string // default ["*"]
ExpiresInDays *int // nil = no expiry
Authority *AuthorityContext
}
CreateTokenOptions configures Client.CreateToken.
type DatasetColumn ¶
type DatasetColumn struct {
Name string `json:"name"`
Dtype string `json:"dtype"`
ColumnType string `json:"column_type"`
Nullable bool `json:"nullable"`
NullCount int `json:"null_count"`
NullPercent float64 `json:"null_percent"`
UniqueCount int `json:"unique_count"`
MinValue *float64 `json:"min_value,omitempty"`
MaxValue *float64 `json:"max_value,omitempty"`
MeanValue *float64 `json:"mean_value,omitempty"`
MedianValue *float64 `json:"median_value,omitempty"`
StdValue *float64 `json:"std_value,omitempty"`
P25Value *float64 `json:"p25_value,omitempty"`
P75Value *float64 `json:"p75_value,omitempty"`
MinLength *int `json:"min_length,omitempty"`
MaxLength *int `json:"max_length,omitempty"`
AvgLength *float64 `json:"avg_length,omitempty"`
TopValues []map[string]any `json:"top_values,omitempty"`
IsTemporal bool `json:"is_temporal"`
TemporalResolution *string `json:"temporal_resolution,omitempty"`
TemporalRangeStart *string `json:"temporal_range_start,omitempty"`
TemporalRangeEnd *string `json:"temporal_range_end,omitempty"`
Histogram map[string]any `json:"histogram,omitempty"`
}
DatasetColumn is column-level schema and statistics from dataset profiling (Enterprise).
type DatasetInfo ¶
type DatasetInfo struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
Name string `json:"name"`
Filename string `json:"filename"`
Format string `json:"format"`
ContentHash string `json:"content_hash"`
SizeBytes int64 `json:"size_bytes"`
Status string `json:"status"`
TargetContextID string `json:"target_context_id"`
RowCount int `json:"row_count"`
ColumnCount int `json:"column_count"`
Columns []DatasetColumn `json:"columns"`
MemoryIDs []string `json:"memory_ids"`
ProfileSummary *string `json:"profile_summary,omitempty"`
Metadata map[string]any `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
ProfilingStartedAt *time.Time `json:"profiling_started_at,omitempty"`
ProfilingCompletedAt *time.Time `json:"profiling_completed_at,omitempty"`
}
DatasetInfo is dataset metadata returned from the API (Enterprise).
type DatasetJobInfo ¶
type DatasetJobInfo struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
DatasetIDs []string `json:"dataset_ids"`
Status string `json:"status"`
ProgressPercent int `json:"progress_percent"`
DatasetsProcessed int `json:"datasets_processed"`
TotalMemoriesCreated int `json:"total_memories_created"`
Errors []map[string]any `json:"errors"`
CreatedAt time.Time `json:"created_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
}
DatasetJobInfo is a dataset processing job status (Enterprise).
type DatasetSliceResult ¶
type DatasetSliceResult struct {
DatasetID string `json:"dataset_id"`
Columns []string `json:"columns"`
Dtypes []string `json:"dtypes"`
Rows [][]any `json:"rows"`
TotalMatching int `json:"total_matching"`
ReturnedCount int `json:"returned_count"`
SQLExecuted *string `json:"sql_executed,omitempty"`
}
DatasetSliceResult is the result of a dataset slice query (Enterprise).
type DecompositionResult ¶
type DecompositionResult struct {
ThreadID string `json:"thread_id"`
WorkspaceID string `json:"workspace_id"`
MessagesProcessed int `json:"messages_processed"`
MemoriesCreated int `json:"memories_created"`
FromIndex int `json:"from_index"`
ToIndex int `json:"to_index"`
}
DecompositionResult is the result of triggering thread decomposition.
type DeleteMessageOptions ¶
type DeleteMessageOptions struct {
WorkspaceID string
Authority *AuthorityContext
}
DeleteMessageOptions configures Client.DeleteMessage.
type DocumentInfo ¶
type DocumentInfo struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
Filename string `json:"filename"`
DocumentType string `json:"document_type"`
ContentHash string `json:"content_hash"`
SizeBytes int64 `json:"size_bytes"`
MimeType *string `json:"mime_type,omitempty"`
Status string `json:"status"`
SourceVfsRef *string `json:"source_vfs_ref,omitempty"`
TargetContextID string `json:"target_context_id"`
PageCount int `json:"page_count"`
ChunkCount int `json:"chunk_count"`
MemoryIDs []string `json:"memory_ids"`
StoragePath *string `json:"storage_path,omitempty"`
RetainOriginal bool `json:"retain_original"`
Metadata map[string]any `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
ProcessingStartedAt *time.Time `json:"processing_started_at,omitempty"`
ProcessingCompletedAt *time.Time `json:"processing_completed_at,omitempty"`
}
DocumentInfo is document metadata returned from the API (Enterprise).
type DocumentPage ¶
type DocumentPage struct {
ID string `json:"id"`
DocumentID string `json:"document_id"`
WorkspaceID string `json:"workspace_id"`
PageNo int `json:"page_no"`
ImageStoragePath *string `json:"image_storage_path,omitempty"`
Transcript *string `json:"transcript,omitempty"`
TranscriptModel *string `json:"transcript_model,omitempty"`
Metadata map[string]any `json:"metadata"`
CreatedAt *time.Time `json:"created_at,omitempty"`
RelevanceScore *float64 `json:"relevance_score,omitempty"`
}
DocumentPage is a page from an ingested document (Enterprise).
type EnterpriseRequiredError ¶
EnterpriseRequiredError is returned when an Enterprise-only endpoint is hit on a server that does not provide the feature (HTTP 501 on a method flagged with an enterprise feature). The Feature field names the missing capability.
type Entity ¶
type Entity struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
EntityType string `json:"entity_type"`
CanonicalName string `json:"canonical_name"`
NormalizedName string `json:"normalized_name"`
Aliases []string `json:"aliases"`
Confidence float64 `json:"confidence"`
Provenance map[string]any `json:"provenance"`
RepresentativeMemoryID *string `json:"representative_memory_id,omitempty"`
Status string `json:"status"`
MergedInto *string `json:"merged_into,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Entity is a canonical, workspace-scoped entity node.
type EntityRelation ¶
type EntityRelation struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
SourceEntityID string `json:"source_entity_id"`
TargetEntityID string `json:"target_entity_id"`
Relationship string `json:"relationship"`
Direction string `json:"direction"`
Confidence float64 `json:"confidence"`
Active bool `json:"active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
EntityRelation is a canonical typed edge between two workspace entities.
type EntityRelationInput ¶
type EntityRelationInput struct {
SourceEntityID string `json:"source_entity_id,omitempty"`
SourceEntityName string `json:"source_entity_name,omitempty"`
TargetEntityID string `json:"target_entity_id,omitempty"`
TargetEntityName string `json:"target_entity_name,omitempty"`
Relationship string `json:"relationship"`
Confidence float64 `json:"confidence,omitempty"`
SourceSpanStart *int `json:"source_span_start,omitempty"`
SourceSpanEnd *int `json:"source_span_end,omitempty"`
EvidenceKind string `json:"evidence_kind,omitempty"`
ExtractionMethod string `json:"extraction_method,omitempty"`
}
EntityRelationInput is an explicit typed entity relationship evidenced by a memory. Each endpoint may be supplied by canonical ID or exact/alias name.
type EntityRelationPath ¶
type EntityRelationPath struct {
SeedEntityID string `json:"seed_entity_id"`
EntityIDs []string `json:"entity_ids"`
Relations []EntityRelation `json:"relations"`
EvidenceIDs []string `json:"evidence_ids"`
EvidenceMemoryIDs []string `json:"evidence_memory_ids"`
}
EntityRelationPath is a bounded relation traversal returned by recall.
type EntityRelationWriteResult ¶
type EntityRelationWriteResult struct {
Resolved int `json:"resolved"`
Unresolved int `json:"unresolved"`
Rejected int `json:"rejected"`
Duplicate int `json:"duplicate"`
RelationIDs []string `json:"relation_ids"`
Errors []string `json:"errors"`
}
EntityRelationWriteResult reports deterministic relation resolution and storage outcomes for a remember request.
type EntityResolution ¶
type EntityResolution struct {
Entity Entity `json:"entity"`
MatchedVia string `json:"matched_via"`
Score float64 `json:"score"`
}
EntityResolution is the result of resolving a surface name to a canonical entity.
type ExportWorkspaceOptions ¶
type ExportWorkspaceOptions struct {
WorkspaceID string
IncludeAssociations *bool // default true
Offset int
Limit int // 0 = all
}
ExportWorkspaceOptions configures Client.ExportWorkspace and the streaming variant.
type GenerationSummary ¶
type GenerationSummary struct {
Policy string `json:"policy"`
Calls int `json:"calls"`
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
DeniedCalls int `json:"denied_calls"`
BudgetDeniedCalls int `json:"budget_denied_calls"`
}
GenerationSummary reports generation-boundary activity for an operation.
type GetBriefingOptions ¶
type GetBriefingOptions struct {
// LookbackHours, when > 0, overrides LookbackMinutes (deprecated knob kept
// for parity).
LookbackHours int
LookbackMinutes int // default 60 when <= 0
DetailLevel string // "abstract" (default), "overview", or "full"
Limit int // default 10 when <= 0
IncludeMemories *bool // default true
IncludeContradictions *bool // default true
}
GetBriefingOptions configures Client.GetBriefing.
type GetMemoryOptions ¶
type GetMemoryOptions struct {
// Authority applies a per-call OBO grant, overriding the client default —
// required when reading on behalf of a user through the Aether proxy, whose
// ACL check authorizes the request against the subject's grant (mirrors
// [RecallOptions.Authority]).
Authority *AuthorityContext
WorkspaceID string
IncludeDeleted bool
}
GetMemoryOptions configures Client.GetMemory.
type GetMessagesOptions ¶
type GetMessagesOptions struct {
WorkspaceID string
Limit int // default 100 when <= 0
Offset int
AfterIndex *int
Order string // "asc" (default) or "desc"
// Authority applies an OBO authority to this call (overriding the client
// default). Mirrors RecallOptions/AppendMessagesOptions so thread-history
// reads can carry the per-request user grant.
Authority *AuthorityContext
}
GetMessagesOptions configures Client.GetMessages.
type GetSkillManifestOptions ¶
type GetSkillManifestOptions struct {
WorkspaceID string
IncludeAddenda bool
Authority *AuthorityContext
}
GetSkillManifestOptions configures SkillsAPI.GetManifestWithOptions.
type GetThreadFullOptions ¶
type GetThreadFullOptions struct {
WorkspaceID string
Limit int // default 100 when <= 0
Offset int
Order string // "asc" (default) or "desc"
}
GetThreadFullOptions configures Client.GetThreadFull.
type JobInfo ¶
type JobInfo struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
DocumentIDs []string `json:"document_ids"`
Status string `json:"status"`
ProgressPercent int `json:"progress_percent"`
DocumentsProcessed int `json:"documents_processed"`
TotalMemoriesCreated int `json:"total_memories_created"`
Errors []map[string]any `json:"errors"`
CreatedAt time.Time `json:"created_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
}
JobInfo is an ingestion job status (Enterprise).
type KbArticle ¶
type KbArticle struct {
ID string `json:"id"`
ArticleType string `json:"article_type"`
Title string `json:"title"`
ContentMD string `json:"content_md"`
Metadata map[string]any `json:"metadata"`
GeneratedAt time.Time `json:"generated_at"`
}
KbArticle is a single knowledgebase article (index, community, or entity).
type KbBridge ¶
type KbBridge struct {
SourceCommunityID int `json:"source_community_id"`
TargetCommunityID int `json:"target_community_id"`
MemoryIDSource string `json:"memory_id_source"`
MemoryIDTarget string `json:"memory_id_target"`
RelationshipType string `json:"relationship_type"`
Strength float64 `json:"strength"`
}
KbBridge is an edge connecting two different communities.
type KbCentralNode ¶
type KbCentralNode struct {
MemoryID string `json:"memory_id"`
Degree int `json:"degree"`
Betweenness float64 `json:"betweenness"`
CommunityID int `json:"community_id"`
}
KbCentralNode is a high-centrality node ("god node") in the graph.
type KbCommunity ¶
type KbCommunity struct {
ID int `json:"id"`
MemoryIDs []string `json:"memory_ids"`
Size int `json:"size"`
CohesionScore float64 `json:"cohesion_score"`
CentralNodeIDs []string `json:"central_node_ids"`
Label *string `json:"label,omitempty"`
}
KbCommunity is a detected community (cluster) within the association graph.
type KbGenerateOptions ¶
type KbGenerateOptions struct {
WorkspaceID string
Regenerate bool
MaxCommunities *int
MaxGodNodes *int
IncludeRPG bool
ContextID string
Authority *AuthorityContext
}
KbGenerateOptions configures KnowledgebaseAPI.Generate.
type KbGetOptions ¶
type KbGetOptions struct {
WorkspaceID string
ContextID string
Authority *AuthorityContext
}
KbGetOptions configures KnowledgebaseAPI.Get.
type KbGraphAnalysis ¶
type KbGraphAnalysis struct {
Snapshot KbGraphSnapshot `json:"snapshot"`
Communities []KbCommunity `json:"communities"`
CentralNodes []KbCentralNode `json:"central_nodes"`
Bridges []KbBridge `json:"bridges"`
Stats KbGraphStats `json:"stats"`
}
KbGraphAnalysis is a complete graph analysis result for a workspace.
type KbGraphSnapshot ¶
type KbGraphSnapshot struct {
WorkspaceID string `json:"workspace_id"`
ContextID *string `json:"context_id,omitempty"`
NodeCount int `json:"node_count"`
EdgeCount int `json:"edge_count"`
IncludesRPG bool `json:"includes_rpg"`
}
KbGraphSnapshot is snapshot metadata for the association graph.
type KbGraphStats ¶
type KbGraphStats struct {
NodeCount int `json:"node_count"`
EdgeCount int `json:"edge_count"`
CommunityCount int `json:"community_count"`
Density float64 `json:"density"`
AvgDegree float64 `json:"avg_degree"`
MaxDegree int `json:"max_degree"`
GodNodeCount int `json:"god_node_count"`
}
KbGraphStats holds aggregate statistics about a workspace association graph.
type KbListArticlesOptions ¶
type KbListArticlesOptions struct {
WorkspaceID string
ArticleType string
Limit int // default 100 when <= 0
Offset int
Authority *AuthorityContext
}
KbListArticlesOptions configures KnowledgebaseAPI.ListArticles.
type KbMetadata ¶
type KbMetadata struct {
WorkspaceID string `json:"workspace_id"`
ArticleCount int `json:"article_count"`
CommunityCount int `json:"community_count"`
GeneratedAt time.Time `json:"generated_at"`
Stats *KbGraphStats `json:"stats,omitempty"`
}
KbMetadata describes a generated knowledgebase for a workspace.
type KnowledgebaseAPI ¶
type KnowledgebaseAPI struct {
// contains filtered or unexported fields
}
KnowledgebaseAPI is the /v1/knowledgebase namespace, reached via client.Kb.
func (*KnowledgebaseAPI) ExportVault ¶
func (k *KnowledgebaseAPI) ExportVault(ctx context.Context, workspaceID string, authority *AuthorityContext) ([]byte, error)
ExportVault downloads the knowledgebase as an Obsidian-compatible vault zip.
func (*KnowledgebaseAPI) Generate ¶
func (k *KnowledgebaseAPI) Generate(ctx context.Context, opts KbGenerateOptions) (*KbMetadata, error)
Generate triggers (re)generation of the workspace knowledgebase.
func (*KnowledgebaseAPI) Get ¶
func (k *KnowledgebaseAPI) Get(ctx context.Context, opts KbGetOptions) (*KbMetadata, error)
Get returns the latest knowledgebase metadata for a workspace.
func (*KnowledgebaseAPI) GetArticle ¶
func (k *KnowledgebaseAPI) GetArticle(ctx context.Context, articleID, workspaceID string, authority *AuthorityContext) (*KbArticle, error)
GetArticle fetches a single article by ID (e.g. "index", "community-3").
func (*KnowledgebaseAPI) GetCommunity ¶
func (k *KnowledgebaseAPI) GetCommunity(ctx context.Context, communityID int, workspaceID string, authority *AuthorityContext) (*KbCommunity, error)
GetCommunity fetches a single community by ID with its cached label and live members.
func (*KnowledgebaseAPI) GetGraphAnalysis ¶
func (k *KnowledgebaseAPI) GetGraphAnalysis(ctx context.Context, workspaceID, contextID string, authority *AuthorityContext) (*KbGraphAnalysis, error)
GetGraphAnalysis runs a fresh graph analysis on the workspace association graph. Returns (nil, nil) when the server reports no analysis available.
func (*KnowledgebaseAPI) ListArticles ¶
func (k *KnowledgebaseAPI) ListArticles(ctx context.Context, opts KbListArticlesOptions) ([]KbArticle, error)
ListArticles lists knowledgebase articles, optionally filtered by type.
type ListDatasetsOptions ¶
ListDatasetsOptions configures Client.ListDatasets.
type ListDocumentsOptions ¶
type ListDocumentsOptions struct {
Status string
// WorkspaceID selects the workspace to list (defaults to the client's
// configured workspace). The server authz-gates the requested workspace, so a
// caller can only list workspaces it can read.
WorkspaceID string
// DocumentType filters by document type (pdf, markdown, text, html, docx, pptx).
DocumentType string
// CreatedAfter/CreatedBefore filter by created_at (ISO datetime).
CreatedAfter string
CreatedBefore string
Limit int // default 50 when <= 0
Offset int
// Authority applies a per-call OBO authority (overriding the client default).
// Mirrors [RecallOptions.Authority]/[GetMemoryOptions.Authority].
Authority *AuthorityContext
}
ListDocumentsOptions configures Client.ListDocuments.
type ListEntitiesOptions ¶
type ListEntitiesOptions struct {
Status string // "active" (default) or "merged"
Limit int // default 100 when <= 0
WorkspaceID string
Authority *AuthorityContext
}
ListEntitiesOptions configures Client.ListEntities.
type ListMcpServersOptions ¶
type ListMcpServersOptions struct {
Transport string
Enabled *bool
Name string
UserID string
Limit int // default 100 when <= 0
Offset int
WorkspaceID string
Authority *AuthorityContext
}
ListMcpServersOptions configures McpServersAPI.List.
type ListMemoriesOptions ¶
type ListMemoriesOptions struct {
Limit int // default 50 when <= 0
Offset int
Type MemoryType
Subtype string
Tag string
ContextID string
Authority *AuthorityContext
}
ListMemoriesOptions configures Client.ListMemories.
type ListSessionsOptions ¶
ListSessionsOptions configures Client.ListSessions.
type ListSkillsOptions ¶
type ListSkillsOptions struct {
Scope string
Name string
Tags []string
Enabled *bool
IncludeShadowed bool
IncludeAddenda bool
WorkspaceID string
Authority *AuthorityContext
}
ListSkillsOptions configures SkillsAPI.List.
type ListThreadsOptions ¶
type ListThreadsOptions struct {
WorkspaceID string
UserID string
Limit int // default 50 when <= 0
Offset int
ScopeFilter string
OwnershipFilter string
// ParentThread filters to the CHILDREN of the given thread. Empty (the
// default) returns top-level threads only (server treats a missing filter as
// parent_thread IS NULL).
ParentThread string
}
ListThreadsOptions configures Client.ListThreads.
type ListUserThreadsOptions ¶
type ListUserThreadsOptions struct {
Ownership string // default "user"
ScopeFilter string
Limit int // default 50 when <= 0
Offset int
}
ListUserThreadsOptions configures Client.ListUserThreads.
type McpServerModel ¶
type McpServerModel struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
TenantID string `json:"tenant_id"`
UserID *string `json:"user_id,omitempty"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Transport string `json:"transport"`
Command *string `json:"command,omitempty"`
Args []string `json:"args"`
Env map[string]string `json:"env"`
URL *string `json:"url,omitempty"`
Headers map[string]string `json:"headers"`
Metadata map[string]any `json:"metadata"`
SourceMode string `json:"source_mode"`
ManifestHash string `json:"manifest_hash"`
Enabled bool `json:"enabled"`
CreatedAt *string `json:"created_at,omitempty"`
UpdatedAt *string `json:"updated_at,omitempty"`
}
McpServerModel mirrors the server McpServer record.
type McpServersAPI ¶
type McpServersAPI struct {
// contains filtered or unexported fields
}
McpServersAPI is the /v1/mcp-servers namespace, reached via client.McpServers.
func (*McpServersAPI) Create ¶
func (m *McpServersAPI) Create(ctx context.Context, name, transport string, opts CreateMcpServerOptions) (*McpServerModel, error)
Create creates a new MCP server record. transport is one of "stdio", "http", "sse", or "streamable-http".
func (*McpServersAPI) Delete ¶
func (m *McpServersAPI) Delete(ctx context.Context, serverID string, authority *AuthorityContext) error
Delete deletes an MCP server record.
func (*McpServersAPI) Get ¶
func (m *McpServersAPI) Get(ctx context.Context, serverID string, authority *AuthorityContext) (*McpServerModel, error)
Get fetches an MCP server by ID.
func (*McpServersAPI) List ¶
func (m *McpServersAPI) List(ctx context.Context, opts ListMcpServersOptions) ([]McpServerModel, error)
List lists MCP servers with optional filters.
func (*McpServersAPI) PullJSON ¶
func (m *McpServersAPI) PullJSON(ctx context.Context, outPath, workspaceID, userID, transport string, enabled *bool, authority *AuthorityContext) error
PullJSON materializes MCP servers into a .mcp.json file at outPath.
func (*McpServersAPI) PushJSON ¶
func (m *McpServersAPI) PushJSON(ctx context.Context, jsonPath, scope, sourceMode, workspaceID, userID string, authority *AuthorityContext) ([]McpServerModel, error)
PushJSON pushes a .mcp.json file, creating one record per server entry.
func (*McpServersAPI) Resolve ¶
func (m *McpServersAPI) Resolve(ctx context.Context, name, workspaceID string, authority *AuthorityContext) (*McpServerModel, error)
Resolve resolves an MCP server by name using 4-tier precedence; returns (nil, nil) when not found.
func (*McpServersAPI) Update ¶
func (m *McpServersAPI) Update(ctx context.Context, serverID string, opts UpdateMcpServerOptions) (*McpServerModel, error)
Update partially updates an MCP server record.
type Memory ¶
type Memory struct {
ID string `json:"id"`
LogicalKey *string `json:"logical_key,omitempty"`
WorkspaceID string `json:"workspace_id"`
SpaceID *string `json:"space_id,omitempty"`
UserID *string `json:"user_id,omitempty"`
Content string `json:"content"`
Type MemoryType `json:"type"`
Subtype *string `json:"subtype,omitempty"`
Importance float64 `json:"importance"`
Tags []string `json:"tags"`
Metadata map[string]any `json:"metadata"`
RefinementMetadata map[string]any `json:"refinement_metadata"`
AccessCount int `json:"access_count"`
LastAccessedAt *time.Time `json:"last_accessed_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// Additional server fields.
ContentHash *string `json:"content_hash,omitempty"`
ContextID *string `json:"context_id,omitempty"`
TenantID string `json:"tenant_id"`
DecayFactor float64 `json:"decay_factor"`
Pinned bool `json:"pinned"`
Status string `json:"status"`
Abstract *string `json:"abstract,omitempty"`
Overview *string `json:"overview,omitempty"`
SessionID *string `json:"session_id,omitempty"`
SourceMemoryID *string `json:"source_memory_id,omitempty"`
ObserverID *string `json:"observer_id,omitempty"`
SubjectID *string `json:"subject_id,omitempty"`
RelevanceScore *float64 `json:"relevance_score,omitempty"`
BoostedScore *float64 `json:"boosted_score,omitempty"`
SourceScope *string `json:"source_scope,omitempty"`
Embedding []float64 `json:"embedding,omitempty"`
ArchivedAt *time.Time `json:"archived_at,omitempty"`
Revision int `json:"revision"`
ETag string `json:"etag"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Relations []map[string]any `json:"relations,omitempty"`
RelationWriteResult *EntityRelationWriteResult `json:"relation_write_result,omitempty"`
}
Memory is a stored memory entry.
type MemoryHistoryOptions ¶
type MemoryHistoryOptions struct {
WorkspaceID string
Limit int
PageToken string
Authority *AuthorityContext
}
MemoryHistoryOptions configures immutable semantic history traversal.
type MemoryMutationOptions ¶
type MemoryMutationOptions struct {
WorkspaceID string
IdempotencyKey string
ETag string
Authority *AuthorityContext
}
MemoryMutationOptions carries required idempotency, CAS, workspace, and delegated-authority metadata.
type MemoryMutationResult ¶
type MemoryRevision ¶
type MemoryRevisionPage ¶
type MemoryRevisionPage struct {
Revisions []MemoryRevision `json:"revisions"`
NextPageToken string `json:"next_page_token"`
}
type MemorySubtype ¶
type MemorySubtype string
MemorySubtype is a domain subtype — what a memory is about.
const ( MemorySubtypeSolution MemorySubtype = "solution" MemorySubtypeProblem MemorySubtype = "problem" MemorySubtypeCodePattern MemorySubtype = "code_pattern" MemorySubtypeFix MemorySubtype = "fix" MemorySubtypeError MemorySubtype = "error" MemorySubtypeWorkflow MemorySubtype = "workflow" MemorySubtypePreference MemorySubtype = "preference" MemorySubtypeDecision MemorySubtype = "decision" MemorySubtypeDirective MemorySubtype = "directive" MemorySubtypeProfile MemorySubtype = "profile" MemorySubtypeEntity MemorySubtype = "entity" MemorySubtypeEvent MemorySubtype = "event" MemorySubtypeInference MemorySubtype = "inference" )
type MemoryType ¶
type MemoryType string
MemoryType is a cognitive memory type — how a memory is structured.
const ( MemoryTypeEpisodic MemoryType = "episodic" // Specific events/interactions MemoryTypeSemantic MemoryType = "semantic" // Facts, concepts, relationships MemoryTypeProcedural MemoryType = "procedural" // How to do things MemoryTypeWorking MemoryType = "working" // Current task context )
type MessageContent ¶
type MessageContent struct {
// Text is set when the message content is a plain string.
Text string
// Blocks is set when the message content is a list of content blocks.
Blocks []ChatMessageContent
}
MessageContent holds a chat message's body, which the server returns as either a plain string or a list of structured content blocks.
func (MessageContent) IsText ¶
func (m MessageContent) IsText() bool
IsText reports whether the content is a plain string (no structured blocks).
func (MessageContent) MarshalJSON ¶
func (m MessageContent) MarshalJSON() ([]byte, error)
MarshalJSON emits a string when only Text is set, otherwise the block list.
func (*MessageContent) UnmarshalJSON ¶
func (m *MessageContent) UnmarshalJSON(b []byte) error
UnmarshalJSON accepts both a JSON string and a JSON array of content blocks.
type NotFoundError ¶
type NotFoundError struct{ *APIError }
NotFoundError is returned for HTTP 404 responses.
type OBOKbAPI ¶
type OBOKbAPI struct {
// contains filtered or unexported fields
}
OBOKbAPI is a KnowledgebaseAPI view bound to an OBO authority + workspace.
func (*OBOKbAPI) ExportVault ¶
func (k *OBOKbAPI) ExportVault(ctx context.Context, workspaceID string, authority *AuthorityContext) ([]byte, error)
ExportVault downloads the vault zip under the bound authority + workspace.
func (*OBOKbAPI) Generate ¶
func (k *OBOKbAPI) Generate(ctx context.Context, opts KbGenerateOptions) (*KbMetadata, error)
Generate triggers knowledgebase (re)generation under the bound authority + workspace.
func (*OBOKbAPI) Get ¶
func (k *OBOKbAPI) Get(ctx context.Context, opts KbGetOptions) (*KbMetadata, error)
Get returns knowledgebase metadata under the bound authority + workspace.
func (*OBOKbAPI) GetArticle ¶
func (k *OBOKbAPI) GetArticle(ctx context.Context, articleID, workspaceID string, authority *AuthorityContext) (*KbArticle, error)
GetArticle fetches a single article under the bound authority + workspace.
func (*OBOKbAPI) GetCommunity ¶
func (k *OBOKbAPI) GetCommunity(ctx context.Context, communityID int, workspaceID string, authority *AuthorityContext) (*KbCommunity, error)
GetCommunity fetches a community under the bound authority + workspace.
func (*OBOKbAPI) GetGraphAnalysis ¶
func (k *OBOKbAPI) GetGraphAnalysis(ctx context.Context, workspaceID, contextID string, authority *AuthorityContext) (*KbGraphAnalysis, error)
GetGraphAnalysis runs a graph analysis under the bound authority + workspace.
func (*OBOKbAPI) ListArticles ¶
func (k *OBOKbAPI) ListArticles(ctx context.Context, opts KbListArticlesOptions) ([]KbArticle, error)
ListArticles lists articles under the bound authority + workspace.
type OBOMcpServersAPI ¶
type OBOMcpServersAPI struct {
// contains filtered or unexported fields
}
OBOMcpServersAPI is a McpServersAPI view bound to an OBO authority + workspace.
func (*OBOMcpServersAPI) Create ¶
func (m *OBOMcpServersAPI) Create(ctx context.Context, name, transport string, opts CreateMcpServerOptions) (*McpServerModel, error)
Create creates an MCP server record under the bound authority + workspace.
func (*OBOMcpServersAPI) Delete ¶
func (m *OBOMcpServersAPI) Delete(ctx context.Context, serverID string, authority *AuthorityContext) error
Delete deletes an MCP server record under the bound authority.
func (*OBOMcpServersAPI) Get ¶
func (m *OBOMcpServersAPI) Get(ctx context.Context, serverID string, authority *AuthorityContext) (*McpServerModel, error)
Get fetches an MCP server by ID under the bound authority.
func (*OBOMcpServersAPI) List ¶
func (m *OBOMcpServersAPI) List(ctx context.Context, opts ListMcpServersOptions) ([]McpServerModel, error)
List lists MCP servers under the bound authority + workspace.
func (*OBOMcpServersAPI) Resolve ¶
func (m *OBOMcpServersAPI) Resolve(ctx context.Context, name, workspaceID string, authority *AuthorityContext) (*McpServerModel, error)
Resolve resolves an MCP server by name under the bound authority + workspace.
func (*OBOMcpServersAPI) Update ¶
func (m *OBOMcpServersAPI) Update(ctx context.Context, serverID string, opts UpdateMcpServerOptions) (*McpServerModel, error)
Update partially updates an MCP server record under the bound authority.
type OBOProxy ¶
type OBOProxy struct {
// contains filtered or unexported fields
}
OBOProxy is a lightweight view over a Client that injects a fixed OBO authority and/or default workspace ID into every call, without mutating the shared client. Obtain one with Client.ActingFor or Client.ForWorkspace.
It mirrors the most common operations; for the full surface use the parent Client directly with per-call Authority/WorkspaceID options.
func (*OBOProxy) ActingFor ¶
func (p *OBOProxy) ActingFor(grantID string, subject *PrincipalRef) *OBOProxy
ActingFor returns a new proxy with a different authority (workspace inherited).
func (*OBOProxy) AppendMessages ¶
func (p *OBOProxy) AppendMessages(ctx context.Context, threadID string, messages []map[string]any, opts AppendMessagesOptions) ([]ChatMessage, error)
AppendMessages appends messages under the proxy's authority + workspace.
func (*OBOProxy) DeleteMessage ¶
func (p *OBOProxy) DeleteMessage(ctx context.Context, threadID, messageID string, opts DeleteMessageOptions) (bool, error)
DeleteMessage deletes a message under the proxy's authority + workspace.
func (*OBOProxy) ForWorkspace ¶
ForWorkspace returns a new proxy with a different workspace (authority inherited).
func (*OBOProxy) Kb ¶
Kb returns the Knowledgebase namespace bound to this proxy's authority + workspace.
func (*OBOProxy) McpServers ¶
func (p *OBOProxy) McpServers() *OBOMcpServersAPI
McpServers returns the McpServers namespace bound to this proxy's authority + workspace.
func (*OBOProxy) Recall ¶
func (p *OBOProxy) Recall(ctx context.Context, query string, opts RecallOptions) (*RecallResult, error)
Recall searches memories under the proxy's authority + workspace.
func (*OBOProxy) Reflect ¶
func (p *OBOProxy) Reflect(ctx context.Context, query string, opts ReflectOptions) (*ReflectResult, error)
Reflect synthesizes memories under the proxy's authority.
func (*OBOProxy) Remember ¶
func (p *OBOProxy) Remember(ctx context.Context, content string, opts RememberOptions) (*Memory, error)
Remember stores a memory under the proxy's authority + workspace.
func (*OBOProxy) Skills ¶
func (p *OBOProxy) Skills() *OBOSkillsAPI
Skills returns the Skills namespace bound to this proxy's authority + workspace.
type OBOSkillsAPI ¶
type OBOSkillsAPI struct {
// contains filtered or unexported fields
}
OBOSkillsAPI is a SkillsAPI view bound to an OBO authority + workspace.
func (*OBOSkillsAPI) Delete ¶
func (s *OBOSkillsAPI) Delete(ctx context.Context, skillID string, authority *AuthorityContext) error
Delete deletes a skill under the bound authority.
func (*OBOSkillsAPI) Get ¶
func (s *OBOSkillsAPI) Get(ctx context.Context, skillID string, authority *AuthorityContext) (*SkillModel, error)
Get fetches a skill by ID under the bound authority.
func (*OBOSkillsAPI) GetManifest ¶
GetManifest returns the rendered SKILL.md text under the bound authority.
func (*OBOSkillsAPI) GetManifestWithOptions ¶
func (s *OBOSkillsAPI) GetManifestWithOptions(ctx context.Context, skillID string, opts GetSkillManifestOptions) (string, error)
GetManifestWithOptions returns the rendered SKILL.md text under the bound authority + workspace.
func (*OBOSkillsAPI) List ¶
func (s *OBOSkillsAPI) List(ctx context.Context, opts ListSkillsOptions) ([]SkillModel, error)
List lists visible skills under the bound authority + workspace.
func (*OBOSkillsAPI) ListFiles ¶
func (s *OBOSkillsAPI) ListFiles(ctx context.Context, skillID string, authority *AuthorityContext) ([]map[string]any, error)
ListFiles lists a skill's bundle files under the bound authority.
func (*OBOSkillsAPI) Resolve ¶
func (s *OBOSkillsAPI) Resolve(ctx context.Context, name, query, workspaceID string, authority *AuthorityContext) (*SkillResolution, error)
Resolve resolves a skill by name or query under the bound authority + workspace.
func (*OBOSkillsAPI) ResolveWithOptions ¶
func (s *OBOSkillsAPI) ResolveWithOptions(ctx context.Context, opts ResolveSkillOptions) (*SkillResolution, error)
ResolveWithOptions resolves a skill by name or query under the bound authority + workspace.
func (*OBOSkillsAPI) Save ¶
func (s *OBOSkillsAPI) Save(ctx context.Context, name, description string, opts SaveSkillOptions) (*SkillModel, error)
Save creates or updates a skill under the bound authority + workspace.
type OpenThread ¶
type OpenThread struct {
Topic string `json:"topic"`
Status string `json:"status"`
LastActivity time.Time `json:"last_activity"`
KeyMemories []string `json:"key_memories"`
}
OpenThread is an open topic/thread of work surfaced in a briefing.
type Option ¶
type Option func(*clientConfig)
Option configures a Client in NewClient.
func WithAPIKey ¶
WithAPIKey sets the bearer token sent as the Authorization header.
func WithBaseURL ¶
WithBaseURL sets the API base URL (default DefaultBaseURL). Used only by the default HTTP transport; ignored when a custom transport is supplied.
func WithDefaultAuthority ¶
func WithDefaultAuthority(a *AuthorityContext) Option
WithDefaultAuthority sets the OBO authority applied to every request that does not override it.
func WithHTTPClient ¶
WithHTTPClient supplies a custom *http.Client for the default HTTP transport (e.g. to configure TLS, proxies, or a shared connection pool).
func WithMaxRetries ¶
WithMaxRetries sets the maximum retry attempts for idempotent requests on transient failures (default 3; 0 disables). HTTP transport only.
func WithSessionID ¶
WithSessionID sets the initial session ID (sent as the X-Session-ID header).
func WithTimeout ¶
WithTimeout sets the per-request timeout for the default HTTP transport (default 30s). Ignored when WithHTTPClient or WithTransport is supplied.
func WithTransport ¶
WithTransport supplies a custom Transport, replacing the default HTTP transport. This is how the Aether transport (companion module) is installed.
func WithWorkspaceID ¶
WithWorkspaceID sets the default workspace ID applied to operations that take one.
type PageSearchResult ¶
type PageSearchResult struct {
Pages []DocumentPage `json:"pages"`
TotalCount int `json:"total_count"`
Query string `json:"query"`
}
PageSearchResult is the result of a document page search (Enterprise).
type PreconditionFailedError ¶
type PreconditionFailedError struct{ *APIError }
PreconditionFailedError is returned for HTTP 412 stale/mismatched ETags.
type PreconditionRequiredError ¶
type PreconditionRequiredError struct{ *APIError }
PreconditionRequiredError is returned for HTTP 428 responses when a required idempotency or conditional request header is absent.
type PrincipalRef ¶
PrincipalRef is a reference to a principal (user, service, agent, task).
type PromptNote ¶
type PromptNote struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
WorkspaceID string `json:"workspace_id"`
Key string `json:"key"`
Title string `json:"title"`
Content string `json:"content"`
Enabled bool `json:"enabled"`
SchemaVersion int `json:"schema_version"`
Metadata map[string]any `json:"metadata"`
Revision int `json:"revision"`
ETag string `json:"etag"`
CreatedBy *string `json:"created_by,omitempty"`
UpdatedBy *string `json:"updated_by,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
DeletedAt *string `json:"deleted_at,omitempty"`
}
PromptNote is a typed, revisioned prompt supplement stored by MemoryLayer.
type PromptNoteCreateInput ¶
type PromptNoteCreateInput struct {
Key string `json:"key"`
Title string `json:"title"`
Content string `json:"content"`
Enabled *bool `json:"enabled,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
PromptNoteCreateInput is the typed content accepted by PromptNotesAPI.Create.
type PromptNoteGetOptions ¶
type PromptNoteGetOptions struct {
WorkspaceID string
IncludeDeleted bool
Authority *AuthorityContext
}
PromptNoteGetOptions configures PromptNotesAPI.Get.
type PromptNoteHistoryOptions ¶
type PromptNoteHistoryOptions struct {
WorkspaceID string
Limit int
PageToken string
Authority *AuthorityContext
}
PromptNoteHistoryOptions configures PromptNotesAPI.History.
type PromptNoteListOptions ¶
type PromptNoteListOptions struct {
WorkspaceID string
Limit int
PageToken string
IncludeDeleted bool
Authority *AuthorityContext
}
PromptNoteListOptions configures PromptNotesAPI.List.
type PromptNoteMutationOptions ¶
type PromptNoteMutationOptions struct {
WorkspaceID string
IdempotencyKey string
ETag string
Authority *AuthorityContext
}
PromptNoteMutationOptions carries conditional-write and authority metadata. ETag is required for Replace, Delete, and Restore. Create always sends If-None-Match: *.
type PromptNoteMutationResult ¶
type PromptNoteMutationResult struct {
Note PromptNote
Replayed bool
ETag string
}
PromptNoteMutationResult includes idempotent-replay status and response ETag.
type PromptNotePage ¶
type PromptNotePage struct {
Notes []PromptNote `json:"notes"`
NextPageToken string `json:"next_page_token"`
}
PromptNotePage is one stable-cursor page of current prompt-note heads.
type PromptNoteReplaceInput ¶
type PromptNoteReplaceInput struct {
Title string `json:"title"`
Content string `json:"content"`
Enabled *bool `json:"enabled,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
PromptNoteReplaceInput is a complete semantic replacement. The stable key is intentionally absent because it is immutable.
type PromptNoteRevision ¶
type PromptNoteRevision struct {
Note PromptNote `json:"note"`
Action string `json:"action"`
OperationID string `json:"operation_id"`
}
PromptNoteRevision is one immutable prompt-note snapshot.
type PromptNoteRevisionPage ¶
type PromptNoteRevisionPage struct {
Revisions []PromptNoteRevision `json:"revisions"`
NextPageToken string `json:"next_page_token"`
}
PromptNoteRevisionPage is one stable-cursor history page.
type PromptNotesAPI ¶
type PromptNotesAPI struct {
// contains filtered or unexported fields
}
PromptNotesAPI is the typed /v1/prompt-notes namespace.
func (*PromptNotesAPI) Create ¶
func (p *PromptNotesAPI) Create(ctx context.Context, input PromptNoteCreateInput, opts PromptNoteMutationOptions) (*PromptNoteMutationResult, error)
Create stores a new prompt note. IdempotencyKey must be stable across retries.
func (*PromptNotesAPI) Delete ¶
func (p *PromptNotesAPI) Delete(ctx context.Context, noteID string, opts PromptNoteMutationOptions) (*PromptNoteMutationResult, error)
Delete writes a durable tombstone when opts.ETag matches the current head.
func (*PromptNotesAPI) Get ¶
func (p *PromptNotesAPI) Get(ctx context.Context, noteID string, opts PromptNoteGetOptions) (*PromptNote, error)
Get fetches one active note, or a tombstone when IncludeDeleted is true.
func (*PromptNotesAPI) History ¶
func (p *PromptNotesAPI) History(ctx context.Context, noteID string, opts PromptNoteHistoryOptions) (*PromptNoteRevisionPage, error)
History returns immutable revisions in descending mutation-sequence order.
func (*PromptNotesAPI) List ¶
func (p *PromptNotesAPI) List(ctx context.Context, opts PromptNoteListOptions) (*PromptNotePage, error)
List returns current heads in descending mutation-sequence order.
func (*PromptNotesAPI) Replace ¶
func (p *PromptNotesAPI) Replace(ctx context.Context, noteID string, input PromptNoteReplaceInput, opts PromptNoteMutationOptions) (*PromptNoteMutationResult, error)
Replace atomically replaces a prompt note when opts.ETag matches its head.
func (*PromptNotesAPI) Restore ¶
func (p *PromptNotesAPI) Restore(ctx context.Context, noteID string, opts PromptNoteMutationOptions) (*PromptNoteMutationResult, error)
Restore reactivates a tombstone when opts.ETag matches the deleted head. Its stable ID, key, content, metadata, and creation provenance are preserved.
type QueryDatasetSliceOptions ¶
type QueryDatasetSliceOptions struct {
SQL string
Columns []string
Filters []map[string]any
OrderBy string
Descending bool
Limit int // default 100 when <= 0
Offset int
}
QueryDatasetSliceOptions configures Client.QueryDatasetSlice.
type RateLimitError ¶
type RateLimitError struct{ *APIError }
RateLimitError is returned for HTTP 429 responses.
type RecallMode ¶
type RecallMode string
RecallMode is the retrieval strategy for recall queries.
const ( RecallModeRAG RecallMode = "rag" // Fast vector similarity search RecallModeLLM RecallMode = "llm" // Deep semantic LLM-powered retrieval RecallModeHybrid RecallMode = "hybrid" // Combine both strategies )
type RecallOptions ¶
type RecallOptions struct {
Types []MemoryType
Subtypes []string
Tags []string
Mode RecallMode
Limit int // default 10 when <= 0
MinRelevance *float64
RecencyWeight *float64
Tolerance SearchTolerance
IncludeAssociations *bool
TraverseDepth *int
MaxExpansion *int
CreatedAfter string
CreatedBefore string
Offset *int
EventAfter string
EventBefore string
TimeOrder string
IncludeGlobal *bool
IncludeGlobalUser *bool
UserID string
WorkspaceID string
Authority *AuthorityContext
BudgetTokens *int
IncludeConfidence *bool
IncludeRelations *bool
}
RecallOptions configures Client.Recall. Pointer fields left nil are omitted so the server applies its own default.
type RecallResult ¶
type RecallResult struct {
Memories []Memory `json:"memories"`
TotalCount int `json:"total_count"`
QueryTokens *int `json:"query_tokens,omitempty"`
SearchLatencyMs *int `json:"search_latency_ms,omitempty"`
RetrievalConfidence string `json:"retrieval_confidence,omitempty"`
ConfidenceReasons []string `json:"confidence_reasons,omitempty"`
BudgetSummary *BudgetSummary `json:"budget_summary,omitempty"`
GenerationSummary *GenerationSummary `json:"generation_summary,omitempty"`
RelationPaths []EntityRelationPath `json:"relation_paths,omitempty"`
}
RecallResult is the result of a recall (search) or list query.
type RefinementEdit ¶
type RefinementEdit struct {
Action string `json:"action"`
ResourceKind string `json:"resource_kind"`
ResourceKey string `json:"resource_key"`
ResourceID *string `json:"resource_id,omitempty"`
ExpectedETag *string `json:"expected_etag,omitempty"`
BeforeETag *string `json:"before_etag,omitempty"`
AfterETag *string `json:"after_etag,omitempty"`
Reason string `json:"reason"`
Content map[string]any `json:"content,omitempty"`
Before *RefinementResourceSnapshot `json:"before,omitempty"`
After *RefinementResourceSnapshot `json:"after,omitempty"`
Applied *bool `json:"applied,omitempty"`
Error *string `json:"error,omitempty"`
}
type RefinementEvidence ¶
type RefinementRecord ¶
type RefinementRecord struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
WorkspaceID string `json:"workspace_id"`
Key string `json:"key"`
RefinementID string `json:"refinement_id"`
Phase string `json:"phase"`
Trigger string `json:"trigger"`
Scope string `json:"scope"`
Summary string `json:"summary"`
Rationale string `json:"rationale"`
ExpectedOutcome string `json:"expected_outcome"`
Evidence []RefinementEvidence `json:"evidence"`
Edits []RefinementEdit `json:"edits"`
Outcome string `json:"outcome"`
ParentRecordID *string `json:"parent_record_id,omitempty"`
RollbackOfRecordID *string `json:"rollback_of_record_id,omitempty"`
TaskRef *RefinementExternalReference `json:"task_ref,omitempty"`
ApprovalRef *RefinementExternalReference `json:"approval_ref,omitempty"`
SchemaVersion int `json:"schema_version"`
Metadata map[string]any `json:"metadata"`
Revision int `json:"revision"`
ETag string `json:"etag"`
CreatedBy *string `json:"created_by,omitempty"`
CreatedAt string `json:"created_at"`
}
RefinementRecord is one immutable proposal, decision, application, or rollback audit record.
type RefinementRecordCreateInput ¶
type RefinementRecordCreateInput struct {
Key string `json:"key"`
RefinementID string `json:"refinement_id"`
Phase string `json:"phase"`
Trigger string `json:"trigger"`
Scope string `json:"scope"`
Summary string `json:"summary"`
Rationale string `json:"rationale"`
ExpectedOutcome string `json:"expected_outcome"`
Evidence []RefinementEvidence `json:"evidence"`
Edits []RefinementEdit `json:"edits,omitempty"`
Outcome string `json:"outcome"`
ParentRecordID *string `json:"parent_record_id,omitempty"`
RollbackOfRecordID *string `json:"rollback_of_record_id,omitempty"`
TaskRef *RefinementExternalReference `json:"task_ref,omitempty"`
ApprovalRef *RefinementExternalReference `json:"approval_ref,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
type RefinementRecordCreateOptions ¶
type RefinementRecordCreateOptions struct {
WorkspaceID string
IdempotencyKey string
Authority *AuthorityContext
}
type RefinementRecordGetOptions ¶
type RefinementRecordGetOptions struct {
WorkspaceID string
Authority *AuthorityContext
}
type RefinementRecordMutationResult ¶
type RefinementRecordMutationResult struct {
Record RefinementRecord
Replayed bool
ETag string
}
type RefinementRecordPage ¶
type RefinementRecordPage struct {
Records []RefinementRecord `json:"records"`
NextPageToken string `json:"next_page_token"`
ScannedCount int `json:"scanned_count"`
ScanTruncated bool `json:"scan_truncated"`
}
type RefinementRecordsAPI ¶
type RefinementRecordsAPI struct {
// contains filtered or unexported fields
}
RefinementRecordsAPI is the append-only typed /v1/refinement-records namespace.
func (*RefinementRecordsAPI) Create ¶
func (r *RefinementRecordsAPI) Create(ctx context.Context, input RefinementRecordCreateInput, opts RefinementRecordCreateOptions) (*RefinementRecordMutationResult, error)
func (*RefinementRecordsAPI) Get ¶
func (r *RefinementRecordsAPI) Get(ctx context.Context, recordID string, opts RefinementRecordGetOptions) (*RefinementRecord, error)
func (*RefinementRecordsAPI) List ¶
func (r *RefinementRecordsAPI) List(ctx context.Context, opts RefinementRecordListOptions) (*RefinementRecordPage, error)
type RefinementResourceSnapshot ¶
type RefinementResourceSnapshot struct {
ResourceID *string `json:"resource_id,omitempty"`
ResourceKey string `json:"resource_key"`
ETag *string `json:"etag,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
Content map[string]any `json:"content,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Deleted bool `json:"deleted,omitempty"`
}
type ReflectOptions ¶
type ReflectOptions struct {
MaxTokens int // default 500 when <= 0
IncludeSources *bool // default true
Authority *AuthorityContext
}
ReflectOptions configures Client.Reflect.
type ReflectResult ¶
type ReflectResult struct {
Reflection string `json:"reflection"`
SourceMemories []string `json:"source_memories"`
Confidence float64 `json:"confidence"`
TokensProcessed *int `json:"tokens_processed,omitempty"`
}
ReflectResult is the result of a reflect (synthesis) query.
type RelationshipCategory ¶
type RelationshipCategory string
RelationshipCategory is a high-level relationship category from the server's unified ontology.
const ( RelationshipCategoryHierarchical RelationshipCategory = "hierarchical" RelationshipCategoryCausal RelationshipCategory = "causal" RelationshipCategoryTemporal RelationshipCategory = "temporal" RelationshipCategorySimilarity RelationshipCategory = "similarity" RelationshipCategoryLearning RelationshipCategory = "learning" RelationshipCategoryReference RelationshipCategory = "reference" RelationshipCategorySolution RelationshipCategory = "solution" RelationshipCategoryContext RelationshipCategory = "context" RelationshipCategoryWorkflow RelationshipCategory = "workflow" RelationshipCategoryQuality RelationshipCategory = "quality" )
type RelationshipType ¶
type RelationshipType string
RelationshipType is a specific relationship type between memories (snake_case, matching the server's ontology strings).
const ( // Causal RelationshipCauses RelationshipType = "causes" RelationshipTriggers RelationshipType = "triggers" RelationshipLeadsTo RelationshipType = "leads_to" RelationshipPrevents RelationshipType = "prevents" // Solution RelationshipSolves RelationshipType = "solves" RelationshipAddresses RelationshipType = "addresses" RelationshipAlternativeTo RelationshipType = "alternative_to" RelationshipImproves RelationshipType = "improves" // Context RelationshipOccursIn RelationshipType = "occurs_in" RelationshipAppliesTo RelationshipType = "applies_to" RelationshipWorksWith RelationshipType = "works_with" RelationshipRequires RelationshipType = "requires" // Learning RelationshipBuildsOn RelationshipType = "builds_on" RelationshipContradicts RelationshipType = "contradicts" RelationshipConfirms RelationshipType = "confirms" RelationshipSupersedes RelationshipType = "supersedes" // Similarity RelationshipSimilarTo RelationshipType = "similar_to" RelationshipVariantOf RelationshipType = "variant_of" RelationshipRelatedTo RelationshipType = "related_to" // Workflow RelationshipFollows RelationshipType = "follows" RelationshipDependsOn RelationshipType = "depends_on" RelationshipEnables RelationshipType = "enables" RelationshipBlocks RelationshipType = "blocks" // Quality RelationshipEffectiveFor RelationshipType = "effective_for" RelationshipPreferredOver RelationshipType = "preferred_over" RelationshipDeprecatedBy RelationshipType = "deprecated_by" )
type RememberOptions ¶
type RememberOptions struct {
Type MemoryType
Subtype string
Importance float64 // 0.0-1.0; default 0.5 when zero
Tags []string
Metadata map[string]any
ContextID string
UserID string
WorkspaceID string
Authority *AuthorityContext
Relations []EntityRelationInput
// contains filtered or unexported fields
}
RememberOptions configures Client.Remember. The zero value is valid: only non-empty/non-nil fields are sent, letting the server apply its defaults.
func (RememberOptions) WithImportance ¶
func (o RememberOptions) WithImportance(v float64) RememberOptions
WithImportance returns a copy of opts with Importance explicitly set (so a value of 0 is honored rather than defaulted to 0.5).
type ReprocessDocumentOptions ¶
type ReprocessDocumentOptions struct {
TargetContextID string
ChunkingStrategy string
ChunkSize *int
ChunkOverlap *int
Importance *float64
}
ReprocessDocumentOptions configures Client.ReprocessDocument. Nil/zero fields are omitted (server keeps the original extraction options).
type Request ¶
Request is a single MemoryLayer API request as seen by a Transport. Path is relative to the API version root (e.g. "/memories", without the "/v1" prefix); transports are responsible for mounting it under "/v1". Body is the already-encoded payload (JSON or multipart); Header carries the content-type, auth, session, and X-Aether-* OBO headers the Client assembled.
type ResolveSkillOptions ¶
type ResolveSkillOptions struct {
Name string
Query string
ScopeHint string
WorkspaceID string
IncludeAddenda bool
Authority *AuthorityContext
}
ResolveSkillOptions configures SkillsAPI.ResolveWithOptions.
type Response ¶
Response is the subset of an HTTP response the Client's request layer relies on. Body is fully buffered.
type RpgAPI ¶
type RpgAPI struct {
// contains filtered or unexported fields
}
RpgAPI is the /v1/rpg namespace, reached through client.Rpg.
func (*RpgAPI) DeleteEdges ¶
func (r *RpgAPI) DeleteEdges(ctx context.Context, associationIDs []string, authority *AuthorityContext) (*RpgDeleteResult, error)
DeleteEdges deletes associations by ID.
func (*RpgAPI) DeleteNodes ¶
func (r *RpgAPI) DeleteNodes(ctx context.Context, nodeIDs []string, contextID string, authority *AuthorityContext) (*RpgDeleteResult, error)
DeleteNodes deletes nodes by RPG node ID.
func (*RpgAPI) DeleteOverlay ¶
func (r *RpgAPI) DeleteOverlay(ctx context.Context, contextID string, authority *AuthorityContext) (*RpgOverlayDeleteResult, error)
DeleteOverlay deletes all nodes in an overlay.
func (*RpgAPI) Enrich ¶
func (r *RpgAPI) Enrich(ctx context.Context, opts RpgEnrichOptions) (*RpgEnrichmentResult, error)
Enrich runs or schedules RPG semantic enrichment.
func (*RpgAPI) GetConflicts ¶
func (r *RpgAPI) GetConflicts(ctx context.Context, taskID string, authority *AuthorityContext) (*RpgConflictResult, error)
GetConflicts detects file-level conflicts for a task.
func (*RpgAPI) GetMergedSubgraph ¶
func (r *RpgAPI) GetMergedSubgraph(ctx context.Context, overlayContext, baseContext, path string, depth int, authority *AuthorityContext) (*RpgSubgraph, error)
GetMergedSubgraph combines the canonical graph with one overlay.
func (*RpgAPI) GetStatus ¶
func (r *RpgAPI) GetStatus(ctx context.Context, contextID string, authority *AuthorityContext) (*RpgStatus, error)
GetStatus returns RPG encoding status. Empty contextID aggregates contexts.
func (*RpgAPI) GetSubgraph ¶
func (r *RpgAPI) GetSubgraph(ctx context.Context, opts RpgSubgraphOptions) (*RpgSubgraph, error)
GetSubgraph returns nodes and edges rooted at a path or node ID.
func (*RpgAPI) GetSymbolConflicts ¶
func (r *RpgAPI) GetSymbolConflicts(ctx context.Context, taskIDA, taskIDB string, authority *AuthorityContext) (*RpgSymbolConflictResult, error)
GetSymbolConflicts detects symbol-level conflicts between two tasks.
func (*RpgAPI) ListNodes ¶
func (r *RpgAPI) ListNodes(ctx context.Context, opts RpgListNodesOptions) (*RpgNodeList, error)
ListNodes enumerates RPG nodes, optionally by type.
func (*RpgAPI) ListOverlays ¶
func (r *RpgAPI) ListOverlays(ctx context.Context, authority *AuthorityContext) (*RpgOverlayList, error)
ListOverlays lists active RPG overlays.
func (*RpgAPI) Maintenance ¶
func (r *RpgAPI) Maintenance(ctx context.Context, operation RpgMaintenanceOperation, authority *AuthorityContext) (*RpgMaintenanceResult, error)
Maintenance runs validate, cleanup, statistics, cleanup_intents, or recompute_counts.
func (*RpgAPI) Search ¶
func (r *RpgAPI) Search(ctx context.Context, query string, opts RpgSearchOptions) (*RpgSearchResult, error)
Search finds RPG nodes by text.
func (*RpgAPI) Sync ¶
func (r *RpgAPI) Sync(ctx context.Context, nodes []RpgNodeInput, edges []RpgEdgeInput, opts RpgSyncOptions) (*RpgSyncResult, error)
Sync upserts a repository graph snapshot.
type RpgConflict ¶
type RpgConflict struct {
FilePath string `json:"file_path"`
TaskIDs []string `json:"task_ids"`
Severity string `json:"severity"`
}
RpgConflict describes one file-level conflict.
type RpgConflictResult ¶
type RpgConflictResult struct {
TaskID string `json:"task_id"`
Conflicts []RpgConflict `json:"conflicts"`
TotalConflicts int `json:"total_conflicts"`
}
RpgConflictResult contains conflicts for a task.
type RpgDeleteResult ¶
RpgDeleteResult reports bulk deletion counts.
type RpgEdge ¶
type RpgEdge struct {
SourceID string `json:"source_id"`
TargetID string `json:"target_id"`
Relationship string `json:"relationship"`
Strength float64 `json:"strength"`
Metadata map[string]any `json:"metadata"`
AssociationID *string `json:"association_id,omitempty"`
}
RpgEdge is an edge returned by the RPG API.
type RpgEdgeInput ¶
type RpgEdgeInput struct {
SourceID string `json:"source_id"`
TargetID string `json:"target_id"`
Relationship string `json:"relationship"`
// Strength is optional so nil uses the server default (1.0) while Ptr(0.0)
// preserves an explicit zero-strength edge.
Strength *float64 `json:"strength,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
RpgEdgeInput is a repository relationship accepted by RpgAPI.Sync.
type RpgEnrichOptions ¶
type RpgEnrichOptions struct {
ContextID string
Phases []string
Async *bool
Authority *AuthorityContext
}
RpgEnrichOptions configures RpgAPI.Enrich. Async defaults to true when nil.
type RpgEnrichmentResult ¶
type RpgEnrichmentResult struct {
WorkspaceID string `json:"workspace_id"`
ContextID string `json:"context_id"`
AsyncMode bool `json:"async_mode"`
TaskID *string `json:"task_id,omitempty"`
Stats map[string]any `json:"stats,omitempty"`
}
RpgEnrichmentResult reports a synchronous or scheduled enrichment.
type RpgListNodesOptions ¶
type RpgListNodesOptions struct {
NodeType string
ContextID string
Limit int
Authority *AuthorityContext
}
RpgListNodesOptions configures RpgAPI.ListNodes.
type RpgMaintenanceOperation ¶
type RpgMaintenanceOperation string
RpgMaintenanceOperation names a supported graph maintenance operation.
const ( RpgMaintenanceValidate RpgMaintenanceOperation = "validate" RpgMaintenanceCleanup RpgMaintenanceOperation = "cleanup" RpgMaintenanceStatistics RpgMaintenanceOperation = "statistics" RpgMaintenanceCleanupIntents RpgMaintenanceOperation = "cleanup_intents" RpgMaintenanceRecomputeCounts RpgMaintenanceOperation = "recompute_counts" )
type RpgMaintenanceResult ¶
type RpgMaintenanceResult struct {
Operation string `json:"operation"`
WorkspaceID string `json:"workspace_id"`
Result map[string]any `json:"result"`
}
RpgMaintenanceResult is returned by a graph maintenance operation.
type RpgNode ¶
type RpgNode struct {
NodeID string `json:"node_id"`
NodeType string `json:"node_type"`
Path string `json:"path"`
Name string `json:"name"`
Description string `json:"description"`
Language *string `json:"language,omitempty"`
ParentID *string `json:"parent_id,omitempty"`
Depth int `json:"depth"`
Metadata map[string]any `json:"metadata"`
MemoryID *string `json:"memory_id,omitempty"`
ContextID *string `json:"context_id,omitempty"`
}
RpgNode is a node returned by the RPG API.
type RpgNodeInput ¶
type RpgNodeInput struct {
NodeID string `json:"node_id"`
NodeType string `json:"node_type"`
Path string `json:"path"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Language *string `json:"language,omitempty"`
ParentID *string `json:"parent_id,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
RpgNodeInput is a repository node accepted by RpgAPI.Sync.
type RpgNodeList ¶
RpgNodeList is a typed node-list response.
type RpgOverlay ¶
RpgOverlay describes an overlay context.
type RpgOverlayDeleteResult ¶
type RpgOverlayDeleteResult struct {
ContextID string `json:"context_id"`
Deleted int `json:"deleted"`
}
RpgOverlayDeleteResult reports an overlay deletion.
type RpgOverlayList ¶
type RpgOverlayList struct {
Overlays []RpgOverlay `json:"overlays"`
Total int `json:"total"`
}
RpgOverlayList lists active overlays.
type RpgSearchOptions ¶
type RpgSearchOptions struct {
NodeTypes []string
Limit int
ContextID string
Authority *AuthorityContext
}
RpgSearchOptions configures RpgAPI.Search.
type RpgSearchResult ¶
type RpgSearchResult struct {
Nodes []RpgNode `json:"nodes"`
TotalCount int `json:"total_count"`
Query string `json:"query"`
}
RpgSearchResult is a typed RPG search response.
type RpgStatus ¶
type RpgStatus struct {
WorkspaceID string `json:"workspace_id"`
HasRPG bool `json:"has_rpg"`
NodeCount int `json:"node_count"`
EdgeCount int `json:"edge_count"`
LastSyncCommit *string `json:"last_sync_commit,omitempty"`
LastSyncAt *string `json:"last_sync_at,omitempty"`
}
RpgStatus reports repository graph coverage for a workspace.
type RpgSubgraph ¶
type RpgSubgraph struct {
Nodes []RpgNode `json:"nodes"`
Edges []RpgEdge `json:"edges"`
RootID *string `json:"root_id,omitempty"`
Depth int `json:"depth"`
TotalNodes int `json:"total_nodes"`
TotalEdges int `json:"total_edges"`
Truncated bool `json:"truncated,omitempty"`
}
RpgSubgraph is a repository graph rooted at a path or node.
type RpgSubgraphOptions ¶
type RpgSubgraphOptions struct {
Path string
NodeID string
Depth int
NodeTypes []string
RelationshipTypes []string
ContextID string
MaxNodes int
Authority *AuthorityContext
}
RpgSubgraphOptions configures RpgAPI.GetSubgraph.
type RpgSymbolConflict ¶
type RpgSymbolConflict struct {
SymbolID string `json:"symbol_id"`
FilePath string `json:"file_path"`
TaskIDs []string `json:"task_ids"`
Severity string `json:"severity"`
Description string `json:"description"`
}
RpgSymbolConflict describes a symbol-level conflict.
type RpgSymbolConflictResult ¶
type RpgSymbolConflictResult struct {
TaskIDs []string `json:"task_ids"`
Conflicts []RpgSymbolConflict `json:"conflicts"`
TotalConflicts int `json:"total_conflicts"`
}
RpgSymbolConflictResult contains conflicts between two task overlays.
type RpgSyncOptions ¶
type RpgSyncOptions struct {
FullSync bool
SourceCommit string
ContextID string
TaskID string
Authority *AuthorityContext
}
RpgSyncOptions configures RpgAPI.Sync.
type RpgSyncResult ¶
type RpgSyncResult struct {
NodesCreated int `json:"nodes_created"`
NodesUpdated int `json:"nodes_updated"`
NodesDeleted int `json:"nodes_deleted"`
EdgesCreated int `json:"edges_created"`
EdgesUpdated int `json:"edges_updated"`
EdgesDeleted int `json:"edges_deleted"`
SyncTimeMs int `json:"sync_time_ms"`
SourceCommit *string `json:"source_commit,omitempty"`
}
RpgSyncResult reports changes from an RPG sync.
type SaveSkillOptions ¶
type SaveSkillOptions struct {
Body string
Files []SkillFile
Scope string // default "workspace"
SourceMode string // default "server"
WorkspaceID string
UserID string
Version string
License string
Compatibility string
AllowedTools string
Metadata map[string]any
Authority *AuthorityContext
}
SaveSkillOptions configures SkillsAPI.Save.
type SearchTolerance ¶
type SearchTolerance string
SearchTolerance is the search precision level.
const ( SearchToleranceLoose SearchTolerance = "loose" SearchToleranceModerate SearchTolerance = "moderate" SearchToleranceStrict SearchTolerance = "strict" )
type SemanticMemoryCreateInput ¶
type SemanticMemoryCreateInput struct {
LogicalKey string `json:"logical_key"`
Content string `json:"content"`
Type MemoryType `json:"type"`
Subtype string `json:"subtype,omitempty"`
Tags []string `json:"tags,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
RefinementMetadata map[string]any `json:"refinement_metadata,omitempty"`
Pinned bool `json:"pinned"`
UserID string `json:"user_id,omitempty"`
Scope string `json:"scope,omitempty"`
}
SemanticMemoryCreateInput is the complete keyed document accepted by a conditional memory create. Associations remain separate child resources.
type SemanticMemoryReplaceInput ¶
type SemanticMemoryReplaceInput struct {
Content string `json:"content"`
Type MemoryType `json:"type"`
Subtype *string `json:"subtype"`
Tags []string `json:"tags"`
RefinementMetadata map[string]any `json:"refinement_metadata"`
Pinned bool `json:"pinned"`
}
SemanticMemoryReplaceInput completely replaces the refinement-owned semantic document while preserving native identity and operational fields.
type ServerError ¶
type ServerError struct{ *APIError }
ServerError is returned for HTTP 5xx responses.
type Session ¶
type Session struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
UserID *string `json:"user_id,omitempty"`
Metadata map[string]any `json:"metadata"`
ExpiresAt time.Time `json:"expires_at"`
CreatedAt time.Time `json:"created_at"`
}
Session is a working-memory session.
type SessionActivity ¶
type SessionActivity struct {
Timestamp time.Time `json:"timestamp"`
Summary string `json:"summary"`
MemoriesCreated int `json:"memories_created"`
KeyDecisions []string `json:"key_decisions"`
}
SessionActivity summarizes recent activity within a session.
type SessionBriefing ¶
type SessionBriefing struct {
WorkspaceSummary map[string]any `json:"workspace_summary"`
RecentActivity []SessionActivity `json:"recent_activity"`
OpenThreads []OpenThread `json:"open_threads"`
ContradictionsDetected []ContradictionDetection `json:"contradictions_detected"`
}
SessionBriefing is a session briefing with recent activity and context.
type SessionCheckpoint ¶
type SessionCheckpoint struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
SessionID string `json:"session_id"`
RawMemoryID string `json:"raw_memory_id"`
SourceKind string `json:"source_kind"`
SourceSequence *int `json:"source_sequence,omitempty"`
SourceBoundary *int `json:"source_boundary,omitempty"`
ContentHash string `json:"content_hash"`
ByteCount int `json:"byte_count"`
CaptureStatus string `json:"capture_status"`
IndexStatus string `json:"index_status"`
EnrichmentStatus string `json:"enrichment_status"`
IdempotencyKey string `json:"idempotency_key"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
SessionCheckpoint is a durable raw pre-compaction transcript capture.
type SkillGetOptions ¶
type SkillGetOptions struct {
WorkspaceID string
IncludeDeleted bool
Authority *AuthorityContext
}
SkillGetOptions configures retrieval of an active manifest or tombstone.
type SkillHistoryOptions ¶
type SkillHistoryOptions struct {
WorkspaceID string
Limit int
PageToken string
Authority *AuthorityContext
}
SkillHistoryOptions configures immutable manifest history traversal.
type SkillManifest ¶
type SkillManifest struct {
Name string
Description string
Version string
License string
Compatibility string
AllowedTools string
Body string
Metadata map[string]any
}
SkillManifest is the parsed SKILL.md frontmatter plus body.
type SkillManifestCreateInput ¶
type SkillManifestCreateInput struct {
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version,omitempty"`
License *string `json:"license,omitempty"`
Compatibility *string `json:"compatibility,omitempty"`
AllowedTools *string `json:"allowed_tools,omitempty"`
Body string `json:"body,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
SourceMode string `json:"source_mode,omitempty"`
}
SkillManifestCreateInput is the semantic manifest accepted by a conditional skill create. Bundle files remain separate child resources.
type SkillManifestMutationOptions ¶
type SkillManifestMutationOptions struct {
WorkspaceID string
IdempotencyKey string
ETag string
Authority *AuthorityContext
}
SkillManifestMutationOptions carries required idempotency, CAS, workspace, and delegated-authority metadata.
type SkillManifestReplaceInput ¶
type SkillManifestReplaceInput struct {
Description string `json:"description"`
Version string `json:"version,omitempty"`
License *string `json:"license"`
Compatibility *string `json:"compatibility"`
AllowedTools *string `json:"allowed_tools"`
Body string `json:"body"`
Metadata map[string]any `json:"metadata"`
SourceMode string `json:"source_mode,omitempty"`
Enabled bool `json:"enabled"`
}
SkillManifestReplaceInput completely replaces the semantic manifest while preserving the stable skill ID, name, ownership, and bundle children.
type SkillModel ¶
type SkillModel struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
TenantID string `json:"tenant_id"`
UserID *string `json:"user_id,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
License *string `json:"license,omitempty"`
Compatibility *string `json:"compatibility,omitempty"`
AllowedTools *string `json:"allowed_tools,omitempty"`
Body string `json:"body"`
Metadata map[string]any `json:"metadata"`
SourceMode string `json:"source_mode"`
ManifestHash string `json:"manifest_hash"`
BundleHash string `json:"bundle_hash"`
Enabled bool `json:"enabled"`
Revision int `json:"revision"`
ETag string `json:"etag"`
CreatedAt *string `json:"created_at,omitempty"`
UpdatedAt *string `json:"updated_at,omitempty"`
DeletedAt *string `json:"deleted_at,omitempty"`
}
SkillModel mirrors the server Skill record.
type SkillMutationResult ¶
type SkillMutationResult struct {
Skill SkillModel
Replayed bool
ETag string
}
type SkillResolution ¶
type SkillResolution struct {
Skill *SkillModel
Skills []SkillModel
}
SkillResolution is the result of SkillsAPI.Resolve. Exactly one field is populated: Skill for a name lookup (precedence winner), or Skills for a query (vector recall) — Skills may be empty when nothing matched.
type SkillRevision ¶
type SkillRevision struct {
Skill SkillModel `json:"skill"`
Action string `json:"action"`
OperationID string `json:"operation_id"`
}
type SkillRevisionPage ¶
type SkillRevisionPage struct {
Revisions []SkillRevision `json:"revisions"`
NextPageToken string `json:"next_page_token"`
}
type SkillsAPI ¶
type SkillsAPI struct {
// contains filtered or unexported fields
}
SkillsAPI is the /v1/skills namespace, reached via client.Skills.
func (*SkillsAPI) CreateVersioned ¶
func (s *SkillsAPI) CreateVersioned(ctx context.Context, input SkillManifestCreateInput, opts SkillManifestMutationOptions) (*SkillMutationResult, error)
CreateVersioned conditionally creates one native skill manifest.
func (*SkillsAPI) DeleteVersioned ¶
func (s *SkillsAPI) DeleteVersioned(ctx context.Context, skillID string, opts SkillManifestMutationOptions) (*SkillMutationResult, error)
DeleteVersioned conditionally writes a durable manifest tombstone.
func (*SkillsAPI) Get ¶
func (s *SkillsAPI) Get(ctx context.Context, skillID string, authority *AuthorityContext) (*SkillModel, error)
Get fetches a skill by ID.
func (*SkillsAPI) GetManifest ¶
GetManifest returns the rendered SKILL.md text for a skill.
func (*SkillsAPI) GetManifestWithOptions ¶
func (s *SkillsAPI) GetManifestWithOptions(ctx context.Context, skillID string, opts GetSkillManifestOptions) (string, error)
GetManifestWithOptions returns the rendered SKILL.md text for a skill.
func (*SkillsAPI) GetWithOptions ¶
func (s *SkillsAPI) GetWithOptions(ctx context.Context, skillID string, opts SkillGetOptions) (*SkillModel, error)
GetWithOptions fetches one active skill or, when requested, its tombstone.
func (*SkillsAPI) History ¶
func (s *SkillsAPI) History(ctx context.Context, skillID string, opts SkillHistoryOptions) (*SkillRevisionPage, error)
History returns immutable skill-manifest revisions newest first.
func (*SkillsAPI) List ¶
func (s *SkillsAPI) List(ctx context.Context, opts ListSkillsOptions) ([]SkillModel, error)
List lists visible skills.
func (*SkillsAPI) ListFiles ¶
func (s *SkillsAPI) ListFiles(ctx context.Context, skillID string, authority *AuthorityContext) ([]map[string]any, error)
ListFiles lists files in a skill bundle as raw maps (path, size, ...).
func (*SkillsAPI) Materialize ¶
func (s *SkillsAPI) Materialize(ctx context.Context, targetDir, scope, workspaceID string) ([]string, error)
Materialize bulk-pulls all visible skills into targetDir. It is idempotent via each skill's bundle_hash (skipped when unchanged). Returns the per-skill dirs.
func (*SkillsAPI) Push ¶
func (s *SkillsAPI) Push(ctx context.Context, skillDir, scope, sourceMode, workspaceID string) (*SkillModel, error)
Push parses a skill directory (SKILL.md + scripts/references/assets) and uploads it.
func (*SkillsAPI) ReplaceManifest ¶
func (s *SkillsAPI) ReplaceManifest(ctx context.Context, skillID string, input SkillManifestReplaceInput, opts SkillManifestMutationOptions) (*SkillMutationResult, error)
ReplaceManifest atomically replaces the complete semantic manifest.
func (*SkillsAPI) Resolve ¶
func (s *SkillsAPI) Resolve(ctx context.Context, name, query, workspaceID string, authority *AuthorityContext) (*SkillResolution, error)
Resolve resolves a skill by name (precedence winner) or query (vector recall).
func (*SkillsAPI) ResolveWithOptions ¶
func (s *SkillsAPI) ResolveWithOptions(ctx context.Context, opts ResolveSkillOptions) (*SkillResolution, error)
ResolveWithOptions resolves a skill by name or query.
func (*SkillsAPI) Restore ¶
func (s *SkillsAPI) Restore(ctx context.Context, skillID string, opts SkillManifestMutationOptions) (*SkillMutationResult, error)
Restore conditionally reactivates the exact tombstoned manifest.
func (*SkillsAPI) Save ¶
func (s *SkillsAPI) Save(ctx context.Context, name, description string, opts SaveSkillOptions) (*SkillModel, error)
Save creates or updates a skill by name.
type TokenCreateResult ¶
TokenCreateResult is a newly created token, including the one-time plaintext secret. The Token is only returned at creation time — store it securely.
type TokenInfo ¶
type TokenInfo struct {
ID string `json:"id"`
Name string `json:"name"`
PrincipalType string `json:"principal_type"`
WorkspacePatterns []string `json:"workspace_patterns"`
Scopes []string `json:"scopes"`
CreatedAt string `json:"created_at"`
ExpiresAt *string `json:"expires_at,omitempty"`
Revoked bool `json:"revoked"`
}
TokenInfo is an API token record (without the plaintext secret).
type Transport ¶
type Transport interface {
// RoundTrip issues req and returns the buffered response. It returns a
// non-nil error only for transport-level failures (the Client maps HTTP
// status codes to typed errors itself).
RoundTrip(ctx context.Context, req *Request) (*Response, error)
// Close releases any resources the transport owns. Transports that wrap a
// caller-owned connection (e.g. Aether) leave it open.
Close() error
}
Transport issues a single MemoryLayer API request. Implementations:
- The default HTTP transport wraps an *http.Client and talks directly to a MemoryLayer server.
- The Aether transport (companion module) routes via the Aether SDK's proxy_http against the MemoryLayer service topic.
A Transport must be safe for concurrent use.
type TraverseGraphOptions ¶
type TraverseGraphOptions struct {
MaxDepth int // default 2 when <= 0
RelationshipTypes []string
Direction string // default "both" when empty
MinStrength float64
WorkspaceID string
Authority *AuthorityContext
}
TraverseGraphOptions configures Client.TraverseGraph.
type UpdateAssociationOptions ¶
type UpdateAssociationOptions struct {
Strength *float64
Metadata map[string]any
Authority *AuthorityContext
}
UpdateAssociationOptions configures Client.UpdateAssociation. Nil fields are left unchanged.
type UpdateMcpServerOptions ¶
type UpdateMcpServerOptions struct {
Description *string
Command *string
Args []string
Env map[string]string
URL *string
Headers map[string]string
Metadata map[string]any
SourceMode *string
Enabled *bool
Authority *AuthorityContext
}
UpdateMcpServerOptions configures McpServersAPI.Update. Nil/zero fields are omitted (unchanged).
type UpdateMemoryOptions ¶
type UpdateMemoryOptions struct {
Content *string
Importance *float64
Tags []string
Metadata map[string]any
}
UpdateMemoryOptions configures Client.UpdateMemory. Nil fields are left unchanged.
type UpdateThreadOptions ¶
UpdateThreadOptions configures Client.UpdateThread. Nil fields are unchanged.
type UpdateWorkspaceOptions ¶
UpdateWorkspaceOptions configures Client.UpdateWorkspace. Nil fields are left unchanged.
type UploadDatasetOptions ¶
type UploadDatasetOptions struct {
Name string // defaults to filename stem server-side
TargetContextID string // default "_default"
Importance float64 // default 0.5
SampleRows int // default 1000
DetectTimeSeries *bool // default true
GenerateSummaries *bool // default true
// contains filtered or unexported fields
}
UploadDatasetOptions configures Client.UploadDataset.
func (UploadDatasetOptions) WithImportance ¶
func (o UploadDatasetOptions) WithImportance(v float64) UploadDatasetOptions
WithImportance returns a copy with Importance explicitly set.
type UploadDocumentOptions ¶
type UploadDocumentOptions struct {
TargetContextID string // default "_default"
ChunkingStrategy string // default "page"
ChunkSize int // default 4096
ChunkOverlap int // default 200
Importance float64 // default 0.5
RetainOriginal *bool // default true
// contains filtered or unexported fields
}
UploadDocumentOptions configures Client.UploadDocument.
func (UploadDocumentOptions) WithImportance ¶
func (o UploadDocumentOptions) WithImportance(v float64) UploadDocumentOptions
WithImportance returns a copy with Importance explicitly set.
type ValidationError ¶
type ValidationError struct{ *APIError }
ValidationError is returned for HTTP 422 responses.
type Workspace ¶
type Workspace struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
Name string `json:"name"`
Settings map[string]any `json:"settings"`
Tags []string `json:"tags"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Workspace is a workspace (tenant boundary).
type WorkspaceExport ¶
type WorkspaceExport struct {
Version string `json:"version"`
WorkspaceID string `json:"workspace_id"`
ExportedAt string `json:"exported_at"`
TotalMemories int `json:"total_memories"`
TotalAssociations int `json:"total_associations"`
Memories []map[string]any `json:"memories"`
Associations []map[string]any `json:"associations"`
}
WorkspaceExport is the materialized result of ExportWorkspace.
type WorkspaceObservationListOptions ¶
type WorkspaceObservationListOptions struct {
WorkspaceID string
Limit int
PageToken string
Authority *AuthorityContext
}
WorkspaceObservationListOptions configures current observation pagination.
type WorkspaceObservationMutationOptions ¶
type WorkspaceObservationMutationOptions struct {
WorkspaceID string
IdempotencyKey string
ETag string
Authority *AuthorityContext
}
WorkspaceObservationMutationOptions configures a conditional observer publication. Create sends If-None-Match; Replace sends If-Match.
type WorkspaceObservationMutationResult ¶
type WorkspaceObservationMutationResult struct {
Observation WorkspaceViewObservation
Replayed bool
ETag string
}
WorkspaceObservationMutationResult includes replay status and response ETag.
type WorkspaceVCSObservation ¶
type WorkspaceVCSObservation struct {
Kind string `json:"kind,omitempty"`
RepositoryID *string `json:"repository_id,omitempty"`
WorktreeID *string `json:"worktree_id,omitempty"`
HeadRevision *string `json:"head_revision,omitempty"`
Branch *string `json:"branch,omitempty"`
Dirty *bool `json:"dirty,omitempty"`
Detached *bool `json:"detached,omitempty"`
}
WorkspaceVCSObservation is portable VCS state. It deliberately contains no host-local absolute path.
type WorkspaceView ¶
type WorkspaceView struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
WorkspaceID string `json:"workspace_id"`
ViewID string `json:"view_id"`
Kind string `json:"kind"`
DisplayName *string `json:"display_name,omitempty"`
MemoryContextID *string `json:"memory_context_id,omitempty"`
Capabilities []string `json:"capabilities"`
Metadata map[string]any `json:"metadata"`
SchemaVersion int `json:"schema_version"`
Revision int `json:"revision"`
Sequence int `json:"sequence"`
ETag string `json:"etag"`
CreatedBy *string `json:"created_by,omitempty"`
UpdatedBy *string `json:"updated_by,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
WorkspaceView is one durable checkout, worktree, snapshot, overlay, or directory identity within a logical MemoryLayer workspace.
type WorkspaceViewCreateInput ¶
type WorkspaceViewCreateInput struct {
ViewID string `json:"view_id"`
Kind string `json:"kind"`
DisplayName *string `json:"display_name,omitempty"`
MemoryContextID *string `json:"memory_context_id,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
}
WorkspaceViewCreateInput creates a stable logical view identity.
type WorkspaceViewHistoryOptions ¶
type WorkspaceViewHistoryOptions struct {
WorkspaceID string
Limit int
PageToken string
Authority *AuthorityContext
}
WorkspaceViewHistoryOptions configures immutable revision pagination.
type WorkspaceViewListOptions ¶
type WorkspaceViewListOptions struct {
WorkspaceID string
Limit int
PageToken string
IncludeDeleted bool
Authority *AuthorityContext
}
WorkspaceViewListOptions configures current-head pagination.
type WorkspaceViewMutationOptions ¶
type WorkspaceViewMutationOptions struct {
WorkspaceID string
IdempotencyKey string
ETag string
Authority *AuthorityContext
}
WorkspaceViewMutationOptions configures a conditional view mutation.
type WorkspaceViewMutationResult ¶
type WorkspaceViewMutationResult struct {
View WorkspaceView
Replayed bool
ETag string
}
WorkspaceViewMutationResult includes replay status and response ETag.
type WorkspaceViewObservation ¶
type WorkspaceViewObservation struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
WorkspaceID string `json:"workspace_id"`
ViewID string `json:"view_id"`
ObserverID string `json:"observer_id"`
Generation string `json:"generation"`
Sequence int64 `json:"sequence"`
ToolHostID *string `json:"tool_host_id,omitempty"`
ExecutionSite *string `json:"execution_site,omitempty"`
RootRef *string `json:"root_ref,omitempty"`
Capabilities []string `json:"capabilities"`
VCS *WorkspaceVCSObservation `json:"vcs,omitempty"`
ObservedAt time.Time `json:"observed_at"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
Metadata map[string]any `json:"metadata"`
SchemaVersion int `json:"schema_version"`
ResourceRevision int `json:"resource_revision"`
ResourceSequence int64 `json:"resource_sequence"`
ETag string `json:"etag"`
CreatedBy *string `json:"created_by,omitempty"`
UpdatedBy *string `json:"updated_by,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
WorkspaceViewObservation is the authoritative latest state published by one observer for one view.
type WorkspaceViewObservationInput ¶
type WorkspaceViewObservationInput struct {
Generation string `json:"generation"`
Sequence int64 `json:"sequence"`
ToolHostID *string `json:"tool_host_id,omitempty"`
ExecutionSite *string `json:"execution_site,omitempty"`
RootRef *string `json:"root_ref,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
VCS *WorkspaceVCSObservation `json:"vcs,omitempty"`
ObservedAt *time.Time `json:"observed_at,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
}
WorkspaceViewObservationInput publishes one observer cursor and portable view state. ObserverID is supplied as a method argument.
type WorkspaceViewObservationPage ¶
type WorkspaceViewObservationPage struct {
Observations []WorkspaceViewObservation `json:"observations"`
NextPageToken string `json:"next_page_token"`
}
type WorkspaceViewObservationRevision ¶
type WorkspaceViewObservationRevision struct {
Observation WorkspaceViewObservation `json:"observation"`
Action string `json:"action"`
OperationID string `json:"operation_id"`
}
type WorkspaceViewObservationRevisionPage ¶
type WorkspaceViewObservationRevisionPage struct {
Revisions []WorkspaceViewObservationRevision `json:"revisions"`
NextPageToken string `json:"next_page_token"`
}
type WorkspaceViewPage ¶
type WorkspaceViewPage struct {
Views []WorkspaceView `json:"views"`
NextPageToken string `json:"next_page_token"`
}
type WorkspaceViewReplaceInput ¶
type WorkspaceViewReplaceInput struct {
Kind string `json:"kind"`
DisplayName *string `json:"display_name,omitempty"`
MemoryContextID *string `json:"memory_context_id,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
SchemaVersion int `json:"schema_version,omitempty"`
}
WorkspaceViewReplaceInput replaces a view's mutable description. ViewID is path-addressed and intentionally immutable.
type WorkspaceViewRevision ¶
type WorkspaceViewRevision struct {
View WorkspaceView `json:"view"`
Action string `json:"action"`
OperationID string `json:"operation_id"`
}
type WorkspaceViewRevisionPage ¶
type WorkspaceViewRevisionPage struct {
Revisions []WorkspaceViewRevision `json:"revisions"`
NextPageToken string `json:"next_page_token"`
}
type WorkspaceViewsAPI ¶
type WorkspaceViewsAPI struct {
// contains filtered or unexported fields
}
WorkspaceViewsAPI is the typed /v1/workspaces/{workspace}/views namespace.
func (*WorkspaceViewsAPI) Create ¶
func (w *WorkspaceViewsAPI) Create(ctx context.Context, input WorkspaceViewCreateInput, opts WorkspaceViewMutationOptions) (*WorkspaceViewMutationResult, error)
func (*WorkspaceViewsAPI) CreateObservation ¶
func (w *WorkspaceViewsAPI) CreateObservation( ctx context.Context, viewID, observerID string, input WorkspaceViewObservationInput, opts WorkspaceObservationMutationOptions, ) (*WorkspaceObservationMutationResult, error)
func (*WorkspaceViewsAPI) Delete ¶
func (w *WorkspaceViewsAPI) Delete(ctx context.Context, viewID string, opts WorkspaceViewMutationOptions) (*WorkspaceViewMutationResult, error)
Delete writes a durable view tombstone when opts.ETag matches the head.
func (*WorkspaceViewsAPI) DeleteObservation ¶
func (w *WorkspaceViewsAPI) DeleteObservation( ctx context.Context, viewID, observerID string, opts WorkspaceObservationMutationOptions, ) (*WorkspaceObservationMutationResult, error)
DeleteObservation writes a durable observer tombstone.
func (*WorkspaceViewsAPI) Get ¶
func (w *WorkspaceViewsAPI) Get(ctx context.Context, workspaceID, viewID string, authority *AuthorityContext) (*WorkspaceView, error)
func (*WorkspaceViewsAPI) GetObservation ¶
func (w *WorkspaceViewsAPI) GetObservation( ctx context.Context, workspaceID, viewID, observerID string, authority *AuthorityContext, ) (*WorkspaceViewObservation, error)
func (*WorkspaceViewsAPI) History ¶
func (w *WorkspaceViewsAPI) History(ctx context.Context, viewID string, opts WorkspaceViewHistoryOptions) (*WorkspaceViewRevisionPage, error)
func (*WorkspaceViewsAPI) List ¶
func (w *WorkspaceViewsAPI) List(ctx context.Context, opts WorkspaceViewListOptions) (*WorkspaceViewPage, error)
func (*WorkspaceViewsAPI) ListObservations ¶
func (w *WorkspaceViewsAPI) ListObservations( ctx context.Context, viewID string, opts WorkspaceObservationListOptions, ) (*WorkspaceViewObservationPage, error)
func (*WorkspaceViewsAPI) ObservationHistory ¶
func (w *WorkspaceViewsAPI) ObservationHistory( ctx context.Context, viewID, observerID string, opts WorkspaceObservationListOptions, ) (*WorkspaceViewObservationRevisionPage, error)
func (*WorkspaceViewsAPI) Replace ¶
func (w *WorkspaceViewsAPI) Replace(ctx context.Context, viewID string, input WorkspaceViewReplaceInput, opts WorkspaceViewMutationOptions) (*WorkspaceViewMutationResult, error)
func (*WorkspaceViewsAPI) ReplaceObservation ¶
func (w *WorkspaceViewsAPI) ReplaceObservation( ctx context.Context, viewID, observerID string, input WorkspaceViewObservationInput, opts WorkspaceObservationMutationOptions, ) (*WorkspaceObservationMutationResult, error)
func (*WorkspaceViewsAPI) Restore ¶
func (w *WorkspaceViewsAPI) Restore(ctx context.Context, viewID string, opts WorkspaceViewMutationOptions) (*WorkspaceViewMutationResult, error)
Restore reactivates a tombstoned view without changing its stable identity.
func (*WorkspaceViewsAPI) RestoreObservation ¶
func (w *WorkspaceViewsAPI) RestoreObservation( ctx context.Context, viewID, observerID string, opts WorkspaceObservationMutationOptions, ) (*WorkspaceObservationMutationResult, error)
RestoreObservation reactivates a tombstoned observer head.
Source Files
¶
- agent_specifications.go
- associations.go
- client.go
- context_env.go
- datasets.go
- decode.go
- doc.go
- documents.go
- enterprise_models.go
- entities.go
- errors.go
- knowledgebase.go
- mcp_servers.go
- memories.go
- models.go
- multipart.go
- obo.go
- obo_namespaces.go
- prompt_notes.go
- refinement_records.go
- rpg.go
- sessions.go
- skills.go
- skills_folder.go
- threads.go
- tokens.go
- transport.go
- types.go
- workspace_execution.go
- workspaces.go
Directories
¶
| Path | Synopsis |
|---|---|
|
aether
module
|
|
|
examples
|
|
|
basic
command
Command basic demonstrates the MemoryLayer Go SDK over the default HTTP transport: store a memory, search for it, and reflect.
|
Command basic demonstrates the MemoryLayer Go SDK over the default HTTP transport: store a memory, search for it, and reflect. |