Help us shape the future of Go! Take the 2026 Go Developer Survey

query

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine wraps a loaded graph and answers queries against it.

func LoadFromFile

func LoadFromFile(graphPath string) (*Engine, error)

LoadFromFile reads graph.json and constructs a query Engine.

func (*Engine) Bindings added in v1.4.0

func (e *Engine) Bindings(label string) string

Bindings returns queryable memory reference binder state for the given node.

func (*Engine) Explain

func (e *Engine) Explain(label string) string

Explain returns all edges where the given node is source or target.

func (*Engine) FindNode added in v1.5.0

func (e *Engine) FindNode(term string) (types.Node, bool)

FindNode resolves a node by ID, exact label, or fuzzy label match.

func (*Engine) Graph

func (e *Engine) Graph() *types.Graph

Graph returns the underlying types.Graph (read-only reference).

func (*Engine) Lookup added in v1.7.1

func (e *Engine) Lookup(term string, limit int) []LookupCandidate

Lookup returns ranked node candidates for a broad term without pretending to answer a structural graph question directly.

func (*Engine) Neighbors added in v1.5.0

func (e *Engine) Neighbors(label string) ([]Neighbor, error)

Neighbors returns all incoming and outgoing edges for the given node.

func (*Engine) NodeByID

func (e *Engine) NodeByID(id string) (types.Node, bool)

NodeByID returns the node with the given ID string, if it exists.

func (*Engine) Path

func (e *Engine) Path(fromLabel, toLabel string) string

Path finds the shortest directed path from nodeA to nodeB. Returns a human-readable string.

func (*Engine) Query

func (e *Engine) Query(input string) string

Query is a freeform dispatcher: parses "path A B", "explain X", etc.

func (*Engine) RenderLookup added in v1.7.1

func (e *Engine) RenderLookup(term string, limit int) string

RenderLookup formats ranked candidates with enough metadata to pick an exact subject for follow-up structural graph queries.

func (*Engine) Route added in v1.4.0

func (e *Engine) Route(input string) string

Route reports workspace-layer repo routing for a query.

func (*Engine) RunRequest added in v1.7.1

func (e *Engine) RunRequest(req types.QueryRequest) (string, error)

RunRequest executes the reduced graph-truth query contract used by the new CLI, TUI, server, and MCP surfaces.

func (*Engine) Search added in v1.5.0

func (e *Engine) Search(term string, limit int) []types.Node

Search performs a small lexical ranking over node fields.

func (*Engine) Stats added in v1.5.0

func (e *Engine) Stats() GraphStats

Stats returns a structured graph summary.

type GraphStats added in v1.5.0

type GraphStats struct {
	NodeCount       int
	EdgeCount       int
	CommunityCount  int
	NodeTypes       map[string]int
	ConfidenceTypes map[string]int
}

GraphStats summarizes the graph contents for diagnostics and MCP output.

type LookupCandidate added in v1.7.1

type LookupCandidate struct {
	Node  types.Node
	Score int
}

LookupCandidate is a ranked node suggestion for broad discovery queries.

type Neighbor added in v1.5.0

type Neighbor struct {
	Node      types.Node
	Edge      types.Edge
	Direction string
}

Neighbor describes a directly connected node and the edge relating it.

Jump to

Keyboard shortcuts

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