Documentation
¶
Index ¶
- Constants
- Variables
- func ChannelNodeIDForPublicKey(publicKey string) (string, error)
- func EmbeddingContentHash(mem Memory) string
- func EmbeddingText(mem Memory) string
- func FTSQuery(query string) string
- type AddMemoryParams
- type BulkForgetResult
- type ChannelIdentity
- type ChannelImportParams
- type ChannelOutboxEntry
- type ChannelPeer
- type ChannelPeerDelta
- type ChannelRefreshState
- type ChannelSubscription
- type Counts
- type EmbeddingRecord
- type FileSource
- type ForgetParams
- type ForgetResult
- type LifecycleParams
- type ListParams
- type Memory
- type MetadataParams
- type SearchParams
- type SemanticSearchParams
- type SourceRefreshParams
- type SourceRefreshResult
- type Store
- func (s *Store) ActiveSourceKindCount(ctx context.Context, sourceKind string) (int, error)
- func (s *Store) AddMemory(ctx context.Context, p AddMemoryParams) (*Memory, bool, error)
- func (s *Store) Backup(dest string) error
- func (s *Store) ChannelOutboxEntries(ctx context.Context, channelID string, includePublished bool, limit int) ([]ChannelOutboxEntry, error)
- func (s *Store) ChannelRefreshState(ctx context.Context, channelID string) (ChannelRefreshState, error)
- func (s *Store) ChannelSubscriptions(ctx context.Context) ([]ChannelSubscription, error)
- func (s *Store) Close() error
- func (s *Store) Counts(ctx context.Context) (Counts, error)
- func (s *Store) DestroySourceMemories(ctx context.Context, scopeKind, scopeID, sourceKind, sourcePath string) (BulkForgetResult, error)
- func (s *Store) EnqueueChannelOutbox(ctx context.Context, memoryID, channelID, reason string) error
- func (s *Store) FileSources(ctx context.Context, scopeKind, scopeID, agent string) ([]FileSource, error)
- func (s *Store) ForgetByFilter(ctx context.Context, p ListParams, reason string, destroy bool) (BulkForgetResult, error)
- func (s *Store) ForgetMemory(ctx context.Context, p ForgetParams) (ForgetResult, error)
- func (s *Store) GetChannelSubscription(ctx context.Context, channelID string) (ChannelSubscription, error)
- func (s *Store) GetMemory(ctx context.Context, idOrPrefix string) (*Memory, error)
- func (s *Store) GetMemoryByID(ctx context.Context, id string, includeDeleted bool) (*Memory, error)
- func (s *Store) GetOrCreateChannelIdentity(ctx context.Context) (ChannelIdentity, error)
- func (s *Store) HasChannelImport(ctx context.Context, eventID string) (bool, error)
- func (s *Store) List(ctx context.Context, p ListParams) ([]Memory, error)
- func (s *Store) MarkChannelOutboxPublished(ctx context.Context, memoryID, channelID string) error
- func (s *Store) Path() string
- func (s *Store) PendingChannelOutbox(ctx context.Context, channelID string, limit int) ([]ChannelOutboxEntry, error)
- func (s *Store) PresentChannelPeers(ctx context.Context, channelID string) ([]ChannelPeer, error)
- func (s *Store) RecordChannelImport(ctx context.Context, p ChannelImportParams) error
- func (s *Store) RecordChannelOutboxFailure(ctx context.Context, memoryID, channelID, lastError string) error
- func (s *Store) RecordChannelPeers(ctx context.Context, channelID string, peers []ChannelPeer) (ChannelPeerDelta, error)
- func (s *Store) RecordChannelRefresh(ctx context.Context, channelID string, eventCursor int) error
- func (s *Store) RefreshSource(ctx context.Context, p SourceRefreshParams) (SourceRefreshResult, error)
- func (s *Store) Repair(ctx context.Context) error
- func (s *Store) ResolveChannelSubscription(ctx context.Context, selector string) (ChannelSubscription, error)
- func (s *Store) Search(ctx context.Context, p SearchParams) ([]Memory, error)
- func (s *Store) SemanticSearch(ctx context.Context, p SemanticSearchParams) ([]Memory, error)
- func (s *Store) StaleMissingSources(ctx context.Context, scopeKind, scopeID, agent string, currentPaths []string) (int, error)
- func (s *Store) UpdateLifecycle(ctx context.Context, p LifecycleParams) (*Memory, error)
- func (s *Store) UpdateMetadata(ctx context.Context, p MetadataParams) (*Memory, error)
- func (s *Store) UpsertChannelSubscription(ctx context.Context, p UpsertChannelSubscriptionParams) (ChannelSubscription, error)
- func (s *Store) UpsertEmbedding(ctx context.Context, mem Memory, provider, model string, vector []float64) error
- type UpsertChannelSubscriptionParams
Constants ¶
View Source
const ( LifecycleAny = "" LifecycleCurrent = "current" LifecycleHistorical = "historical" )
Variables ¶
View Source
var ( ErrNotFound = errors.New("memory not found") ErrAmbiguous = errors.New("memory ID prefix is ambiguous") )
Functions ¶
func EmbeddingContentHash ¶
func EmbeddingText ¶
Types ¶
type AddMemoryParams ¶
type AddMemoryParams struct {
Role string
Content string
SourceKind string
SourceAgent string
SourcePath string
SourceRef string
ScopeKind string
ScopeID string
ProjectID string
SessionID string
Room string
MetadataJSON string
Validity string
ClaimKey string
Supersedes string
SupersededBy string
CreatedAt string
}
type BulkForgetResult ¶
type ChannelIdentity ¶
type ChannelImportParams ¶
type ChannelOutboxEntry ¶
type ChannelOutboxEntry struct {
MemoryID string `json:"memory_id"`
ChannelID string `json:"channel_id"`
Reason string `json:"reason,omitempty"`
Status string `json:"status"`
Attempts int `json:"attempts"`
LastError string `json:"last_error,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type ChannelPeer ¶
type ChannelPeerDelta ¶
type ChannelPeerDelta struct {
NewPeers []ChannelPeer `json:"new_peers,omitempty"`
MissingPeers []ChannelPeer `json:"missing_peers,omitempty"`
}
type ChannelRefreshState ¶
type ChannelSubscription ¶
type ChannelSubscription struct {
ChannelID string `json:"channel_id"`
Name string `json:"name,omitempty"`
Path string `json:"path"`
NodeID string `json:"node_id"`
Agent string `json:"agent,omitempty"`
ScopeKind string `json:"scope_kind"`
ScopeID string `json:"scope_id"`
ProjectID string `json:"project_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
JoinedAt string `json:"joined_at"`
UpdatedAt string `json:"updated_at"`
}
type EmbeddingRecord ¶
type FileSource ¶
type FileSource struct {
ID string `json:"id"`
Path string `json:"path"`
Agent string `json:"agent,omitempty"`
ScopeKind string `json:"scope_kind"`
ScopeID string `json:"scope_id"`
ContentHash string `json:"content_hash,omitempty"`
ModTime string `json:"mod_time,omitempty"`
SizeBytes int64 `json:"size_bytes,omitempty"`
ChunkCount int `json:"chunk_count,omitempty"`
LastMinedAt string `json:"last_mined_at,omitempty"`
DeletedAt string `json:"deleted_at,omitempty"`
}
type ForgetParams ¶
type ForgetResult ¶
type LifecycleParams ¶
type ListParams ¶
type Memory ¶
type Memory struct {
ID string `json:"id"`
Hash string `json:"hash,omitempty"`
Role string `json:"role,omitempty"`
Content string `json:"content"`
SourceKind string `json:"source_kind,omitempty"`
SourceAgent string `json:"source_agent,omitempty"`
SourcePath string `json:"source_path,omitempty"`
SourceRef string `json:"source_ref,omitempty"`
ScopeKind string `json:"scope_kind"`
ScopeID string `json:"scope_id"`
ProjectID string `json:"project_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
Room string `json:"room,omitempty"`
MetadataJSON string `json:"metadata_json,omitempty"`
Validity string `json:"validity"`
ClaimKey string `json:"claim_key,omitempty"`
Supersedes string `json:"supersedes,omitempty"`
SupersededBy string `json:"superseded_by,omitempty"`
CreatedAt string `json:"created_at"`
TombstonedAt string `json:"tombstoned_at,omitempty"`
Score float64 `json:"score,omitempty"`
Excerpt string `json:"excerpt,omitempty"`
Why string `json:"why,omitempty"`
}
type MetadataParams ¶
type SearchParams ¶
type SemanticSearchParams ¶
type SourceRefreshParams ¶
type SourceRefreshResult ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ActiveSourceKindCount ¶
func (*Store) ChannelOutboxEntries ¶
func (*Store) ChannelRefreshState ¶
func (*Store) ChannelSubscriptions ¶
func (s *Store) ChannelSubscriptions(ctx context.Context) ([]ChannelSubscription, error)
func (*Store) DestroySourceMemories ¶
func (*Store) EnqueueChannelOutbox ¶
func (*Store) FileSources ¶
func (*Store) ForgetByFilter ¶
func (s *Store) ForgetByFilter(ctx context.Context, p ListParams, reason string, destroy bool) (BulkForgetResult, error)
func (*Store) ForgetMemory ¶
func (s *Store) ForgetMemory(ctx context.Context, p ForgetParams) (ForgetResult, error)
func (*Store) GetChannelSubscription ¶
func (*Store) GetMemoryByID ¶
func (*Store) GetOrCreateChannelIdentity ¶
func (s *Store) GetOrCreateChannelIdentity(ctx context.Context) (ChannelIdentity, error)
func (*Store) HasChannelImport ¶
func (*Store) MarkChannelOutboxPublished ¶
func (*Store) PendingChannelOutbox ¶
func (*Store) PresentChannelPeers ¶
func (*Store) RecordChannelImport ¶
func (s *Store) RecordChannelImport(ctx context.Context, p ChannelImportParams) error
func (*Store) RecordChannelOutboxFailure ¶
func (*Store) RecordChannelPeers ¶
func (s *Store) RecordChannelPeers(ctx context.Context, channelID string, peers []ChannelPeer) (ChannelPeerDelta, error)
func (*Store) RecordChannelRefresh ¶
func (*Store) RefreshSource ¶
func (s *Store) RefreshSource(ctx context.Context, p SourceRefreshParams) (SourceRefreshResult, error)
func (*Store) ResolveChannelSubscription ¶
func (*Store) SemanticSearch ¶
func (*Store) StaleMissingSources ¶
func (*Store) UpdateLifecycle ¶
func (*Store) UpdateMetadata ¶
func (*Store) UpsertChannelSubscription ¶
func (s *Store) UpsertChannelSubscription(ctx context.Context, p UpsertChannelSubscriptionParams) (ChannelSubscription, error)
Click to show internal directories.
Click to hide internal directories.