@exulu/backend

中文文档
5.11.1发布于 2026/11/13TypeScriptES Module近 30 天下载 3926

Exulu IMP (Intelligence Management Platform) is an open-source TypeScript framework for building production-ready AI agent applications. It provides the backend infrastructure for managing agents, semantic search contexts, background job processing, a

原始使用文档
文档目录39 节
  1. ✨ Why Exulu IMP?
  2. 🚀 Quickstart
  3. Installation
  4. Basic setup
  5. 🎨 Admin Frontend
  6. Exulu Frontend →
  7. 📖 Documentation
  8. 🏗️ Core concepts
  9. ExuluApp
  10. ExuluAgent
  11. ExuluContext
  12. ExuluTool
  13. ExuluDatabase
  14. Background workers
  15. ⚙️ Requirements
  16. 🗂️ Exulu IMP ecosystem
  17. Backend structure
  18. 🔐 Authentication
  19. API Key authentication
  20. NextAuth session tokens
  21. Internal service keys
  22. 📊 Evaluation framework
  23. 🔬 OpenTelemetry integration
  24. 🌍 Environment variables
  25. 📦 Complete example
  26. Audit logging
  27. 🛠️ Development
  28. 📚 Examples
  29. RAG application
  30. Multi-agent workflow
  31. Custom tool with API integration
  32. 🚨 Need help?
  33. 🗺️ Roadmap
  34. 📄 License
  35. 🌟 Related projects
  36. Exulu Frontend →
  37. Exulu Example →
  38. ⭐ Star us on GitHub
  39. 👏 Thanks to all our contributors

Exulu IMP (Intelligence Management Platform) is an open-source TypeScript framework for building production-ready AI agent applications. It provides the backend infrastructure for managing agents, semantic search contexts, background job processing, and tool integrations.

Exulu IMP - Create, deploy and manage AI agents



GitHub Workflow Status   Discord   npm downloads   npm version   Node.js version


📚 Explore the Docs  ·  💬 Community Help  ·  🗺️ Roadmap


[!IMPORTANT] ⭐ Star this repo to follow development and updates

✨ Why Exulu IMP?

  • 🤖 Multi-provider agents - Built-in support for OpenAI, Anthropic, Google, Cerebras and any AI SDK provider
  • 🔍 Semantic search - Vector-powered RAG with pgvector and automatic embedding generation
  • ⚙️ Background workers - BullMQ-based job queues for long-running tasks
  • 🔐 Authentication - API keys, NextAuth integration, and role-based access control
  • 🛠️ Tool system - Extend agent capabilities with custom functions and external APIs
  • 📦 Self-hosted - Deploy anywhere you want, no vendor lock-in
  • 🔌 Express API - GraphQL and REST endpoints out of the box
  • 📊 OpenTelemetry - Built-in logging and tracing with SigNoz integration
  • ⚡ TypeScript-first - Fully typed with automatic type inference

🚀 Quickstart

Installation

npm install @exulu/backend

Basic setup

import { ExuluApp, ExuluAgent, ExuluDefaultAgents } from "@exulu/backend";

const app = new ExuluApp();

await app.create({
  config: {
    express: { enabled: true, port: 3000 },
    workers: { enabled: true },
    telemetry: { enabled: false }
  },
  agents: [
    ExuluDefaultAgents.anthropic.sonnet45,
    ExuluDefaultAgents.openai.gpt5
  ],
  contexts: {},
  tools: []
});

const server = await app.express.init();
server.listen(3000, () => {
  console.log("🚀 Exulu IMP running on http://localhost:3000");
});

For a complete working example, check out the Exulu Example Repository which includes:

  • Docker Compose setup for PostgreSQL, Redis, and MinIO
  • Pre-configured agents and contexts
  • Worker implementation
  • Environment configuration templates
  • Database initialization scripts

🎨 Admin Frontend

Exulu Frontend →

Exulu Frontend

Modern React admin interface for managing your AI agents, contexts, and workflows

The Exulu Frontend provides a beautiful, production-ready admin interface built with Next.js 15, React 19, and Tailwind CSS.

✨ Features

  • 🎯 Agent management & configuration
  • 📊 Real-time session monitoring
  • 🗄️ Context & knowledge base management
  • 🔧 Tool & workflow builder
  • 👥 User & role management
  • 📈 Usage statistics & analytics

🚀 Quick Start

# Using npx (recommended)
npx @exulu/frontend

# Or install globally
npm install -g @exulu/frontend
exulu-frontend

Connects to your Exulu IMP backend automatically!

Exulu IMP - Create, deploy and manage AI agents

Agent Management Agent Management

Session Monitoring Session Monitoring


