Documentation
¶
Index ¶
- type MatrixEngine
- func (e *MatrixEngine) AddNeuron(content string, parentID *core.NeuronID, metadata map[string]string) (*core.Neuron, error)
- func (e *MatrixEngine) DeleteNeuron(id core.NeuronID) error
- func (e *MatrixEngine) GetNeuron(id core.NeuronID) (*core.Neuron, error)
- func (e *MatrixEngine) GetStats() map[string]any
- func (e *MatrixEngine) ListNeurons(offset, limit int, depthFilter *int) []*core.Neuron
- func (e *MatrixEngine) Search(query string, depth int, limit int, metadata map[string]string, strict bool) []*core.Neuron
- func (e *MatrixEngine) SetAlpha(alpha float64)
- func (e *MatrixEngine) SetQueryRepeat(n int)
- func (e *MatrixEngine) SetSentimentAnalyzer(a *sentiment.Analyzer)
- func (e *MatrixEngine) SetVectorizer(v *vector.Vectorizer)
- func (e *MatrixEngine) UpdateNeuron(id core.NeuronID, newContent string) error
- type SearchResult
- type Searcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MatrixEngine ¶
type MatrixEngine struct {
// contains filtered or unexported fields
}
MatrixEngine handles all matrix operations
func NewMatrixEngine ¶
func NewMatrixEngine(matrix *core.Matrix) *MatrixEngine
NewMatrixEngine creates a new engine for a matrix
func (*MatrixEngine) AddNeuron ¶
func (e *MatrixEngine) AddNeuron(content string, parentID *core.NeuronID, metadata map[string]string) (*core.Neuron, error)
AddNeuron creates a new neuron and positions it organically. metadata is optional key-value pairs (e.g. thread_id, role, source).
func (*MatrixEngine) DeleteNeuron ¶
func (e *MatrixEngine) DeleteNeuron(id core.NeuronID) error
DeleteNeuron removes a neuron and its synapses
func (*MatrixEngine) GetStats ¶
func (e *MatrixEngine) GetStats() map[string]any
GetStats returns matrix statistics
func (*MatrixEngine) ListNeurons ¶
func (e *MatrixEngine) ListNeurons(offset, limit int, depthFilter *int) []*core.Neuron
ListNeurons returns all neurons sorted by energy
func (*MatrixEngine) Search ¶
func (e *MatrixEngine) Search(query string, depth int, limit int, metadata map[string]string, strict bool) []*core.Neuron
Search finds neurons matching a pattern with activation spread. metadata is an optional filter/boost map (e.g. {"thread_id": "conv-xyz"}). strict=false (default): metadata keys boost matching neurons; all neurons remain eligible. strict=true: only neurons whose metadata contains ALL specified key-value pairs are returned.
func (*MatrixEngine) SetAlpha ¶
func (e *MatrixEngine) SetAlpha(alpha float64)
SetAlpha sets the vector score weight for hybrid search.
func (*MatrixEngine) SetQueryRepeat ¶
func (e *MatrixEngine) SetQueryRepeat(n int)
SetQueryRepeat sets the query repetition count for embedding.
func (*MatrixEngine) SetSentimentAnalyzer ¶
func (e *MatrixEngine) SetSentimentAnalyzer(a *sentiment.Analyzer)
SetSentimentAnalyzer attaches a sentiment analyzer for auto-labeling on write.
func (*MatrixEngine) SetVectorizer ¶
func (e *MatrixEngine) SetVectorizer(v *vector.Vectorizer)
SetVectorizer attaches a vectorizer to the engine for auto-embedding.
func (*MatrixEngine) UpdateNeuron ¶
func (e *MatrixEngine) UpdateNeuron(id core.NeuronID, newContent string) error
UpdateNeuron modifies a neuron's content
type SearchResult ¶
SearchResult holds a neuron with its relevance score
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
Searcher provides advanced search capabilities
func NewSearcher ¶
NewSearcher creates a new searcher
func (*Searcher) SetMetadata ¶
SetMetadata configures optional metadata filtering/boosting. strict=false: matching neurons get a score boost (1.3x per matching key). strict=true: only neurons that match ALL key-value pairs are returned.
func (*Searcher) SetSentimentAnalyzer ¶
SetSentimentAnalyzer attaches a sentiment analyzer to the searcher.
func (*Searcher) SetVectorizer ¶
func (s *Searcher) SetVectorizer(v *vector.Vectorizer, alpha float64, queryRepeat int)
SetVectorizer attaches a vectorizer, alpha weight, and query repeat count to the searcher.