Documentation
¶
Overview ¶
NemesisBot - AI agent License: MIT Copyright (c) 2026 NemesisBot contributors
Index ¶
- type Config
- type Entity
- type Store
- func (s *Store) AddEntity(ctx context.Context, entity *Entity) error
- func (s *Store) AddTriple(ctx context.Context, triple *Triple) error
- func (s *Store) Close() error
- func (s *Store) DeleteEntity(ctx context.Context, name string) error
- func (s *Store) EntityCount() int
- func (s *Store) GetEntity(ctx context.Context, name string) (*Entity, error)
- func (s *Store) GetRelated(ctx context.Context, entityName string, depth int) ([]*Triple, error)
- func (s *Store) Query(ctx context.Context, subject, predicate, object string) ([]*Triple, error)
- func (s *Store) Search(ctx context.Context, query string, limit int) ([]*Triple, error)
- func (s *Store) TripleCount() int
- type Triple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
StoragePath string // directory for JSONL files
}
Config holds knowledge graph store configuration.
type Entity ¶
type Entity struct {
Name string `json:"name"`
Type string `json:"type"` // person, place, thing, concept
Properties map[string]string `json:"properties,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
Entity represents a node in the knowledge graph.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements a simple knowledge graph backed by JSONL files.
func (*Store) DeleteEntity ¶
DeleteEntity removes an entity and all triples that reference it.
func (*Store) EntityCount ¶
EntityCount returns the number of entities stored.
func (*Store) GetRelated ¶
GetRelated returns all relationships within depth hops of the named entity using BFS.
func (*Store) Query ¶
Query searches for triples matching the given subject, predicate, and/or object. Empty strings act as wildcards.
func (*Store) Search ¶
Search performs a case-insensitive text search across triples' subject, predicate, and object fields.
func (*Store) TripleCount ¶
TripleCount returns the number of triples stored.
type Triple ¶
type Triple struct {
Subject string `json:"subject"`
Predicate string `json:"predicate"`
Object string `json:"object"`
Metadata map[string]string `json:"metadata,omitempty"`
Confidence float64 `json:"confidence"`
CreatedAt time.Time `json:"created_at"`
}
Triple represents a subject-predicate-object relationship in the knowledge graph.