📖 Documentation

Visit docs.exulu.com for comprehensive documentation including:

🏗️ Core concepts

ExuluApp

The main application class that orchestrates all components:

import { ExuluApp } from "@exulu/backend";

const agent = new ExuluAgent({
  id: "assistant",
  name: "Assistant",
  provider: "anthropic",
  type: "agent",
  maxContextLength: 200000,
  config: {
    model: {
      create: ({ apiKey }) => {
        const anthropic = createAnthropic({ apiKey });
        return anthropic.languageModel("claude-sonnet-4-5");
      }
    },
    instructions: "You are a helpful assistant."
  }
});

const app = new ExuluApp();
await app.create({
  config: {},
  agents: [agent],
  contexts: {...},
  tools: [...]
});

ExuluAgent

Create AI agents with different LLM providers:

import { ExuluAgent } from "@exulu/backend";
import { createAnthropic } from "@ai-sdk/anthropic";

const agent = new ExuluAgent({
  id: "assistant",
  name: "Assistant",
  provider: "anthropic",
  type: "agent",
  capabilities: {
    text: true,
    images: [".png", ".jpg"],
    files: [".pdf", ".docx"]
  },
  maxContextLength: 200000,
  config: {
    model: {
      create: ({ apiKey }) => {
        const anthropic = createAnthropic({ apiKey });
        return anthropic.languageModel("claude-sonnet-4-5");
      }
    },
    instructions: "You are a helpful assistant."
  }
});

Or use pre-configured agents:

import { ExuluDefaultAgents } from "@exulu/backend";

// OpenAI
ExuluDefaultAgents.openai.gpt5;
ExuluDefaultAgents.openai.gpt4o;

// Anthropic
ExuluDefaultAgents.anthropic.opus4;
ExuluDefaultAgents.anthropic.sonnet45;

// Google
ExuluDefaultAgents.google.vertexGemini25Pro;

// Cerebras
ExuluDefaultAgents.cerebras.llama3370b;

ExuluContext

Semantic search with vector embeddings for RAG:

import { ExuluContext, ExuluEmbedder } from "@exulu/backend";

const embedder = new ExuluEmbedder({
  id: "embedder",
  name: "OpenAI Embedder",
  provider: "openai",
  model: "text-embedding-3-small",
  vectorDimensions: 1536,
  authenticationInformation: process.env.OPENAI_API_KEY
});

const context = new ExuluContext({
  id: "docs",
  name: "Documentation",
  description: "Product documentation",
  embedder,
  tableName: "docs_items",
  fields: [
    { name: "title", type: "string" },
    { name: "url", type: "string" }
  ]
});

// Add documents
await context.addItem({
  content: "Product documentation content...",
  metadata: { title: "Getting Started", url: "https://docs.example.com/start" }
});

// Search (automatically available to agents)
const results = await context.search("How do I get started?", 5);

ExuluTool

Extend agent capabilities with custom functions:

import { ExuluTool } from "@exulu/backend";
import { z } from "zod";

const weatherTool = new ExuluTool({
  id: "get_weather",
  name: "Get Weather",
  description: "Get current weather for a location",
  parameters: z.object({
    location: z.string().describe("City name")
  }),
  execute: async ({ location }) => {
    const response = await fetch(`https://api.weather.com/${location}`);
    return await response.json();
  }
});

ExuluDatabase

Initialize database and generate API keys:

import { ExuluDatabase } from "@exulu/backend";

// Initialize database with contexts
await ExuluDatabase.init({ contexts: [documentationContext] });

// Generate API key
const { key } = await ExuluDatabase.api.key.generate(
  "Production API",
  "[email protected]"
);
console.log(`API Key: ${key}`);

Background workers

Process long-running tasks with BullMQ:

import { ExuluApp } from "@exulu/backend";

const app = new ExuluApp();
await app.create({
  config: {
    workers: { enabled: true }
  },
  // ... agents, contexts, tools
});

// Create worker to process jobs
const worker = await app.bullmq.workers.create();

// Worker automatically processes:
// - Embedding generation
// - Document chunking
// - Scheduled tasks
// - Custom queued jobs

⚙️ Requirements

  • Node.js: 22.18.0 (enforced via engines in package.json)
  • PostgreSQL: 13+ with pgvector extension
  • Redis: Optional, only required if using background workers

🗂️ Exulu IMP ecosystem

The Exulu IMP platform consists of multiple repositories working together:

🔧 Backend
@exulu/backend
Core framework with agents, contexts, tools, and API

🎨 Frontend
@exulu/frontend
Admin interface for managing agents and workflows

📦 Example
exulu-example
Complete implementation with Docker setup

