Documentation
¶
Index ¶
- func DBPath(outDir string) string
- func EnsureGraphSync(graphPath string, graph *types.Graph) (string, error)
- func SetEmbedTextsForTesting(fn func([]string) ([][]float32, error)) func()
- func SyncGraph(graph *types.Graph, dbPath string) error
- type EdgeContext
- type EmbeddingRuntime
- type Metadata
- type Result
- func SearchLexical(dbPath, input string, limit int) ([]Result, int, error)
- func SearchLexicalWithOptions(dbPath, input string, opts SearchOptions) ([]Result, int, error)
- func SearchVector(dbPath, input string, limit int) ([]Result, int, error)
- func SearchVectorWithOptions(dbPath, input string, opts SearchOptions) ([]Result, int, error)
- type SearchOptions
- type StructuralResult
- type TraversalOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureGraphSync ¶
EnsureGraphSync refreshes the retrieval substrate when graph.json is newer or the SQLite DB does not exist yet.
func SetEmbedTextsForTesting ¶
SetEmbedTextsForTesting overrides embedding generation inside tests.
Types ¶
type EdgeContext ¶
type EdgeContext struct {
FromID string
FromLabel string
ToID string
ToLabel string
Relation string
Direction string
Hop int
}
EdgeContext is compact support for why a structural result was included.
type EmbeddingRuntime ¶
type EmbeddingRuntime struct {
Provider string
Model string
Endpoint string
VectorSearchMode string
VectorIndex string
RequestedVectorBackend string
SQLiteVecPath string
SQLiteVecEnabled bool
SQLiteVecReason string
}
EmbeddingRuntime captures runtime/provenance for persisted vectors.
func CurrentEmbeddingRuntime ¶
func CurrentEmbeddingRuntime() (EmbeddingRuntime, error)
type Metadata ¶
type Metadata struct {
EmbeddingProvider string
EmbeddingModel string
EmbeddingEndpoint string
VectorSearchMode string
VectorIndex string
RequestedVectorBackend string
SQLiteVecPath string
SQLiteVecEnabled bool
SQLiteVecReason string
EmbeddingDims int
}
Metadata records retrieval substrate provenance and vector runtime details.
func LoadMetadata ¶
type Result ¶
type Result struct {
ID string
Label string
Kind string
Path string
Description string
MetadataText string
SourceType string
SourceName string
SourcePath string
SourceRemote string
Score float64
}
Result is one lexical hit returned from the SQLite substrate.
Source* fields carry the repo-local provenance of the underlying node so that retrieval remains repo-scoped and explainable. Fused results can use them to attribute evidence back to the originating repo without re-reading graph.json.
func SearchLexical ¶
SearchLexical runs FTS5 over the materialized graph nodes. It is a convenience wrapper that delegates to SearchLexicalWithOptions with default (unscoped) options.
func SearchLexicalWithOptions ¶
func SearchLexicalWithOptions(dbPath, input string, opts SearchOptions) ([]Result, int, error)
SearchLexicalWithOptions runs FTS5 over the materialized graph nodes with an optional repo scope applied at the SQL layer. Repo scoping matches the stored source_name column so that retrieval stays repo-bounded.
func SearchVector ¶
SearchVector runs local vector retrieval over stored node embeddings using default (unscoped) options.
func SearchVectorWithOptions ¶
func SearchVectorWithOptions(dbPath, input string, opts SearchOptions) ([]Result, int, error)
SearchVectorWithOptions runs local vector retrieval with an optional repo scope applied to the stored node vectors. Embeddings are kept locally in SQLite and the repo filter ensures retrieval stays repo-scoped rather than querying a global deep index.
type SearchOptions ¶
type SearchOptions struct {
// Limit caps the number of returned hits. Zero falls back to a sensible
// default (5) inside each search function.
Limit int
// Repo scopes the query to a single repo by matching the stored
// source_name column. Empty means no repo filter.
Repo string
// SourceType scopes retrieval to one stored source type. Empty means no
// source-type filter.
SourceType string
}
SearchOptions narrows a repo-local retrieval query. The zero value runs an unscoped query, which matches the historical behavior of SearchLexical and SearchVector.
type StructuralResult ¶
type StructuralResult struct {
Result
Context []EdgeContext
}
StructuralResult is one graph-structural candidate.
func ExpandStructural ¶
func ExpandStructural(dbPath string, seeds []Result, opts TraversalOptions) ([]StructuralResult, int, error)
ExpandStructural walks the persisted graph outward from lexical seeds.