Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMemoryTool ¶
func NewMemoryTool(store MemoryStore) (tools.Tool, error)
NewMemoryTool creates a new memory tool with the given memory store.
Types ¶
type InMemoryStore ¶
type InMemoryStore struct {
// contains filtered or unexported fields
}
InMemoryStore is an in-memory implementation of MemoryStore.
func NewInMemoryStore ¶
func NewInMemoryStore() *InMemoryStore
NewInMemoryStore creates a new instance of InMemoryStore.
func (*InMemoryStore) AddMemory ¶
func (s *InMemoryStore) AddMemory(ctx context.Context, m *Memory) error
AddMemory adds a new memory to the in-memory store.
func (*InMemoryStore) SearchMemory ¶
SearchMemory searches for memories containing the given query string.
type Memory ¶
type Memory struct {
Content *blades.Message `json:"content"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Memory represents a piece of information stored in the memory system.
type MemoryStore ¶
type MemoryStore interface {
AddMemory(context.Context, *Memory) error
SearchMemory(context.Context, string) ([]*Memory, error)
}
MemoryStore defines the interface for storing and retrieving memories.
Click to show internal directories.
Click to hide internal directories.