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 ¶
- func EffectiveRerank(cfg *config.Config) string
- func New(cfg *config.Config, db store.Store) (tools.RAGProvider, error)
- func ProjectCollection(projectDir string) string
- func SocialCollection(platform string) string
- func UserCollection(platform, userID string) string
- type Prober
- type Status
- type StatusPipe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EffectiveRerank ¶
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 ¶
New builds the native retrieval provider. It returns nil when RAG is disabled, which callers treat as "tool unavailable".
func ProjectCollection ¶
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
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
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 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.
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.