Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntityMemory ¶
type EntityMemory struct {
ShortTerm
// contains filtered or unexported fields
}
EntityMemory extends ShortTerm with entity-specific fact storage.
func NewEntityMemory ¶
func NewEntityMemory(limit int) *EntityMemory
NewEntityMemory creates a new EntityMemory with the given entry limit.
func (*EntityMemory) GetAllEntities ¶
func (e *EntityMemory) GetAllEntities(_ context.Context) ([]string, error)
GetAllEntities returns all entity names that have stored facts.
type EntityStore ¶
type EntityStore interface {
Store
SaveFact(ctx context.Context, entity string, fact string) error
GetFacts(ctx context.Context, entity string) ([]string, error)
GetAllEntities(ctx context.Context) ([]string, error)
}
EntityStore extends Store with entity-specific fact storage and retrieval.
type Entry ¶
type Entry struct {
Role string `json:"role"`
Content string `json:"content"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Entry represents a single memory entry with role, content, and metadata.
type ShortTerm ¶
type ShortTerm struct {
// contains filtered or unexported fields
}
ShortTerm is an in-memory circular buffer store for recent conversation entries.
func NewShortTerm ¶
NewShortTerm creates a new ShortTerm store with the given entry limit.
Click to show internal directories.
Click to hide internal directories.