ingestor

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ingestor implements the Semantic Ingestor — Feature 1 of synapses-intelligence.

On a file-save event, the ingestor receives a code snippet, sends a short prompt to the local LLM, and persists a 1-sentence "intent summary" in brain.sqlite. These summaries are later served by the Enricher during get_context calls, replacing raw source code with compact semantic descriptions for the main LLM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ingestor

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

Ingestor summarizes code snippets via the LLM and persists them.

func New

func New(client llm.LLMClient, st *store.Store, timeout time.Duration) *Ingestor

New creates an Ingestor backed by the given LLM client and store.

func (*Ingestor) Summarize

func (ing *Ingestor) Summarize(ctx context.Context, req Request) (Response, error)

Summarize generates and stores a 1-sentence summary for the given code entity. Uses a deterministic fast path for trivial nodes (test helpers, generated code, getters/setters) that skips the LLM entirely. For non-trivial nodes, calls the LLM to generate a prose summary. If the LLM is unavailable or returns an unparseable response, an error is returned but the call is non-fatal — callers should log and continue.

type Request

type Request struct {
	ProjectID string
	NodeID    string
	NodeName  string
	NodeType  string
	Package   string
	Code      string
}

Request carries a code snippet for summarization.

type Response

type Response struct {
	NodeID  string
	Summary string
	Tags    []string // 1-3 short domain labels (may be empty for legacy LLM responses)
}

Response holds the generated summary and domain tags.

Jump to

Keyboard shortcuts

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