Backend structure

@exulu/backend/
├── src/
│   ├── exulu/
│   │   ├── app/           # ExuluApp implementation
│   │   ├── agent.ts       # ExuluAgent class
│   │   ├── context.ts     # ExuluContext class
│   │   ├── tool.ts        # ExuluTool class
│   │   ├── evals.ts       # ExuluEval class
│   │   └── otel.ts        # OpenTelemetry setup
│   ├── auth/              # Authentication utilities
│   ├── bullmq/            # Queue management
│   ├── chunking/          # Text chunking
│   ├── postgres/          # Database client
│   ├── redis/             # Redis client
│   └── templates/         # Default agents
├── types/                 # TypeScript type definitions
└── mintlify-docs/        # Documentation source

🔐 Authentication

Exulu IMP supports multiple authentication methods:

API Key authentication

import { ExuluAuthentication, postgresClient } from "@exulu/backend";

const { db } = await postgresClient();
const result = await ExuluAuthentication.authenticate({
  apikey: "sk_abc123.../production-api-key",
  db
});

if (!result.error) {
  console.log(`Authenticated as: ${result.user?.email}`);
}

NextAuth session tokens

import { getToken } from "next-auth/jwt";

const token = await getToken({ req });
const result = await ExuluAuthentication.authenticate({
  authtoken: token,
  db
});

Internal service keys

const result = await ExuluAuthentication.authenticate({
  internalkey: process.env.INTERNAL_SECRET,
  db
});

📊 Evaluation framework

Test and measure agent performance:

import { ExuluEval } from "@exulu/backend";

const evaluation = new ExuluEval({
  id: "accuracy",
  name: "Response Accuracy",
  description: "Measures response accuracy",
  llm: false,
  execute: async ({ messages, testCase }) => {
    const response = messages[messages.length - 1]?.content || "";
    return response === testCase.expected_output ? 100 : 0;
  }
});

const score = await evaluation.run(agent, backend, testCase, messages);
console.log(`Score: ${score}/100`);

🔬 OpenTelemetry integration

Monitor your application with distributed tracing and logging:

import { ExuluOtel } from "@exulu/backend";

const otel = ExuluOtel.create({
  SIGNOZ_TRACES_URL: process.env.SIGNOZ_TRACES_URL!,
  SIGNOZ_LOGS_URL: process.env.SIGNOZ_LOGS_URL!,
  SIGNOZ_ACCESS_TOKEN: process.env.SIGNOZ_ACCESS_TOKEN!
});

otel.start();

// Enable in ExuluApp
await app.create({
  config: {
    telemetry: { enabled: true },
    workers: {
      telemetry: { enabled: true },
      enabled: true
    }
  }
});

🌍 Environment variables

Create a .env file with:

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/exulu

# NextAuth
NEXTAUTH_SECRET=your-secret-key

# Redis (optional, for workers)
REDIS_HOST=localhost
REDIS_PORT=6379

# S3 Storage (optional, for file uploads)
COMPANION_S3_REGION=us-east-1
COMPANION_S3_KEY=your-key
COMPANION_S3_SECRET=your-secret
COMPANION_S3_BUCKET=exulu-uploads
COMPANION_S3_ENDPOINT=https://s3.amazonaws.com

# OpenTelemetry (optional)
SIGNOZ_TRACES_URL=http://localhost:4318/v1/traces
SIGNOZ_LOGS_URL=http://localhost:4318/v1/logs
SIGNOZ_ACCESS_TOKEN=your-token

📦 Complete example

For a production-ready implementation, see the Exulu Example Repository:

git clone https://github.com/Qventu/exulu-example.git
cd exulu-example
npm install
docker compose up -d
npm run utils:initdb
npm run dev:server

The example includes:

  • ✅ Docker Compose for all services
  • ✅ Database initialization
  • ✅ Pre-configured agents
  • ✅ Context examples
  • ✅ Custom tools
  • ✅ Worker implementation
  • ✅ Environment templates

Add the admin frontend:

# In a new terminal window
npx @exulu/frontend

Visit http://localhost:3001 to access the admin interface. See the Exulu Frontend repository for more details.

Audit logging

Enable an auditable, S3-backed trail of tool calls (which agent called which tool, on whose behalf, using which credential identity, with what payload). Off by default. Configure via ExuluApp.create({ config }):

