Documentation
¶
Overview ¶
SPDX-License-Identifier: MIT Purpose: text embedding via NVIDIA NIM. Uses nv-embed-v1 (or any OpenAI-compatible /v1/embeddings endpoint).
SPDX-License-Identifier: MIT Purpose: long-term project memory — bbolt-backed knowledge store with semantic search via NIM embeddings. Inspired by beads (gastownhall/beads).
SPDX-License-Identifier: MIT Purpose: semantic search, knowledge graph traversal, and prime-context injection for agents. All in-memory over the Store.
SPDX-License-Identifier: MIT Purpose: bbolt-backed Memory store with embeddings, links, and append-only audit log. Embeddings are cached in-memory by text hash.
Index ¶
- Constants
- Variables
- func CosineSimilarity(a, b []float32) float64
- func GenerateID(insight string) string
- func NoopEmbedding(text string) ([]float32, error)
- func NormalizeTags(tags []string) []string
- func SetEmbedder(fn EmbeddingFunc, dim int)
- func SetupNIMEmbedder()
- type EmbedRequest
- type EmbedResponse
- type Embedder
- type EmbeddingFunc
- type Link
- type LinkType
- type ListFilter
- type Memory
- type ScoredMemory
- type Store
- func (s *Store) Add(m *Memory) error
- func (s *Store) AddLink(l Link) error
- func (s *Store) Close() error
- func (s *Store) Delete(id string, hard bool) error
- func (s *Store) EmbeddingStatus() (bool, int)
- func (s *Store) Get(id string) (*Memory, error)
- func (s *Store) GetLinks(id string) ([]Link, error)
- func (s *Store) Graph(rootID string, maxDepth int) (map[string][]Link, error)
- func (s *Store) List(f ListFilter) ([]*Memory, error)
- func (s *Store) Path() string
- func (s *Store) Prime(query string, project string, topK int) (string, error)
- func (s *Store) RemoveLink(from, to string) error
- func (s *Store) Search(query string, project string, limit int) ([]ScoredMemory, error)
- func (s *Store) Stats() (map[string]int, error)
Constants ¶
const NIMEmbedBaseURL = "https://integrate.api.nvidia.com/v1"
const NIMEmbedModel = "nvidia/nv-embed-v1"
Variables ¶
var (
ErrNotFound = errors.New("memory: not found")
)
var ValidLinkTypes = []LinkType{LinkReferences, LinkSupports, LinkContradicts, LinkExtends, LinkCauses}
Functions ¶
func CosineSimilarity ¶
func GenerateID ¶
func NoopEmbedding ¶
NoopEmbedding returns an empty vector — used when no embedder is configured.
func NormalizeTags ¶
func SetEmbedder ¶
func SetEmbedder(fn EmbeddingFunc, dim int)
func SetupNIMEmbedder ¶
func SetupNIMEmbedder()
SetupNIMEmbedder registers the NIM embedder as the default.
Types ¶
type EmbedRequest ¶
type EmbedResponse ¶
type EmbeddingFunc ¶
func GetEmbedder ¶
func GetEmbedder() (EmbeddingFunc, int)
type ListFilter ¶
type ScoredMemory ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) EmbeddingStatus ¶
func (*Store) Graph ¶
Graph traverses the knowledge graph from a starting node, returning all reachable nodes within maxDepth hops.
func (*Store) Prime ¶
Prime builds a context string with the top-K most relevant memories for the given query, formatted for injection into an LLM prompt.