Skip to main content
Version: 2.0

Installing the AI Server SDK

The Reveal SDK AI Server provides the backend services needed to power AI features in your applications. It integrates with LLM providers and manages AI operations like insight generation, dashboard creation, and conversational analytics.

The AI Server SDK ships for ASP.NET Core, Node.js, and Java. The setup steps map one-to-one across platforms — install the AI package, configure an LLM provider, point at a metadata catalog, and run.

Prerequisites

Before installing the AI Server SDK, ensure you have:

  1. The base Reveal SDK Server installed and configured
  2. The platform runtime for your project:
    • ASP.NET Core: .NET 8.0 or higher
    • Node.js: Node.js 16 or higher
    • Java: Java 17 or higher and Maven 3.6 or higher
  3. Access to at least one LLM provider (OpenAI, Anthropic, Google, etc.)
  4. LLM provider API keys configured

Step 1: Install the AI Package

The AI Server SDK for ASP.NET Core is distributed as a NuGet package. Right-click your Solution or Project and select Manage NuGet Packages, then install Reveal.Sdk.AI.AspNetCore.

Or using the .NET CLI:

dotnet add package Reveal.Sdk.AI.AspNetCore

Or using the Package Manager Console:

Install-Package Reveal.Sdk.AI.AspNetCore

Step 2: Register the AI Services

The AI SDK extends the base Reveal SDK, so you need both configured. Register the AI services where you wire up Reveal in your application.

Program.cs
using Reveal.Sdk;
using Reveal.Sdk.AI;

var builder = WebApplication.CreateBuilder(args);

// Add Reveal SDK (required)
builder.Services.AddControllers().AddReveal();

// Add Reveal AI services
builder.Services.AddRevealAI();

var app = builder.Build();
app.MapControllers();
app.Run();

Step 3: Install and Configure an LLM Provider

Configure the LLM provider you want to use. Each provider topic (OpenAI, Azure OpenAI, Anthropic, Google Gemini) has full setup details — what follows is the OpenAI quickstart.

Install the provider NuGet package and chain .AddOpenAI(...) after AddRevealAI():

dotnet add package Reveal.Sdk.AI.OpenAI
Program.cs
builder.Services.AddRevealAI()
.AddOpenAI(options =>
{
options.ApiKey = builder.Configuration["RevealAI:OpenAI:ApiKey"];
});

Available built-in providers:

ProviderASP.NET NuGetNode.js / Java keyGuide
OpenAIReveal.Sdk.AI.OpenAIopenaiSetup guide
Azure OpenAIReveal.Sdk.AI.AzureOpenAIazure-openaiSetup guide
AnthropicReveal.Sdk.AI.AnthropicanthropicSetup guide
Google GeminiReveal.Sdk.AI.GooglegoogleSetup guide
Never Commit API Keys

Never commit API keys to source control. Always use environment variables, User Secrets, or a secure key management service.

Step 4: Install and Configure a Metadata Provider

The metadata catalog tells the AI which datasources exist. It can be loaded from a JSON file on disk or from a custom provider (e.g., database-backed). For the built-in file provider, point the AI builder at a JSON catalog.

1. Create a catalog file:

config/catalog.json
{
"Datasources": [
{
"Id": "NorthwindDB",
"Provider": "SQLServer"
}
]
}

2. Point the builder at the file:

Program.cs
builder.Services.AddRevealAI()
.UseMetadataCatalogFile("config/catalog.json");

Both absolute and relative paths are supported. Relative paths are resolved against the application's current working directory.

Complete Example

Here's a complete server with the AI features configured end-to-end.

Program.cs
using Reveal.Sdk;
using Reveal.Sdk.AI;

var builder = WebApplication.CreateBuilder(args);

// Add CORS for cross-origin requests
builder.Services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
{
policy.WithOrigins("http://localhost:4200")
.AllowAnyMethod()
.AllowAnyHeader();
});
});

// Add base Reveal SDK
builder.Services.AddControllers().AddReveal(revealBuilder =>
{
revealBuilder.AddSettings(settings =>
{
settings.LocalFileStoragePath = "Data";
});
});

// Add Reveal AI with OpenAI provider
builder.Services.AddRevealAI()
.AddOpenAI(options =>
{
options.ApiKey = builder.Configuration["RevealAI:OpenAI:ApiKey"];
options.Model = "gpt-4.1";
})
.UseMetadataCatalogFile("config/catalog.json");

var app = builder.Build();

app.UseCors();
app.MapControllers();

app.Run();

Verify Installation

After installation, verify the AI SDK is properly configured.

Step 1: Run Your Application

dotnet run

Step 2: Check AI Endpoints

The AI SDK adds endpoints under /api/reveal/ai/. Test the metadata status endpoint:

curl http://localhost:5111/api/reveal/ai/metadata/status

Expected response once the system is ready:

{
"status": "Completed",
"isInitialized": true
}
Get the Code

A complete multi-platform sample is available on GitHub, with aspnet/, node/, and java/ sub-folders for each server platform.