@exulu/backend that are not part of a class. For class APIs see the Core classes and the other reference pages in this section.
Functions
defaultChunker
ChunkerOperation used when a context configures an embedding model but does not provide a custom chunker. It runs the SentenceChunker over the item’s primary text content — checking content, then description, prefixed by name — and respects maxChunkSize as the per-chunk token budget.
Use defaultChunker directly when you want to invoke the standard chunking logic from a custom processor or in tests.
enableLiteLLMClientMode
LITELLM_PORT — colliding with the server’s process — or fail with “package root not set”.
enableLiteLLMClientMode is a no-op when the current process has already started its own supervisor (e.g. a combined server + worker process). It is idempotent.
See Self-hosting / LiteLLM for deployment context.
postgresClient
POSTGRES_DB_NAME, defaulting to "exulu"). Subsequent calls return the cached connection.
db is a Knex instance with pgvector registered, so vector operations (db.raw('... <=> ?', [vector])) work out of the box.
min: 2, max: 4. Connection timeouts, SSL, and credentials are read from environment variables (POSTGRES_DB_HOST, POSTGRES_DB_PORT, POSTGRES_DB_USER, POSTGRES_DB_PASSWORD, POSTGRES_DB_SSL).
Enums
EXULU_STATISTICS_TYPE_ENUM
type field in the statistics table.
The corresponding TypeScript union type is
EXULU_STATISTICS_TYPE.
EXULU_JOB_STATUS_ENUM
jobs table or filtering on queue inspector results.
The corresponding TypeScript union type is
EXULU_JOB_STATUS.
Types
ChunkerOperation
chunker option of an ExuluContext embedder config. utils.storage is available for chunkers that need to read files from object storage (e.g. to extract text from a PDF before chunking).
ChunkerResponse
ChunkerOperation. metadata is stored in a Postgres JSONB column — any JSON-serializable value is accepted (e.g. a page number from a PDF chunker).
ExuluContextEmbedder
ExuluContext. model is the LiteLLM model_name of the embedding model (declared in config.litellm.yaml). When queue is provided, embedding jobs run in the background via BullMQ.
ExuluAgent
ExuluAgent at the package boundary (the internal type is agent.ts:ExuluAgent). Passed to tool execute functions, ExuluEval.run, ExuluReranker.rerank, and other contexts where the calling agent’s identity is needed.
VectorSearchChunkResult
ExuluContext.search(), ExuluReadApi.authorizedRead(), and passed to ExuluReranker.rerank(). chunk_entities is present only when the entity layer is enabled for the context.
ExuluAuthConfig
authentication field of an ExuluTool. The active arm is selected by authType: "oauth" for the 3-legged OAuth 2.0 flow and "user_credentials" for the form-based credential prompt flow. See ExuluTool — configuration for the full authentication option guide.
ExuluOauthConfig
ExuluTool. When a tool is constructed with an authentication property set to this type, IMP wraps its execute to require a valid access token. provider lets multiple tools share the same token under one consent grant — tools with the same provider string share a single OAuth connection per user, rather than each requiring its own consent screen. All values are declared in code; none are exposed as admin-configurable tool config. pkce defaults to true (S256); set it to false for providers that reject PKCE.
See ExuluTool — introduction for the full OAuth integration guide.
ExuluUserCredentialsConfig
ExuluTool. When a tool is constructed with an authentication property set to this type, IMP presents the user with a form before the first tool call, stores the submitted values encrypted, and injects them into execute as inputs.credentials. provider namespaces the stored credentials — tools sharing the same provider share a single stored credential set per user. validate is an optional async function called after the user submits; throw any Error to reject the submission with the error message.
CredentialField
ExuluUserCredentialsConfig is active. name is the key used in the credentials record injected into execute. type: "password" masks the input and is appropriate for API keys and secrets. placeholder and help are optional UI hints shown beneath the field.
ExuluOauthToolContext
execute inputs as inputs.oauth. expiresAt is null when the provider did not report an expiry. scopes is the space-joined granted scope string when reported.
ExuluCredentialsToolContext
credentials field is injected into a tool’s execute inputs as inputs.credentials — a Record<string, string> keyed by the name values declared in ExuluUserCredentialsConfig.fields. The userId and provider fields are part of the exported type definition and match what is documented on the configuration page and in the tutorial, but the injected runtime value is the plain record, not the full interface.
CredentialInvalidError
execute function to signal that a stored credential is no longer valid (e.g. a 401 from the upstream API). When IMP’s wrapExecuteWithAuth catches a CredentialInvalidError whose provider matches the tool’s configured provider, it deletes the stored credential and immediately re-prompts the user with a fresh form. Errors from a different provider are re-thrown unchanged. Construct with the tool’s authentication.provider and an optional human-readable reason string.
ExuluItem
@EXULU_TYPES/models/item as ExuluItem for package consumers. The index signature ([key: string]: any) accommodates context-specific custom fields defined in ExuluContext.fields.