rag

package
v0.0.0-...-99d71fe Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RagAgent

type RagAgent struct {
	Name    string
	ModelID string
	// contains filtered or unexported fields
}

func NewRagAgent

func NewRagAgent(ctx context.Context, ragAgentConfig agents.AgentConfig, storeConfig StoreConfig, opts ...RagAgentOption) (*RagAgent, error)

func (*RagAgent) AddTextChunksToStore

func (agent *RagAgent) AddTextChunksToStore(chunks []text.TextChunk) (int, error)

func (*RagAgent) GetInfo

func (agent *RagAgent) GetInfo() (agents.RagAgentInfo, error)

func (*RagAgent) GetName

func (agent *RagAgent) GetName() string

func (*RagAgent) GetNumberOfDocuments

func (agent *RagAgent) GetNumberOfDocuments() int

getNumberOfDocuments returns the number of documents in the store

func (*RagAgent) IsStoreInitialized

func (agent *RagAgent) IsStoreInitialized() bool

isStoreInitialized checks if the document store is initialized

func (*RagAgent) Kind

func (agent *RagAgent) Kind() agents.AgentKind

func (*RagAgent) SearchSimilarities

func (agent *RagAgent) SearchSimilarities(query string) ([]string, error)

type RagAgentOption

type RagAgentOption func(*RagAgent)

AgentOption defines a functional option for configuring LocalAIAgent

func WithLogLevel

func WithLogLevel(level logger.LogLevel) RagAgentOption

WithLogLevel sets the log level for the agent

func WithLogger

func WithLogger(log logger.Logger) RagAgentOption

WithLogger sets a custom logger for the agent

func WithVerbose

func WithVerbose(verbose bool) RagAgentOption

WithVerbose enables verbose logging (INFO level) with agent name prefix

type StoreConfig

type StoreConfig struct {
	StoreName string
	StorePath string
}

type TextChunk

type TextChunk struct {
	Content  string
	Metadata map[string]any
}