Versions in this module Expand all Collapse all v0 v0.5.0 May 11, 2026 Changes in this version type Store + func (s *Store) FindByPrefix(ctx context.Context, prefix string) ([]*Node, error) v0.4.0 May 5, 2026 v0.3.0 May 3, 2026 Changes in this version + var ErrBatchTooLarge = errors.New("batch size exceeds database limit") + var ErrContentTooLong = errors.New("content exceeds maximum length") + var ErrCycleDetected = errors.New("cycle detected") + var ErrDatabaseLocked = errors.New("database is locked") + var ErrDuplicateEdge = errors.New("duplicate edge") + var ErrDuplicateNode = errors.New("duplicate node") + var ErrEdgeNotFound = errors.New("edge not found") + var ErrEmbeddingNotFound = errors.New("embedding not found") + var ErrEmptyContent = errors.New("content cannot be empty") + var ErrInvalidEdgeType = errors.New("invalid edge type") + var ErrInvalidNodeType = errors.New("invalid node type") + var ErrNodeNotFound = errors.New("node not found") + var ErrSessionNotFound = errors.New("session not found") + var ErrVersionNotFound = errors.New("version not found") + func ComputeSchemaFingerprint(chunkerVersion, embeddingModel string) string + func ComputeSchemaVersion(chunkerVersion, modelName string) string + func DecodeVector(b []byte) []float32 + func EncodeVector(v []float32) []byte + type CodeChunkRecord struct + Content string + EndLine int + FileHash string + ID string + Language string + Path string + SchemaVersion string + StartLine int + Symbol string + Tokens int + Vector []byte + type Edge struct + Acyclic bool + CreatedAt time.Time + FromID string + ID string + InvalidAt time.Time + Metadata string + ToID string + Type string + ValidAt time.Time + Weight float64 + type Node struct + AccessCount int + AccessedAt time.Time + Confidence float64 + Content string + ContentHash string + CreatedAt time.Time + ID string + Key string + Pinned bool + Project string + Scope string + SourceAgent string + SourceSession string + Summary string + Tags string + Tier int + Type string + UpdatedAt time.Time + Version int + type NodeFilter struct + Limit int + MinConfidence float64 + Pinned *bool + Project string + Scope string + SourceSession string + Tier int + Type string + type NodeVersion struct + ChangedAt time.Time + ChangedBy string + Content string + NodeID string + Reason string + Version int + type ReplayEvent struct + CreatedAt time.Time + Data string + ID int64 + SessionID string + type Session struct + Agent string + EndedAt time.Time + ID string + Project string + StartedAt time.Time + Summary string + type Storage interface + AddFileWatch func(ctx context.Context, filePath, nodeID, gitHash string) error + AddReplayEvent func(ctx context.Context, sessionID, data string) error + AllEmbeddings func(ctx context.Context) (map[string][]float32, error) + CheckCycle func(ctx context.Context, fromID, toID string) (bool, error) + Close func() error + CountAllEdges func(ctx context.Context) (int, error) + CountEdges func(ctx context.Context, nodeID string) (inbound int, outbound int, err error) + CreateEdge func(ctx context.Context, e *Edge) error + CreateNode func(ctx context.Context, n *Node) error + CreateSession func(ctx context.Context, sess *Session) error + DeleteEdge func(ctx context.Context, id string) error + DeleteEmbedding func(ctx context.Context, nodeID string) error + DeleteNode func(ctx context.Context, id string) error + EndSession func(ctx context.Context, id string, summary string) error + FlushAccessLog func(ctx context.Context) (int, error) + GetEdge func(ctx context.Context, id string) (*Edge, error) + GetEdgesBetween func(ctx context.Context, nodeIDs []string) ([]*Edge, error) + GetEdgesFrom func(ctx context.Context, nodeID string) ([]*Edge, error) + GetEdgesTo func(ctx context.Context, nodeID string) ([]*Edge, error) + GetEmbeddingsBatch func(ctx context.Context, offset, limit int) (map[string][]float32, error) + GetNeighbors func(ctx context.Context, nodeID string) ([]*Node, error) + GetNode func(ctx context.Context, id string) (*Node, error) + GetNodeByKey func(ctx context.Context, key, project string) (*Node, error) + GetNodesBatch func(ctx context.Context, ids []string) ([]*Node, error) + GetReplayEvents func(ctx context.Context, sessionID string) ([]*ReplayEvent, error) + GetVersions func(ctx context.Context, nodeID string) ([]*NodeVersion, error) + InvalidateEdge func(ctx context.Context, id string) error + ListNodes func(ctx context.Context, f NodeFilter) ([]*Node, error) + ListSessions func(ctx context.Context, project string, limit int) ([]*Session, error) + LogAccess func(ctx context.Context, nodeID string) error + SaveEmbedding func(ctx context.Context, nodeID, model string, vector []float32) error + SaveVersion func(ctx context.Context, nodeID string, content, changedBy, reason string) error + SearchNodeByHash func(ctx context.Context, hash, scope, project string) (*Node, error) + SearchNodes func(ctx context.Context, query string, limit int) ([]*Node, error) + UpdateNode func(ctx context.Context, n *Node) error + UpdateNodeContent func(ctx context.Context, id, newContent string) error + WithTx func(ctx context.Context, fn func(Storage) error) error + type Store struct + func NewStore(dbPath string) (*Store, error) + func (s *Store) AddFileWatch(ctx context.Context, filePath, nodeID, gitHash string) error + func (s *Store) AddReplayEvent(ctx context.Context, sessionID, data string) error + func (s *Store) AllEmbeddings(ctx context.Context) (map[string][]float32, error) + func (s *Store) CheckCycle(ctx context.Context, fromID, toID string) (bool, error) + func (s *Store) Close() error + func (s *Store) CountAllEdges(ctx context.Context) (int, error) + func (s *Store) CountEdges(ctx context.Context, nodeID string) (inbound int, outbound int, err error) + func (s *Store) CreateCodeIndex(ctx context.Context) error + func (s *Store) CreateEdge(ctx context.Context, e *Edge) error + func (s *Store) CreateNode(ctx context.Context, n *Node) error + func (s *Store) CreateSession(ctx context.Context, sess *Session) error + func (s *Store) DB() *sql.DB + func (s *Store) DeleteChunksByPath(ctx context.Context, path string) error + func (s *Store) DeleteEdge(ctx context.Context, id string) error + func (s *Store) DeleteEmbedding(ctx context.Context, nodeID string) error + func (s *Store) DeleteNode(ctx context.Context, id string) error + func (s *Store) DiffVersions(ctx context.Context, nodeID string, v1, v2 int) (content1, content2 string, err error) + func (s *Store) EndSession(ctx context.Context, id string, summary string) error + func (s *Store) FlushAccessLog(ctx context.Context) (int, error) + func (s *Store) GetEdge(ctx context.Context, id string) (*Edge, error) + func (s *Store) GetEdgesBetween(ctx context.Context, nodeIDs []string) ([]*Edge, error) + func (s *Store) GetEdgesFrom(ctx context.Context, nodeID string) ([]*Edge, error) + func (s *Store) GetEdgesTo(ctx context.Context, nodeID string) ([]*Edge, error) + func (s *Store) GetEmbedding(ctx context.Context, nodeID string) ([]float32, string, error) + func (s *Store) GetEmbeddingsBatch(ctx context.Context, offset, limit int) (map[string][]float32, error) + func (s *Store) GetFileHash(ctx context.Context, path string) (string, error) + func (s *Store) GetNeighbors(ctx context.Context, nodeID string) ([]*Node, error) + func (s *Store) GetNode(ctx context.Context, id string) (*Node, error) + func (s *Store) GetNodeByKey(ctx context.Context, key, project string) (*Node, error) + func (s *Store) GetNodesBatch(ctx context.Context, ids []string) ([]*Node, error) + func (s *Store) GetNodesByFile(ctx context.Context, filePath string) ([]*Node, error) + func (s *Store) GetReplayEvents(ctx context.Context, sessionID string) ([]*ReplayEvent, error) + func (s *Store) GetVersions(ctx context.Context, nodeID string) ([]*NodeVersion, error) + func (s *Store) InvalidateEdge(ctx context.Context, id string) error + func (s *Store) InvalidateStaleChunks(ctx context.Context, currentVersion string) (int, error) + func (s *Store) ListIndexedPaths(ctx context.Context) ([]string, error) + func (s *Store) ListNodes(ctx context.Context, f NodeFilter) ([]*Node, error) + func (s *Store) ListSessions(ctx context.Context, project string, limit int) ([]*Session, error) + func (s *Store) LogAccess(ctx context.Context, nodeID string) error + func (s *Store) RefreshCodeIndex(ctx context.Context, paths []string, hashFn func(string) string) (int, error) + func (s *Store) RollbackToVersion(ctx context.Context, nodeID string, version int) error + func (s *Store) SaveEmbedding(ctx context.Context, nodeID, model string, vector []float32) error + func (s *Store) SaveVersion(ctx context.Context, nodeID string, content, changedBy, reason string) error + func (s *Store) SearchCodeChunksByLanguage(ctx context.Context, query string, languages []string, limit int) ([]*CodeChunkRecord, error) + func (s *Store) SearchCodeChunksFTS(ctx context.Context, query string, limit int) ([]*CodeChunkRecord, error) + func (s *Store) SearchCodeChunksHybrid(ctx context.Context, query string, queryVec []float32, limit int, ...) ([]*CodeChunkRecord, error) + func (s *Store) SearchNodeByHash(ctx context.Context, hash, scope, project string) (*Node, error) + func (s *Store) SearchNodes(ctx context.Context, query string, limit int) ([]*Node, error) + func (s *Store) StoreVector(ctx context.Context, chunkID string, vec []float32) error + func (s *Store) UpdateNode(ctx context.Context, n *Node) error + func (s *Store) UpdateNodeContent(ctx context.Context, id, newContent string) error + func (s *Store) UpsertByTopic(ctx context.Context, n *Node, topicKey string) (*Node, bool, error) + func (s *Store) UpsertCodeChunk(ctx context.Context, chunk *CodeChunkRecord) error + func (s *Store) WithTx(ctx context.Context, fn func(Storage) error) error