Documentation
¶
Index ¶
- type Config
- type Service
- func (s *Service) AddObservations(ctx context.Context, project, entityName string, observations []string) error
- func (s *Service) Close() error
- func (s *Service) CreateEntities(ctx context.Context, project string, ents []apptype.Entity) error
- func (s *Service) CreateRelations(ctx context.Context, project string, rels []apptype.Relation) error
- func (s *Service) DeleteEntities(ctx context.Context, project string, names []string) error
- func (s *Service) DeleteEntity(ctx context.Context, project, name string) error
- func (s *Service) DeleteObservations(ctx context.Context, project, entity string, ids []int64, contents []string) (int64, error)
- func (s *Service) DeleteRelation(ctx context.Context, project, source, target, relationType string) error
- func (s *Service) DeleteRelations(ctx context.Context, project string, rels []apptype.Relation) error
- func (s *Service) DisableHybridSearch()
- func (s *Service) EnableHybridSearch(textWeight, vectorWeight, rrfK float64)
- func (s *Service) Neighbors(ctx context.Context, project string, names []string, direction string, ...) ([]apptype.Entity, []apptype.Relation, error)
- func (s *Service) OpenNodes(ctx context.Context, project string, names []string, includeRelations bool) ([]apptype.Entity, []apptype.Relation, error)
- func (s *Service) ReadGraph(ctx context.Context, project string, limit int) ([]apptype.Entity, []apptype.Relation, error)
- func (s *Service) SearchText(ctx context.Context, project string, query string, limit, offset int) ([]apptype.Entity, []apptype.Relation, error)
- func (s *Service) SearchVector(ctx context.Context, project string, vector []float32, limit, offset int) ([]apptype.Entity, []apptype.Relation, error)
- func (s *Service) ShortestPath(ctx context.Context, project, from, to, direction string) ([]apptype.Entity, []apptype.Relation, error)
- func (s *Service) UpdateEntities(ctx context.Context, project string, updates []apptype.UpdateEntitySpec) error
- func (s *Service) UpdateRelations(ctx context.Context, project string, updates []apptype.UpdateRelationChange) error
- func (s *Service) Walk(ctx context.Context, project string, names []string, maxDepth int, ...) ([]apptype.Entity, []apptype.Relation, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
URL string
AuthToken string
ProjectsDir string
MultiProjectMode bool
EmbeddingDims int
MaxOpenConns int
MaxIdleConns int
ConnMaxIdleSec int
ConnMaxLifeSec int
EmbeddingsProvider string
}
Config exposes a stable wrapper for database configuration in package mode. Most fields map directly to internal/database.Config.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides a library-first API for memory operations without MCP transport.
func NewService ¶
NewService constructs a Service with the provided config.
func (*Service) AddObservations ¶
func (s *Service) AddObservations(ctx context.Context, project, entityName string, observations []string) error
AddObservations appends observations to an entity.
func (*Service) CreateEntities ¶
CreateEntities inserts entities.
func (*Service) CreateRelations ¶
func (s *Service) CreateRelations(ctx context.Context, project string, rels []apptype.Relation) error
CreateRelations inserts relations.
func (*Service) DeleteEntities ¶
func (*Service) DeleteEntity ¶
Deletes / Updates
func (*Service) DeleteObservations ¶
func (*Service) DeleteRelation ¶
func (*Service) DeleteRelations ¶
func (*Service) DisableHybridSearch ¶
func (s *Service) DisableHybridSearch()
func (*Service) EnableHybridSearch ¶
Hybrid search toggles
func (*Service) Neighbors ¶
func (s *Service) Neighbors(ctx context.Context, project string, names []string, direction string, limit int) ([]apptype.Entity, []apptype.Relation, error)
Graph helpers
func (*Service) OpenNodes ¶
func (s *Service) OpenNodes(ctx context.Context, project string, names []string, includeRelations bool) ([]apptype.Entity, []apptype.Relation, error)
OpenNodes fetches entities (and optionally relations) by names.
func (*Service) ReadGraph ¶
func (s *Service) ReadGraph(ctx context.Context, project string, limit int) ([]apptype.Entity, []apptype.Relation, error)
ReadGraph returns recent entities + relations with limit.
func (*Service) SearchText ¶
func (s *Service) SearchText(ctx context.Context, project string, query string, limit, offset int) ([]apptype.Entity, []apptype.Relation, error)
SearchText performs text search via underlying DB.
func (*Service) SearchVector ¶
func (s *Service) SearchVector(ctx context.Context, project string, vector []float32, limit, offset int) ([]apptype.Entity, []apptype.Relation, error)
SearchVector performs vector search.