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

knowledge

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package knowledge composes PostgreSQL retrieval with an Agent knowledge tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DemoEmbedder

type DemoEmbedder struct{}

DemoEmbedder is a deterministic fixture, not a semantic embedding model. Replace it and rebuild document embeddings together for a real application.

func (DemoEmbedder) Embed

func (DemoEmbedder) Embed(ctx context.Context, texts []string) ([][]float32, error)

type Result

type Result struct {
	VectorHits int            `json:"vector_hits"`
	TextHits   int            `json:"text_hits"`
	Content    string         `json:"content"`
	Citations  []rag.Citation `json:"citations"`
}

func RunPostgresRAG

func RunPostgresRAG(ctx context.Context, db *sql.DB, cfg config.PostgresRAG) (Result, error)

RunPostgresRAG creates only an explicitly owned demonstration schema. The application owns migrations and indexing; retrieval adapters only read. It borrows db, leaves demo rows for inspection, and never calls a model API.

Jump to

Keyboard shortcuts

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