graphrag

package
v0.2.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package graphrag provides tools for interacting with GraphRAG knowledge graphs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEntityTool

type AddEntityTool struct {
	// contains filtered or unexported fields
}

AddEntityTool adds entities to the knowledge graph.

func NewAddEntityTool

func NewAddEntityTool(store interfaces.GraphRAGStore) *AddEntityTool

NewAddEntityTool creates a new add entity tool.

func (*AddEntityTool) Description

func (t *AddEntityTool) Description() string

Description returns the tool description.

func (*AddEntityTool) Execute

func (t *AddEntityTool) Execute(ctx context.Context, args string) (string, error)

Execute implements the tool interface with JSON arguments.

func (*AddEntityTool) Name

func (t *AddEntityTool) Name() string

Name returns the tool name.

func (*AddEntityTool) Parameters

func (t *AddEntityTool) Parameters() map[string]interfaces.ParameterSpec

Parameters returns the tool parameters.

func (*AddEntityTool) Run

func (t *AddEntityTool) Run(ctx context.Context, input string) (string, error)

Run executes the tool (simple interface).

type AddRelationshipTool

type AddRelationshipTool struct {
	// contains filtered or unexported fields
}

AddRelationshipTool adds relationships between entities in the knowledge graph.

func NewAddRelationshipTool

func NewAddRelationshipTool(store interfaces.GraphRAGStore) *AddRelationshipTool

NewAddRelationshipTool creates a new add relationship tool.

func (*AddRelationshipTool) Description

func (t *AddRelationshipTool) Description() string

Description returns the tool description.

func (*AddRelationshipTool) Execute

func (t *AddRelationshipTool) Execute(ctx context.Context, args string) (string, error)

Execute implements the tool interface with JSON arguments.

func (*AddRelationshipTool) Name

func (t *AddRelationshipTool) Name() string

Name returns the tool name.

func (*AddRelationshipTool) Parameters

func (t *AddRelationshipTool) Parameters() map[string]interfaces.ParameterSpec

Parameters returns the tool parameters.

func (*AddRelationshipTool) Run

func (t *AddRelationshipTool) Run(ctx context.Context, input string) (string, error)

Run executes the tool (simple interface).

type ExtractTool

type ExtractTool struct {
	// contains filtered or unexported fields
}

ExtractTool extracts entities and relationships from text using an LLM.

func NewExtractTool

func NewExtractTool(store interfaces.GraphRAGStore, llm interfaces.LLM) *ExtractTool

NewExtractTool creates a new extract tool.

func (*ExtractTool) Description

func (t *ExtractTool) Description() string

Description returns the tool description.

func (*ExtractTool) Execute

func (t *ExtractTool) Execute(ctx context.Context, args string) (string, error)

Execute implements the tool interface with JSON arguments.

func (*ExtractTool) Name

func (t *ExtractTool) Name() string

Name returns the tool name.

func (*ExtractTool) Parameters

func (t *ExtractTool) Parameters() map[string]interfaces.ParameterSpec

Parameters returns the tool parameters.

func (*ExtractTool) Run

func (t *ExtractTool) Run(ctx context.Context, input string) (string, error)

Run executes the tool (simple interface).

type GetContextTool

type GetContextTool struct {
	// contains filtered or unexported fields
}

GetContextTool retrieves context around an entity via graph traversal.

func NewGetContextTool

func NewGetContextTool(store interfaces.GraphRAGStore) *GetContextTool

NewGetContextTool creates a new get context tool.

func (*GetContextTool) Description

func (t *GetContextTool) Description() string

Description returns the tool description.

func (*GetContextTool) Execute

func (t *GetContextTool) Execute(ctx context.Context, args string) (string, error)

Execute implements the tool interface with JSON arguments.

func (*GetContextTool) Name

func (t *GetContextTool) Name() string

Name returns the tool name.

func (*GetContextTool) Parameters

func (t *GetContextTool) Parameters() map[string]interfaces.ParameterSpec

Parameters returns the tool parameters.

func (*GetContextTool) Run

func (t *GetContextTool) Run(ctx context.Context, input string) (string, error)

Run executes the tool (simple interface).

type SearchTool

type SearchTool struct {
	// contains filtered or unexported fields
}

SearchTool implements graph-based search in the knowledge graph.

func NewSearchTool

func NewSearchTool(store interfaces.GraphRAGStore) *SearchTool

NewSearchTool creates a new search tool.

func (*SearchTool) Description

func (t *SearchTool) Description() string

Description returns the tool description.

func (*SearchTool) Execute

func (t *SearchTool) Execute(ctx context.Context, args string) (string, error)

Execute implements the tool interface with JSON arguments.

func (*SearchTool) Name

func (t *SearchTool) Name() string

Name returns the tool name.

func (*SearchTool) Parameters

func (t *SearchTool) Parameters() map[string]interfaces.ParameterSpec

Parameters returns the tool parameters.

func (*SearchTool) Run

func (t *SearchTool) Run(ctx context.Context, input string) (string, error)

Run executes the search (simple interface).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL