assistant

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAssistantNotFound = errors.New("assistant: not found")
)
View Source
var (
	ErrMemoryNotFound = errors.New("assistant: memory key not found")
)

Functions

This section is empty.

Types

type AssistantConfig

type AssistantConfig struct {
	AssistantID     string
	Soul            AssistantSoul
	Skills          []string
	Policies        []string
	MemoryScope     string
	ToolAllowedList []skills.CapabilityType
}

AssistantConfig holds the configuration needed to bootstrap an AssistantRuntime.

type AssistantMemory

type AssistantMemory interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Set(ctx context.Context, key string, value []byte) error
	Search(ctx context.Context, query string, limit int) ([]SearchResult, error)
}

AssistantMemory defines the contract for storing and searching assistant knowledge.

type AssistantProfile

type AssistantProfile struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Version     string `json:"version"`
}

AssistantProfile defines the static metadata for an assistant. It represents the "identity" of the assistant, which can be reused across multiple sessions and tenants if permitted.

type AssistantRegistry

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

AssistantRegistry manages the registration and lookup of assistant definitions.

func NewAssistantRegistry

func NewAssistantRegistry() *AssistantRegistry

NewAssistantRegistry creates a new in-memory registry.

func (*AssistantRegistry) GetConfig

func (r *AssistantRegistry) GetConfig(id string) (AssistantConfig, error)

GetConfig retrieves an assistant's default configuration by ID.

func (*AssistantRegistry) GetProfile

func (r *AssistantRegistry) GetProfile(id string) (AssistantProfile, error)

GetProfile retrieves an assistant profile by ID.

func (*AssistantRegistry) Register

func (r *AssistantRegistry) Register(profile AssistantProfile, config AssistantConfig)

Register adds an assistant profile and its default configuration to the registry.

type AssistantRuntime

type AssistantRuntime struct {
	AssistantID string
	TenantID    string

	// Soul defines the personality and behavioral instructions.
	Soul AssistantSoul

	// Memory provides access to ephemeral and persistent knowledge.
	Memory AssistantMemory

	// Skills available to this specific assistant instance.
	Skills []string

	// Policies enforce security and governance boundaries.
	Policies []string

	// MemoryScope defines the visibility and persistence of memory.
	MemoryScope string

	// ToolPermissions define which tools the assistant can invoke.
	ToolPermissions []string
}

AssistantRuntime represents the active, request-scoped state of an assistant. It governs what the assistant can do and what data it can access.

type AssistantSoul

type AssistantSoul struct {
	SystemPrompt  string   `json:"system_prompt"`
	Personality   string   `json:"personality"`
	Instructions  string   `json:"instructions"`
	AllowedSkills []string `json:"allowed_skills"`
	AllowedTools  []string `json:"allowed_tools"`
}

AssistantSoul defines the behavioral parameters of an assistant. It acts as the "inner logic" and "personality" that guides the LLM.

func DefaultSoul

func DefaultSoul() AssistantSoul

DefaultSoul returns a generic baseline soul.

func LoadSoulFromMarkdown

func LoadSoulFromMarkdown(path string) (AssistantSoul, error)

LoadSoulFromMarkdown attempts to populate an AssistantSoul from a markdown file. It expects specific headers or sections to identify personality and instructions.

type PersistentMemory

type PersistentMemory struct {
}

PersistentMemory is a long-term storage implementation.

func (*PersistentMemory) Get

func (m *PersistentMemory) Get(ctx context.Context, key string) ([]byte, error)

func (*PersistentMemory) Search

func (m *PersistentMemory) Search(ctx context.Context, query string, limit int) ([]SearchResult, error)

func (*PersistentMemory) Set

func (m *PersistentMemory) Set(ctx context.Context, key string, value []byte) error

type SearchResult

type SearchResult struct {
	Content []byte
	Score   float32
}

SearchResult represents a single entry found during a semantic search.

type SessionMemory

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

SessionMemory is an ephemeral, request-scoped memory implementation.

func NewSessionMemory

func NewSessionMemory() *SessionMemory

func (*SessionMemory) Get

func (m *SessionMemory) Get(ctx context.Context, key string) ([]byte, error)

func (*SessionMemory) Search

func (m *SessionMemory) Search(ctx context.Context, query string, limit int) ([]SearchResult, error)

func (*SessionMemory) Set

func (m *SessionMemory) Set(ctx context.Context, key string, value []byte) error

type VectorMemory

type VectorMemory struct {
}

VectorMemory provides semantic search capabilities.

func (*VectorMemory) Get

func (m *VectorMemory) Get(ctx context.Context, key string) ([]byte, error)

func (*VectorMemory) Search

func (m *VectorMemory) Search(ctx context.Context, query string, limit int) ([]SearchResult, error)

func (*VectorMemory) Set

func (m *VectorMemory) Set(ctx context.Context, key string, value []byte) error

Jump to

Keyboard shortcuts

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