Documentation
¶
Index ¶
- Constants
- func ObsidianURI(vaultName, filePath string) string
- type ChunkRecord
- type Result
- type Store
- func (s *Store) Backlinks(ctx context.Context, targetSlug string) ([]Result, error)
- func (s *Store) Close() error
- func (s *Store) Connections(ctx context.Context, seedSlug string, maxHops int) ([]Result, error)
- func (s *Store) DeleteNoteChunks(ctx context.Context, noteSlug string) error
- func (s *Store) GetNoteHashes(ctx context.Context) (map[string]string, error)
- func (s *Store) GraphBoostedSearch(ctx context.Context, queryVec []float32, seedSlug string, boost float64, ...) ([]Result, error)
- func (s *Store) HiddenConnections(ctx context.Context, queryVec []float32, seedSlug string, limit int) ([]Result, error)
- func (s *Store) Reset(ctx context.Context) error
- func (s *Store) SemanticSearch(ctx context.Context, queryVec []float32, limit int, ...) ([]Result, error)
- func (s *Store) SharedTags(ctx context.Context, noteSlug string, minShared int) ([]Result, error)
- func (s *Store) Stats(ctx context.Context) (map[string]int64, error)
- func (s *Store) UpsertChunks(ctx context.Context, chunks []ChunkRecord) error
- func (s *Store) UpsertLinks(ctx context.Context, noteSlug string, links []string) error
Constants ¶
const ( CollectionChunks = "nb_chunks" CollectionLinks = "nb_links" )
Variables ¶
This section is empty.
Functions ¶
func ObsidianURI ¶ added in v1.1.0
ObsidianURI builds an obsidian://open URI for a vault-relative file path.
Types ¶
type ChunkRecord ¶
type Result ¶
type Result struct {
NoteSlug string
Title string
FilePath string
Score float64
Extra string // e.g. shared tags, hop count
}
Result is one row returned by any query.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store wraps two ChromaDB collections.
func (*Store) Connections ¶
Connections finds notes reachable from seedSlug within maxHops. BFS implemented in Go (no recursive SQL needed).
func (*Store) DeleteNoteChunks ¶
DeleteNoteChunks removes all chunks belonging to a note (before re-ingest).
func (*Store) GetNoteHashes ¶
GetNoteHashes fetches the content_hash for all notes by reading chunk_index=0. Returns a map of note_slug -> content_hash.
func (*Store) GraphBoostedSearch ¶
func (s *Store) GraphBoostedSearch(ctx context.Context, queryVec []float32, seedSlug string, boost float64, limit int) ([]Result, error)
GraphBoostedSearch runs semantic search, then boosts scores of notes directly linked to/from seedSlug.
func (*Store) HiddenConnections ¶
func (s *Store) HiddenConnections(ctx context.Context, queryVec []float32, seedSlug string, limit int) ([]Result, error)
HiddenConnections finds notes semantically similar to queryVec but NOT already linked to/from seedSlug.
func (*Store) SemanticSearch ¶
func (s *Store) SemanticSearch(ctx context.Context, queryVec []float32, limit int, whereFilter chroma.WhereFilter) ([]Result, error)
SemanticSearch finds the most similar chunks to queryVec. Returns deduplicated notes (best chunk per note).
func (*Store) SharedTags ¶
SharedTags finds notes sharing at least minShared tags with noteSlug.
func (*Store) UpsertChunks ¶
func (s *Store) UpsertChunks(ctx context.Context, chunks []ChunkRecord) error
UpsertChunks stores a batch of chunks (upsert = insert or replace by ID). Call DeleteNoteChunks first to cleanly re-ingest a note.