await app.create({
  tools,
  config: {
    // ...existing config...
    audit: {
      enabled: true,
      retentionDays: 90,            // S3 lifecycle expiry
      // Optional: a dedicated, isolated bucket. Omit to reuse `fileUploads`.
      s3: {
        s3region: process.env.AUDIT_S3_REGION!,
        s3key: process.env.AUDIT_S3_KEY!,
        s3secret: process.env.AUDIT_S3_SECRET!,
        s3Bucket: process.env.AUDIT_S3_BUCKET!,
        s3prefix: "audit/",
      },
      // failureMode: "open" (default) | "closed"
      // sources: { toolCalls: { exclude: ["noisy_tool"] } },
    },
  },
});

Records are written as newline-delimited JSON under audit/dt=2026-07-28/14/1753970400000-3f8c2a1b.ndjson. Secret material is never logged — only credential identity (provider, account, authType, non-secret scopes/expiry). When reusing the shared fileUploads bucket, the S3 lifecycle rule is not applied automatically (to avoid touching a bucket that also holds user files); the exact rule to apply is logged at startup. Set manageLifecycle: true to apply it anyway.

🛠️ Development

# Install dependencies
npm install

# Build package
npm run build

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

# Type check
npm run type-check

📚 Examples

RAG application

const context = new ExuluContext({
  id: "knowledge",
  name: "Knowledge Base",
  description: "Company knowledge base",
  embedder,
  tableName: "knowledge_items"
});

const agent = new ExuluAgent({
  id: "rag-agent",
  name: "RAG Assistant",
  provider: "anthropic",
  config: {
    instructions: "Answer questions using the knowledge base.",
    model: { create: ({ apiKey }) => anthropic("claude-sonnet-4-5", apiKey) }
  }
});

await app.create({
  agents: [agent],
  contexts: { knowledge: context }
});

// Agent automatically searches context when answering

Multi-agent workflow

const researchAgent = new ExuluAgent({
  id: "researcher",
  name: "Research Agent",
  provider: "openai",
  config: { /* ... */ }
});

const writerAgent = new ExuluAgent({
  id: "writer",
  name: "Writer Agent",
  provider: "anthropic",
  config: { /* ... */ }
});

await app.create({
  agents: [researchAgent, writerAgent],
  contexts: {},
  tools: [webSearchTool, documentTool]
});

Custom tool with API integration

const slackTool = new ExuluTool({
  id: "send_slack_message",
  name: "Send Slack Message",
  description: "Send a message to a Slack channel",
  parameters: z.object({
    channel: z.string(),
    message: z.string()
  }),
  execute: async ({ channel, message }) => {
    const response = await fetch("https://slack.com/api/chat.postMessage", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${process.env.SLACK_TOKEN}`,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ channel, text: message })
    });
    return await response.json();
  }
});

🚨 Need help?

🗺️ Roadmap

Check out our Roadmap Discussion to see what we're working on and suggest features.

📄 License

This project is licensed under a commercial license. See exulu.com for licensing information.

The Exulu Example Project is open source under the MIT License.

Exulu Frontend →

GitHub stars

Modern admin interface built with Next.js 15
Manage agents, contexts, and workflows visually

Exulu Example →

GitHub stars

Complete implementation example
Docker setup with all services configured

⭐ Star us on GitHub

If you find Exulu IMP useful, give us a star! It helps others discover the project.

Star History Chart

👏 Thanks to all our contributors



Exulu IMP - Intelligence Management Platform

Made with ❤️ by Qventu

Website · Documentation · Frontend · Discord

版本与发布记录

@exulu/backend 共发布 192 个版本,首次发布于 2025/05/22;过去 12 个月发布了 108 个版本。

版本发布日期距今
5.11.1latest2026/11/13今天
5.11.02026/11/131 天前
5.10.12026/11/121 天前
5.10.02026/11/112 天前
5.9.02026/11/094 天前
5.8.22026/11/0410 天前

关于 @exulu/backend 的常见问题

@exulu/backend 是什么?

Exulu IMP (Intelligence Management Platform) is an open-source TypeScript framework for building production-ready AI agent applications. It provides the backend infrastructure for managing agents, semantic search contexts, background job processing, a

如何安装 @exulu/backend?

在项目目录运行 npm install @exulu/backend,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:typescript(^5.8.3)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 backend、setup-python、exulu-start-whisper,可以用 npx backend 直接运行。

@exulu/backend 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@exulu/backend 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@exulu/backend 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js 22.18.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@exulu/backend 可以商用吗?

@exulu/backend 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@exulu/backend 的下载量有多少?

根据 npm 官方下载统计,@exulu/backend 在 2026/10/14 – 2026/11/12 这 30 天内被下载 3,926 次,日均约 131 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@exulu/backend 还在维护吗?

最新版本 5.11.1 发布于 2026/11/13(今天);至今共发布 192 个版本,其中过去 12 个月发布了 108 个;首次发布于 2025/05/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。