Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEmbedderFromEnv ¶
DefaultEmbedderFromEnv creates an OpenAI-compatible embedder from environment variables:
- LLM_BASE_URL — base URL (default: http://localhost:11434/v1)
- LLM_API_KEY — API key (default: ollama)
- LLM_EMBED_MODEL — embedding model (default: nomic-embed-text)
Returns nil if LLM_BASE_URL is explicitly set to empty.
Types ¶
type CSVSource ¶
type CSVSource struct {
// contains filtered or unexported fields
}
CSVSource reads a CSV file and indexes each row as a text document via a Pipeline.
func NewCSVSource ¶
NewCSVSource creates a CSVSource for the given file path.
type JSONSource ¶
type JSONSource struct {
// contains filtered or unexported fields
}
JSONSource reads a JSON file and indexes its flattened content via a Pipeline.
func NewJSONSource ¶
func NewJSONSource(path string) *JSONSource
NewJSONSource creates a JSONSource for the given file path.
type KnowledgeSource ¶
type KnowledgeSource interface {
Load(ctx context.Context, pipeline *Pipeline) error
Query(ctx context.Context, query string, limit int) ([]Chunk, error)
}
KnowledgeSource is the interface for document sources that can load content into a pipeline and answer queries against the indexed data.
type PDFSource ¶
type PDFSource struct {
// contains filtered or unexported fields
}
PDFSource reads a PDF file and indexes its text content via a Pipeline.
func NewPDFSource ¶
NewPDFSource creates a PDFSource for the given file path.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline wraps a draftRAG pipeline with an in-memory store. Each agent should create one shared pipeline for all its knowledge sources.
func NewPipeline ¶
NewPipeline creates a new Pipeline wrapper with an in-memory vector store.
type TextFileSource ¶
type TextFileSource struct {
// contains filtered or unexported fields
}
TextFileSource reads a .txt file and indexes its content via a Pipeline.
func NewTextFileSource ¶
func NewTextFileSource(path string) *TextFileSource
NewTextFileSource creates a TextFileSource for the given file path.
type URLSource ¶
type URLSource struct {
// contains filtered or unexported fields
}
URLSource fetches a web page and indexes its text content via a Pipeline.
func NewURLSource ¶
NewURLSource creates a URLSource for the given URL with a default 10s timeout.