archivist

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package archivist provides the Archivist agent that extracts and manages facts from conversations for long-term memory.

Index

Constants

View Source
const (
	// ParamMessages is the key for messages to process ([]storage.Message).
	ParamMessages = "messages"
	// ParamFacts is the key for current facts ([]storage.Fact).
	ParamFacts = "facts"
	// ParamReferenceDate is the key for the reference date (time.Time).
	ParamReferenceDate = "reference_date"
	// ParamUser is the key for user info (*storage.User, optional).
	ParamUser = "user"
)

Request parameters for Archivist agent.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddedFact

type AddedFact struct {
	Entity     string `json:"entity"`
	Relation   string `json:"relation"`
	Content    string `json:"content"`
	Category   string `json:"category"`
	Type       string `json:"type"`
	Importance int    `json:"importance"`
	Reason     string `json:"reason"`
}

AddedFact represents a new fact to add.

type Archivist

type Archivist struct {
	// contains filtered or unexported fields
}

Archivist extracts and manages facts from conversations.

func New

func New(
	executor *agent.Executor,
	translator *i18n.Translator,
	cfg *config.Config,
) *Archivist

New creates a new Archivist agent.

func (*Archivist) Capabilities

func (a *Archivist) Capabilities() agent.Capabilities

Capabilities returns the agent's capabilities.

func (*Archivist) Description

func (a *Archivist) Description() string

Description returns a human-readable description.

func (*Archivist) Execute

func (a *Archivist) Execute(ctx context.Context, req *agent.Request) (*agent.Response, error)

Execute runs the archivist with the given request.

func (*Archivist) Type

func (a *Archivist) Type() agent.AgentType

Type returns the agent type.

type FactView

type FactView struct {
	ID         int64  `json:"id"`
	Entity     string `json:"entity"`
	Relation   string `json:"relation"`
	Content    string `json:"content"`
	Category   string `json:"category"`
	Type       string `json:"type"`
	Importance int    `json:"importance"`
}

FactView is a simplified view of a fact for the prompt.

type RemovedFact

type RemovedFact struct {
	ID     int64  `json:"id"`
	Reason string `json:"reason"`
}

RemovedFact represents a fact to be deleted.

type Result

type Result struct {
	Added   []AddedFact   `json:"added"`
	Updated []UpdatedFact `json:"updated"`
	Removed []RemovedFact `json:"removed"`
}

Result contains the memory update decisions.

type UpdatedFact

type UpdatedFact struct {
	ID         int64  `json:"id"`
	Content    string `json:"content"`
	Type       string `json:"type,omitempty"`
	Importance int    `json:"importance"`
	Reason     string `json:"reason"`
}

UpdatedFact represents changes to an existing fact.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL