Documentation
¶
Index ¶
- func DecodeVector(b []byte) []float32
- func EncodeVector(v []float32) []byte
- type Edge
- type Node
- type NodeFilter
- type NodeVersion
- type ReplayEvent
- type Session
- type Store
- func (s *Store) AddFileWatch(filePath, nodeID, gitHash string) error
- func (s *Store) AddReplayEvent(sessionID, data string) error
- func (s *Store) AllEmbeddings() (map[string][]float32, error)
- func (s *Store) Close() error
- func (s *Store) CreateEdge(e *Edge) error
- func (s *Store) CreateNode(n *Node) error
- func (s *Store) CreateSession(sess *Session) error
- func (s *Store) DB() *sql.DB
- func (s *Store) DeleteEdge(id string) error
- func (s *Store) DeleteNode(id string) error
- func (s *Store) EndSession(id string, summary string) error
- func (s *Store) GetEdge(id string) (*Edge, error)
- func (s *Store) GetEdgesFrom(nodeID string) ([]*Edge, error)
- func (s *Store) GetEdgesTo(nodeID string) ([]*Edge, error)
- func (s *Store) GetEmbedding(nodeID string) ([]float32, string, error)
- func (s *Store) GetNeighbors(nodeID string) ([]*Node, error)
- func (s *Store) GetNode(id string) (*Node, error)
- func (s *Store) GetNodesByFile(filePath string) ([]*Node, error)
- func (s *Store) GetReplayEvents(sessionID string) ([]*ReplayEvent, error)
- func (s *Store) GetVersions(nodeID string) ([]*NodeVersion, error)
- func (s *Store) ListNodes(f NodeFilter) ([]*Node, error)
- func (s *Store) ListSessions(project string, limit int) ([]*Session, error)
- func (s *Store) SaveEmbedding(nodeID, model string, vector []float32) error
- func (s *Store) SaveVersion(nodeID string, content, changedBy, reason string) error
- func (s *Store) SearchNodeByHash(hash, scope, project string) (*Node, error)
- func (s *Store) SearchNodes(query string, limit int) ([]*Node, error)
- func (s *Store) UpdateNode(n *Node) error
- func (s *Store) UpsertByTopic(n *Node, topicKey string) (*Node, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeVector ¶
DecodeVector decodes a byte slice from SQLite BLOB to a float32 slice.
func EncodeVector ¶
EncodeVector encodes a float32 slice to a byte slice for SQLite BLOB storage.
Types ¶
type Edge ¶
type Edge struct {
ID, FromID, ToID, Type, Metadata string
Acyclic bool
Weight float64
CreatedAt time.Time
}
Edge represents a relationship between two nodes in the graph.
type Node ¶
type Node struct {
ID, Type, Content, ContentHash, Summary, Scope, Project, Tags string
Tier int
Confidence float64
AccessCount int
CreatedAt, UpdatedAt, AccessedAt time.Time
SourceSession, SourceAgent string
Version int
}
Node represents a memory node in the Yaad graph.
type NodeFilter ¶
NodeFilter specifies criteria for listing nodes.
type NodeVersion ¶
type NodeVersion struct {
NodeID, Content, ChangedBy, Reason string
Version int
ChangedAt time.Time
}
NodeVersion stores a historical version of a node for audit/rollback.
type ReplayEvent ¶
ReplayEvent is a raw tool event stored for session replay.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the SQLite-backed storage layer for Yaad.
func (*Store) AddFileWatch ¶
func (*Store) AddReplayEvent ¶
AddReplayEvent stores a tool event for replay.
func (*Store) AllEmbeddings ¶
AllEmbeddings returns all stored embeddings as (nodeID, vector) pairs.
func (*Store) CreateEdge ¶
func (*Store) CreateNode ¶
func (*Store) CreateSession ¶
func (*Store) DeleteEdge ¶
func (*Store) DeleteNode ¶
func (*Store) GetEmbedding ¶
GetEmbedding retrieves the embedding for a node.
func (*Store) GetReplayEvents ¶
func (s *Store) GetReplayEvents(sessionID string) ([]*ReplayEvent, error)
GetReplayEvents returns all events for a session in order.
func (*Store) GetVersions ¶
func (s *Store) GetVersions(nodeID string) ([]*NodeVersion, error)
func (*Store) ListSessions ¶
func (*Store) SaveEmbedding ¶
SaveEmbedding stores a vector embedding for a node.
func (*Store) SaveVersion ¶
func (*Store) SearchNodeByHash ¶
SearchNodeByHash finds a node by content hash + scope + project (dedup check).
func (*Store) UpdateNode ¶
func (*Store) UpsertByTopic ¶
UpsertByTopic updates an existing node if one with the same project+scope+topic_key exists, otherwise creates a new one. Based on Engram's topic dedup approach. topic_key is stored in the Tags field as "topic:<key>".