Documentation
¶
Index ¶
- Variables
- type Fact
- type FactMetadata
- type FactType
- type GraphEdge
- type GraphNode
- type GraphQuery
- type GraphResult
- type Memory
- type Relationship
- type RelationshipMetadata
- type SearchQuery
- type Service
- func (s *Service) CalculateConfidence(metadata FactMetadata, sourceCount int) float64
- func (s *Service) CreateRelationship(ctx context.Context, subject, predicate, object string) error
- func (s *Service) DeleteFact(ctx context.Context, id string) error
- func (s *Service) FindRelatedFacts(ctx context.Context, entity string, depth int) (GraphResult, error)
- func (s *Service) FindRelatedFactsWithPredicates(ctx context.Context, entity string, depth int, predicates []string) (GraphResult, error)
- func (s *Service) ReadFact(ctx context.Context, id string) (Fact, error)
- func (s *Service) Search(ctx context.Context, query SearchQuery) ([]Fact, error)
- func (s *Service) TrackAccess(ctx context.Context, factID string) error
- func (s *Service) ValidateFact(ctx context.Context, factID string) error
- func (s *Service) WriteStatement(ctx context.Context, fact StatementFact) error
- func (s *Service) WriteTriple(ctx context.Context, fact TripleFact) error
- type ServiceOption
- type SortField
- type SortOrder
- type Source
- type StatementFact
- type Store
- type TripleFact
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("fact not found")
Functions ¶
This section is empty.
Types ¶
type Fact ¶
type Fact interface {
GetID() string
GetType() FactType
GetSources() []Source
GetTags() []string
GetMetadata() FactMetadata
// contains filtered or unexported methods
}
type FactMetadata ¶
type GraphQuery ¶
type GraphResult ¶
type Memory ¶
type Memory interface {
Write(ctx context.Context, entity, attribute, value string) error
Read(ctx context.Context, entity, attribute string) (string, error)
Search(ctx context.Context, attribute, value string) ([]string, error)
Delete(ctx context.Context, entity, attribute string) error
}
Memory defines the high-level semantic memory interface.
type Relationship ¶
type Relationship struct {
ID string
Subject string
Predicate string
Object string
Metadata RelationshipMetadata
}
type RelationshipMetadata ¶
type SearchQuery ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(store Store, opts ...ServiceOption) *Service
func (*Service) CalculateConfidence ¶
func (s *Service) CalculateConfidence(metadata FactMetadata, sourceCount int) float64
func (*Service) CreateRelationship ¶
func (*Service) FindRelatedFacts ¶
func (*Service) FindRelatedFactsWithPredicates ¶
func (*Service) TrackAccess ¶
func (*Service) ValidateFact ¶
func (*Service) WriteStatement ¶
func (s *Service) WriteStatement(ctx context.Context, fact StatementFact) error
func (*Service) WriteTriple ¶
func (s *Service) WriteTriple(ctx context.Context, fact TripleFact) error
type ServiceOption ¶
type ServiceOption func(*Service)
func WithMeter ¶
func WithMeter(meter metric.Meter) ServiceOption
func WithTracer ¶
func WithTracer(tracer trace.Tracer) ServiceOption
type StatementFact ¶
type StatementFact struct {
ID string
Statement string
Sources []Source
Tags []string
Metadata FactMetadata
}
func (StatementFact) GetID ¶
func (f StatementFact) GetID() string
func (StatementFact) GetMetadata ¶
func (f StatementFact) GetMetadata() FactMetadata
func (StatementFact) GetSources ¶
func (f StatementFact) GetSources() []Source
func (StatementFact) GetTags ¶
func (f StatementFact) GetTags() []string
func (StatementFact) GetType ¶
func (f StatementFact) GetType() FactType
type Store ¶
type Store interface {
WriteTriple(ctx context.Context, fact TripleFact) error
WriteStatement(ctx context.Context, fact StatementFact) error
WriteTriples(ctx context.Context, facts []TripleFact) error
WriteStatements(ctx context.Context, facts []StatementFact) error
ReadFact(ctx context.Context, id string) (Fact, error)
ReadTriple(ctx context.Context, id string) (TripleFact, error)
ReadStatement(ctx context.Context, id string) (StatementFact, error)
Search(ctx context.Context, query SearchQuery) ([]Fact, error)
DeleteFact(ctx context.Context, id string) error
DeleteByEntityAttribute(ctx context.Context, entity, attribute string) error
WriteRelationship(ctx context.Context, rel Relationship) error
ReadRelationships(ctx context.Context, subject string) ([]Relationship, error)
DeleteRelationship(ctx context.Context, id string) error
TraverseGraph(ctx context.Context, query GraphQuery) (GraphResult, error)
Close() error
}
type TripleFact ¶
type TripleFact struct {
ID string
Entity string
Attribute string
Value string
Sources []Source
Tags []string
Metadata FactMetadata
}
func (TripleFact) GetID ¶
func (f TripleFact) GetID() string
func (TripleFact) GetMetadata ¶
func (f TripleFact) GetMetadata() FactMetadata
func (TripleFact) GetSources ¶
func (f TripleFact) GetSources() []Source
func (TripleFact) GetTags ¶
func (f TripleFact) GetTags() []string
func (TripleFact) GetType ¶
func (f TripleFact) GetType() FactType
Click to show internal directories.
Click to hide internal directories.