orchestrator

package
v0.0.0-...-2843bd2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzeResult

type AnalyzeResult struct {
	Query    string      `json:"query"`
	RepoName string      `json:"repo_name"`
	Total    int         `json:"total_results"`
	Results  []SearchHit `json:"results"`
}

AnalyzeResult holds the result of a direct hybrid search (no LLM).

func (*AnalyzeResult) ToTOON

func (ar *AnalyzeResult) ToTOON(includeCode bool) string

ToTOON converts AnalyzeResult to TOON (Token-Oriented Object Notation) format. TOON uses tabular headers for homogeneous arrays, saving ~40% tokens vs JSON.

type Config

type Config struct {
	CacheDir       string
	EmbeddingModel string
	BatchSize      int
	NoEmbeddings   bool // If true, skip embedding generation (BM25 only)
}

Config holds engine configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default engine configuration.

type Engine

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

Engine is the top-level orchestrator connecting all FastCode modules.

func NewEngine

func NewEngine(cfg Config) *Engine

NewEngine creates a new FastCode engine.

func (*Engine) Analyze

func (e *Engine) Analyze(question string, topK int, includeCode bool) (*AnalyzeResult, error)

Analyze performs a direct hybrid search without LLM, returning scored results. This is the script-callable entry point for agent coding tools.

func (*Engine) Index

func (e *Engine) Index(repoPath string, forceReindex bool) (*IndexResult, error)

Index parses, indexes, and optionally embeds a repository.

func (*Engine) Query

func (e *Engine) Query(question string) (*QueryResult, error)

Query performs a full query pipeline: search → agent → answer.

type IndexResult

type IndexResult struct {
	RepoName      string         `json:"repo_name"`
	TotalFiles    int            `json:"total_files"`
	TotalElements int            `json:"total_elements"`
	GraphStats    map[string]any `json:"graph_stats"`
	Cached        bool           `json:"cached"`
}

IndexResult holds the result of an indexing operation.

type QueryResult

type QueryResult struct {
	Answer     string `json:"answer"`
	Confidence int    `json:"confidence"`
	Rounds     int    `json:"rounds"`
	StopReason string `json:"stop_reason"`
	Elements   int    `json:"elements_used"`
}

QueryResult holds the result of a query operation.

type SearchHit

type SearchHit struct {
	Name      string  `json:"name"`
	Type      string  `json:"type"`
	FilePath  string  `json:"file_path"`
	StartLine int     `json:"start_line"`
	EndLine   int     `json:"end_line"`
	Score     float64 `json:"relevance_score"`
	Signature string  `json:"signature,omitempty"`
	Docstring string  `json:"docstring,omitempty"`
	Code      string  `json:"code,omitempty"`
}

SearchHit represents a single search result with relevance score.

Jump to

Keyboard shortcuts

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