ask

package
v0.1.2 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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