Documentation
¶
Overview ¶
Package graphkit provides an HTTP client for graphiti_svc, the knowledge graph service. It supports entity search, recall, Cypher queries, entity graphs, timelines, and path traversal.
Index ¶
- type Client
- func (c *Client) Cypher(ctx context.Context, query string, params map[string]any) (*CypherResult, error)
- func (c *Client) EntityGraph(ctx context.Context, entityName string, opts ...GraphOption) (*GraphResult, error)
- func (c *Client) EntityTimeline(ctx context.Context, entityName string) ([]TimelineEntry, error)
- func (c *Client) Paths(ctx context.Context, from, to string, opts ...PathOption) ([]Path, error)
- func (c *Client) Recall(ctx context.Context, query string, at *time.Time) ([]SearchResult, error)
- func (c *Client) Search(ctx context.Context, query string) ([]SearchResult, error)
- type ClientOption
- type CypherResult
- type GraphOption
- type GraphResult
- type Path
- type PathOption
- type SearchResult
- type TimelineEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client for graphiti_svc.
func NewClient ¶
func NewClient(baseURL string, opts ...ClientOption) *Client
NewClient creates a new graphiti_svc client. Default timeout is 5 seconds.
func (*Client) Cypher ¶
func (c *Client) Cypher(ctx context.Context, query string, params map[string]any) (*CypherResult, error)
Cypher executes a Cypher query against the knowledge graph.
func (*Client) EntityGraph ¶
func (c *Client) EntityGraph(ctx context.Context, entityName string, opts ...GraphOption) (*GraphResult, error)
EntityGraph returns the graph neighborhood of an entity.
func (*Client) EntityTimeline ¶
EntityTimeline returns the temporal event history for an entity.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption configures a Client.
func WithTenant ¶
func WithTenant(id string) ClientOption
WithTenant sets the tenant ID for all requests.
func WithTimeout ¶
func WithTimeout(d time.Duration) ClientOption
WithTimeout sets the HTTP client timeout.
type CypherResult ¶
CypherResult represents the result of a Cypher query.
type GraphResult ¶
type GraphResult struct {
Name string `json:"name"`
Relationships []string `json:"relationships"`
Neighbors []GraphResult `json:"neighbors"`
}
GraphResult represents an entity and its neighborhood in the graph.
type Path ¶
type Path struct {
Nodes []string `json:"nodes"`
Edges []string `json:"edges"`
Hops int `json:"hops"`
}
Path represents a traversal path between two entities.
type PathOption ¶
type PathOption func(*pathParams)
PathOption configures a Paths call.
func MaxHops ¶
func MaxHops(n int) PathOption
MaxHops sets the maximum number of hops for path traversal.