Documentation
¶
Index ¶
- Constants
- Variables
- func AppendDailyLog(root string, now time.Time, entry string) error
- func AppendExperience(root string, exp Experience) error
- func AppendMemoryNote(root string, now time.Time, entry string) error
- func EnsureWorkspace(root string) error
- func IsSupportedEmbedProvider(raw string) bool
- func NormalizeEmbedProvider(raw string) string
- func SupportedEmbedProviders() []string
- func ValidateSemanticConfig(cfg SemanticConfig) error
- type Backend
- type CompactionMemory
- type DurableKind
- type EmbedRequest
- type Embedder
- type Experience
- type FileBackend
- func (b *FileBackend) AppendExperience(ctx context.Context, exp Experience) error
- func (b *FileBackend) AppendMemoryNote(_ context.Context, at time.Time, entry string) error
- func (b *FileBackend) LoadDurable(_ context.Context, kind DurableKind, name string) (string, error)
- func (b *FileBackend) SaveDurable(_ context.Context, kind DurableKind, name string, body string) error
- func (b *FileBackend) Search(ctx context.Context, req SearchRequest) ([]SearchHit, error)
- func (b *FileBackend) SearchExperiences(_ context.Context, opts SearchOptions) ([]Experience, error)
- type MemoryEntry
- type SearchHit
- type SearchOptions
- type SearchRequest
- type Searcher
- type SemanticConfig
- type Service
- func (s *Service) Enabled() bool
- func (s *Service) IndexCompactionMemories(ctx context.Context, sessionID string, items []CompactionMemory, ...) error
- func (s *Service) IndexCompactionSummary(ctx context.Context, sessionID, summary string, createdAt time.Time) error
- func (s *Service) IndexExperience(ctx context.Context, exp Experience) error
- func (s *Service) LoadEntries() ([]MemoryEntry, error)
- func (s *Service) Search(ctx context.Context, req SearchRequest) ([]SearchHit, error)
- type ServiceOptions
- type WorkspaceBootstrapFileSpec
Constants ¶
View Source
const (
DefaultSemanticLimit = 6
)
Variables ¶
Functions ¶
func AppendDailyLog ¶
AppendDailyLog appends one line into workspace/memory/YYYY-MM-DD.md.
func AppendExperience ¶
func AppendExperience(root string, exp Experience) error
func AppendMemoryNote ¶
AppendMemoryNote appends one bullet entry into workspace/MEMORY.md.
func EnsureWorkspace ¶
EnsureWorkspace creates the minimum workspace layout used by tars.
func IsSupportedEmbedProvider ¶ added in v0.15.0
func NormalizeEmbedProvider ¶ added in v0.15.0
func SupportedEmbedProviders ¶ added in v0.15.0
func SupportedEmbedProviders() []string
func ValidateSemanticConfig ¶ added in v0.15.0
func ValidateSemanticConfig(cfg SemanticConfig) error
Types ¶
type Backend ¶ added in v0.25.0
type Backend interface {
LoadDurable(ctx context.Context, kind DurableKind, name string) (string, error)
SaveDurable(ctx context.Context, kind DurableKind, name string, body string) error
Search(ctx context.Context, req SearchRequest) ([]SearchHit, error)
AppendMemoryNote(ctx context.Context, at time.Time, entry string) error
AppendExperience(ctx context.Context, exp Experience) error
SearchExperiences(ctx context.Context, opts SearchOptions) ([]Experience, error)
}
Backend is the narrow memory surface currently used by tools and reflection. It intentionally excludes session-store operations.
type CompactionMemory ¶ added in v0.6.0
type DurableKind ¶ added in v0.25.0
type DurableKind string
const ( DurableKindMemory DurableKind = "memory" DurableKindDaily DurableKind = "daily" )
type EmbedRequest ¶ added in v0.6.0
type Embedder ¶ added in v0.6.0
type Embedder interface {
Embed(ctx context.Context, req EmbedRequest) ([]float64, error)
}
type Experience ¶
type Experience struct {
Timestamp time.Time `json:"timestamp"`
Category string `json:"category"`
Summary string `json:"summary"`
Tags []string `json:"tags,omitempty"`
SourceSession string `json:"source_session,omitempty"`
Importance int `json:"importance,omitempty"`
Auto bool `json:"auto,omitempty"`
}
func SearchExperiences ¶
func SearchExperiences(root string, opts SearchOptions) ([]Experience, error)
type FileBackend ¶ added in v0.25.0
type FileBackend struct {
// contains filtered or unexported fields
}
func NewFileBackend ¶ added in v0.25.0
func NewFileBackend(root string, semantic *Service) *FileBackend
func (*FileBackend) AppendExperience ¶ added in v0.25.0
func (b *FileBackend) AppendExperience(ctx context.Context, exp Experience) error
func (*FileBackend) AppendMemoryNote ¶ added in v0.25.0
func (*FileBackend) LoadDurable ¶ added in v0.25.0
func (b *FileBackend) LoadDurable(_ context.Context, kind DurableKind, name string) (string, error)
func (*FileBackend) SaveDurable ¶ added in v0.25.0
func (b *FileBackend) SaveDurable(_ context.Context, kind DurableKind, name string, body string) error
func (*FileBackend) Search ¶ added in v0.25.0
func (b *FileBackend) Search(ctx context.Context, req SearchRequest) ([]SearchHit, error)
func (*FileBackend) SearchExperiences ¶ added in v0.25.0
func (b *FileBackend) SearchExperiences(_ context.Context, opts SearchOptions) ([]Experience, error)
type MemoryEntry ¶ added in v0.6.0
type MemoryEntry struct {
ID string `json:"id"`
Kind string `json:"kind"`
Scope string `json:"scope"`
Category string `json:"category,omitempty"`
SessionID string `json:"session_id,omitempty"`
SourcePath string `json:"source_path,omitempty"`
ContentHash string `json:"content_hash"`
Abstract string `json:"abstract,omitempty"`
Overview string `json:"overview,omitempty"`
Body string `json:"body,omitempty"`
Tags []string `json:"tags,omitempty"`
Importance int `json:"importance,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
EmbeddingModel string `json:"embedding_model,omitempty"`
EmbeddingDimensions int `json:"embedding_dimensions,omitempty"`
Embedding []float64 `json:"embedding,omitempty"`
}
type SearchOptions ¶
type SearchRequest ¶ added in v0.6.0
type Searcher ¶ added in v0.6.0
type Searcher interface {
Search(ctx context.Context, req SearchRequest) ([]SearchHit, error)
}
type SemanticConfig ¶ added in v0.6.0
type Service ¶ added in v0.6.0
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶ added in v0.6.0
func NewService(root string, opts ServiceOptions) *Service
func (*Service) IndexCompactionMemories ¶ added in v0.6.0
func (*Service) IndexCompactionSummary ¶ added in v0.6.0
func (*Service) IndexExperience ¶ added in v0.6.0
func (s *Service) IndexExperience(ctx context.Context, exp Experience) error
func (*Service) LoadEntries ¶ added in v0.6.0
func (s *Service) LoadEntries() ([]MemoryEntry, error)
type ServiceOptions ¶ added in v0.6.0
type WorkspaceBootstrapFileSpec ¶ added in v0.18.0
type WorkspaceBootstrapFileSpec struct {
Path string
Title string
Description string
DefaultContent string
EnsureByDefault bool
}
WorkspaceBootstrapFileSpec describes one top-level workspace bootstrap file.
func WorkspaceBootstrapFileSpecFor ¶ added in v0.18.0
func WorkspaceBootstrapFileSpecFor(path string) (WorkspaceBootstrapFileSpec, bool)
func WorkspaceBootstrapFileSpecs ¶ added in v0.18.0
func WorkspaceBootstrapFileSpecs() []WorkspaceBootstrapFileSpec
Click to show internal directories.
Click to hide internal directories.