database

package
v1.164.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CosineSimilarity

func CosineSimilarity(a, b []float64) float64

CosineSimilarity calculates cosine similarity between two vectors

Types

type Document

type Document struct {
	ID         string `json:"id"`
	SourcePath string `json:"source_path"`
	ChunkIndex int    `json:"chunk_index"`
	Content    string `json:"content"`
	FileHash   string `json:"file_hash"`
	CreatedAt  string `json:"created_at"`
}

Document represents a chunk of text - the base type returned by all RAG strategies. Strategy-specific fields (embeddings, semantic summaries) are handled internally by each strategy and don't need to be exposed here.

type FileMetadata

type FileMetadata struct {
	SourcePath  string
	FileHash    string
	LastIndexed string
	ChunkCount  int
}

FileMetadata represents metadata about an indexed file. Used for change detection and incremental indexing.

type SearchResult

type SearchResult struct {
	Document   Document `json:"document"`
	Similarity float64  `json:"similarity"`
}

SearchResult represents a document with its relevance score. This is the common return type for all Strategy.Query() implementations.

Jump to

Keyboard shortcuts

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