Documentation
¶
Index ¶
- type Chunk
- type Database
- func (d *Database) Close() error
- func (d *Database) DeleteDocument(source string) error
- func (d *Database) DocumentExists(source string) (bool, error)
- func (d *Database) IndexDocument(source, sourceType, title string, chunks []Chunk) error
- func (d *Database) ListDocuments(sourceTypeFilter string) ([]Document, error)
- func (d *Database) Search(queryEmbedding []float32, topK int, minScore float64, sourceFilter string) ([]SearchResult, error)
- type Document
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk struct {
ID int64
DocumentID int64
ChunkIndex int
Content string
StartOffset int
EndOffset int
Embedding []float32
}
Chunk represents a text chunk with its embedding
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database handles SQLite operations with vector search
func NewDatabase ¶
NewDatabase creates a new database connection and initializes schema Note: sqlite_vec.Auto() must be called before creating the database
func (*Database) DeleteDocument ¶
DeleteDocument deletes a document and its chunks by source
func (*Database) DocumentExists ¶
DocumentExists checks if a document exists by source
func (*Database) IndexDocument ¶
IndexDocument stores a document with its chunks and embeddings
func (*Database) ListDocuments ¶
ListDocuments returns all indexed documents with optional source type filter
Click to show internal directories.
Click to hide internal directories.