rag

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 20 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 rag is Antares' native retrieval store: it embeds chunks with the configured model, keeps the vectors in the Antares database, and layers reranking and near-duplicate compression on top of hybrid search. There is no external service — it all runs in-process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EffectiveRerank

func EffectiveRerank(cfg *config.Config) string

EffectiveRerank reports which reranker actually runs for the current config, so the dashboard shows the truth (mode "llm" may resolve to Voyage). Returns one of: "off", "voyage", "api", "llm".

func New

func New(cfg *config.Config, db store.Store) (tools.RAGProvider, error)

New builds the native retrieval provider. It returns nil when RAG is disabled, which callers treat as "tool unavailable".

func ProjectCollection

func ProjectCollection(projectDir string) string

ProjectCollection returns the RAG collection name for a project directory: the folder's own name plus a short path hash — e.g. "enowxgrok-2ba64e54". The name makes it readable in the dashboard; the hash keeps it unique so two folders sharing a name don't collide, and stable across sessions.

func SocialCollection added in v0.4.0

func SocialCollection(platform string) string

SocialCollection returns the RAG collection name for a social media platform. "social/instagram" → "social-instagram", "social/shared" → "social-shared". Use this to namespace platform-specific knowledge so the Social Media agent can retrieve context scoped to the platform it's working on.

func UserCollection added in v0.4.0

func UserCollection(platform, userID string) string

UserCollection returns the per-user RAG collection name for a gateway sender, namespaced by platform and user id: "discord" + "12345" → "user-discord-<h>". The id is hashed so an arbitrary platform id (which may contain characters a collection name cannot) always yields a safe, stable name. Returns "" when there is no user to scope to, so callers can skip per-user work.

Types

type Prober

type Prober interface {
	Probe(ctx context.Context) (bool, string)
}

Prober is implemented by backends that can report reachability.

type Status

type Status struct {
	Enabled     bool        `json:"enabled"`
	Provider    string      `json:"provider"`
	Collections []string    `json:"collections"`
	Reachable   bool        `json:"reachable"`
	Detail      string      `json:"detail"`
	Pipeline    *StatusPipe `json:"pipeline,omitempty"`
}

Status summarises the active backend for the dashboard.

func Describe

func Describe(ctx context.Context, cfg *config.Config, p tools.RAGProvider) Status

Describe reports the current backend status for /api/rag/status.

type StatusPipe

type StatusPipe struct {
	EmbedProvider string `json:"embed_provider"`
	EmbedModel    string `json:"embed_model"`
	Hybrid        bool   `json:"hybrid"`
	Recall        int    `json:"recall"`
	RerankMode    string `json:"rerank_mode"`
	Compress      bool   `json:"compress"`
	TopK          int    `json:"top_k"`
	AutoContext   bool   `json:"auto_context"`
}

StatusPipe describes the configured retrieval pipeline, so the dashboard can show how searches run before one is even issued.

Jump to

Keyboard shortcuts

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