Documentation
¶
Index ¶
- Constants
- Variables
- type Batch
- type Fact
- type Manager
- func (m *Manager) Edit(user, id, text string) (db.MemoryRow, error)
- func (m *Manager) Forget(user, id string) error
- func (m *Manager) Invoke(ctx context.Context, caller tools.Caller, _ string, arguments map[string]any) (tools.Result, error)
- func (m *Manager) List(user string, scope db.MemoryScope, workspaceID string) ([]db.MemoryRow, error)
- func (m *Manager) Move(user, id string) (db.MemoryRow, error)
- func (*Manager) Name() (string, string)
- func (m *Manager) Run(ctx context.Context)
- func (m *Manager) RunOnce(ctx context.Context) error
- func (m *Manager) Search(user, query, workspaceID string, limit int) ([]db.MemoryRow, error)
- func (m *Manager) Snapshot(user, workspaceID string, budget int) (*Snapshot, error)
- func (m *Manager) Status(user string) (db.MemoryStatus, error)
- func (m *Manager) ToolList(context.Context) ([]*tools.Spec, error)
- type Operation
- type Options
- type SearchArgs
- type SearchResult
- type Snapshot
Constants ¶
View Source
const ( ProviderName = "memory" ToolSearch = "memory_search" )
Variables ¶
View Source
var ErrInvalidChange = errors.New("invalid memory change")
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
UserID string `json:"-"`
Scope db.MemoryScope `json:"scope"`
WorkspaceID string `json:"workspaceId,omitempty"`
ThreadID string `json:"threadId"`
TurnID string `json:"turnId"`
TurnStatus db.TurnStatus `json:"turnStatus"`
TurnError string `json:"turnError,omitempty"`
Facts []Fact `json:"facts"`
Existing []db.MemoryRow `json:"existing"`
Cursor db.MemoryCursor `json:"-"`
Entries int `json:"-"`
}
type Fact ¶
type Fact struct {
Source db.MemorySource `json:"source"`
Data json.RawMessage `json:"data"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) RunOnce ¶
RunOnce takes one batch for each user on the shard; a user whose extraction fails does not hold up the others.
func (*Manager) Search ¶ added in v0.5.0
Search finds active memories by words for the user: those of a workspace and the global ones, or with no workspace all of them.
type SearchArgs ¶
type SearchArgs struct {
Query string `json:"query" jsonschema:"Words to look for in a memory's topic and text."`
}
func (SearchArgs) Constrain ¶
func (SearchArgs) Constrain(s *jsonschema.Schema)
type SearchResult ¶
type SearchResult struct {
Memories []db.MemoryReference `json:"memories"`
}
type Snapshot ¶ added in v0.5.0
type Snapshot struct {
Entries []db.MemoryReference
Text string
}
Click to show internal directories.
Click to hide internal directories.