app

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 10 Imported by: 0

README

app

Shared service assembly: builds the full component stack (store → RAG pipeline → knowledge graph → reasoning engine → API server) from a config.Config. recall-server and the recall CLI's server mode wire components identically through this package, so behavior never drifts between the two.

API

// Store + pipeline + graph + reasoner:
svc, cleanup, err := app.BuildService(cfg)      // *Service{Store, Pipeline, Graph, Reasoner}

// Full HTTP server (returns *api.Server):
srv, cleanup, err := app.BuildAPIServer(cfg)

BuildEmbedder(e config.EmbedderConfig) maps the config's embedder type to a concrete embedder; API keys come from the environment variable named by EmbedderConfig.APIKeyEnv (keys are never read from config files). BuildStore opens the configured memory or sqlite store.

cleanup() closes everything the build opened — always defer it.

Documentation

Overview

Package app assembles Recall service components (embedder, store, RAG pipeline, knowledge graph, reasoning engine, and the REST API server) from a config.Config. Both the recall-server and recall CLI entry points build their stacks through this package, so the two always agree on how a configuration maps to components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAPIServer

func BuildAPIServer(cfg *config.Config) (*api.Server, func(), error)

BuildAPIServer assembles the full REST API service from cfg (store, pipeline, graph, reasoner, and HTTP server configuration, plus the authenticator when auth is enabled). The returned cleanup function releases backend resources.

func BuildAuthenticator

func BuildAuthenticator(a config.AuthConfig) (api.Authenticator, error)

BuildAuthenticator assembles the API authenticator from config. API keys (plain and scoped) are always served by a single api.ScopedAPIKeyAuth so per-key namespace scopes are enforced; JWT auth is composed alongside it when configured.

func BuildEmbedder

func BuildEmbedder(e config.EmbedderConfig) (embedder.Embedder, error)

BuildEmbedder constructs the configured embedding provider. API keys are never read from the config file: APIKeyEnv names the environment variable that holds the key.

func BuildStore

func BuildStore(sc config.StoreConfig) (store.Store, error)

BuildStore opens the store described by sc ("memory" or "sqlite"). The sqlite backend requires sc.Path to be set.

func ChunkerFactory

func ChunkerFactory(k config.ChunkingConfig) chunker.Factory

ChunkerFactory maps the configured strategy to a chunker factory.

Types

type Service

type Service struct {
	// Store is the knowledge store (memory or SQLite).
	Store store.Store

	// Pipeline is the RAG pipeline over Store (citations enabled).
	Pipeline *pipeline.RAGPipeline

	// Graph is the knowledge graph store.
	Graph store.GraphStore

	// Reasoner is the multi-hop reasoning engine over Graph.
	Reasoner *reasoning.Engine
}

Service is the assembled set of core components a Recall deployment runs: the store plus the RAG pipeline, knowledge graph, and reasoning engine built on top of it.

func BuildService

func BuildService(cfg *config.Config) (*Service, func(), error)

BuildService assembles the core service stack (store, RAG pipeline, knowledge graph, reasoning engine) from cfg. The returned cleanup function releases backend resources.

Jump to

Keyboard shortcuts

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