ask

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ask answers a natural-language question from the team's own knowledge: it retrieves the relevant notes (the graph) plus the relevant code symbols (the code index), hands them to the BYOAI LLM as the ONLY allowed context, and returns the answer with citations. The conversational second brain, grounded in the vault, no hallucinated facts. Reuses the retriever + code index + llm.Client (claude -p).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Citation

type Citation struct {
	N     int    `json:"n"`
	Kind  string `json:"kind"` // note | code
	ID    string `json:"id"`
	Title string `json:"title"`
	Loc   string `json:"loc"` // note path or file:line
}

Citation is a source the answer drew on, by its [N] number in the context.

type Result

type Result struct {
	Answer    string     `json:"answer"`
	Citations []Citation `json:"citations"`
}

Result is the grounded answer plus the sources it was given.

func Answer

func Answer(ctx context.Context, rtr *retrieve.Retriever, store *index.Store, client llm.Client, question string, budget int, allowedScopes map[string]bool) (Result, error)

Answer retrieves notes + code for the question, asks the LLM grounded on them, and returns the answer with the cited sources. allowedScopes (nil = unrestricted) keeps a scoped caller's answer within their readable notes.

Jump to

Keyboard shortcuts

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