diff --git a/.env.example b/.env.example index 10288d95..030a0700 100644 --- a/.env.example +++ b/.env.example @@ -19,15 +19,19 @@ NEXT_PUBLIC_AUTH_PROVIDER="credentials" # OIDC_CLIENT_SECRET="" # ─── AI Pipeline ───────────────────────────────────────────────────────────── -ANTHROPIC_API_KEY="" -OPENAI_API_KEY="" # Pathfinder embeddings (text-embedding-3-small) +ANTHROPIC_API_KEY="" # Optional: explicit anthropic rollback / direct legacy generator +OPENAI_API_KEY="" # Required default: investigation, verification, classification, sentiment PATHFINDER_URL="http://localhost:3100" PATHFINDER_MCP_URL= # Pathfinder knowledge base URL FALLBACK_DOCS_URL= # Fallback documentation URL -AI_RESPONSE_MODEL= # Override AI response model (default: claude-sonnet-4-20250514) -AI_CONFIDENCE_MODEL= # Override confidence scoring model -AI_CLASSIFIER_MODEL= # Override ticket classifier model -AI_SENTIMENT_MODEL= # Override sentiment analysis model +AI_RESPONSE_PROVIDER=openai # openai (default) or anthropic (rollback) +AI_RESPONSE_MODEL= # Defaults to gpt-5.6-luna; claude-sonnet-4-6 for anthropic +AI_LEGACY_RESPONSE_MODEL= # Direct legacy generator default: claude-sonnet-4-6 +AI_DRAFT_LINT_MODE=report # report (default) or enforce after false-positive review +OPENAI_AGENTS_DISABLE_TRACING=0 # Set 1 to disable; sensitive trace payloads are always off +AI_CONFIDENCE_MODEL= # Default gpt-5.6-luna (Claude Haiku for anthropic) +AI_CLASSIFIER_MODEL= # Default gpt-5.6-luna (Claude Haiku for anthropic) +AI_SENTIMENT_MODEL= # Default gpt-5.6-luna (Claude Haiku for anthropic) # ─── Shadow Mode ───────────────────────────────────────────────────────────── # Set to 'true' to run the full AI pipeline but LOG responses instead of posting diff --git a/README.md b/README.md index a35d94dd..31bc1800 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ AI-powered support operations platform by CopilotKit. Outpost unifies customer s ├──────────┬──────────┬─────────────┼────────────┬────────────────┤ │ pkg/ai │ pkg/queue│ pkg/shared │ pkg/db │ │ │ Pathfinder│ Postgres │ Types & │ Prisma │ │ -│ + Claude │ Job Queue│ Constants │ Schema │ │ +│ + OpenAI │ Job Queue│ Constants │ Schema │ │ ├──────────┴──────────┴─────────────┴────────────┘ │ │ PostgreSQL 16 + pgvector │ └─────────────────────────────────────────────────────────────────┘ @@ -24,7 +24,7 @@ AI-powered support operations platform by CopilotKit. Outpost unifies customer s ### Prerequisites -- Node.js >= 20 +- Node.js >= 24 - pnpm >= 9 - Docker (for local PostgreSQL) @@ -56,16 +56,18 @@ pnpm db:seed pnpm dev ``` +Set `OPENAI_API_KEY` for the default Luna support investigator, independent verifier, classifier, and sentiment analyzer. `ANTHROPIC_API_KEY` is only needed for the explicit Anthropic rollback or direct legacy generator. See [support-agent configuration](docs/support-agent.md). + ### Key Commands -| Command | Description | -|---------|-------------| -| `pnpm dev` | Start all apps in development mode | -| `pnpm build` | Build all apps and packages | -| `pnpm lint` | Lint all packages | -| `pnpm typecheck` | Type-check all packages | -| `pnpm test` | Run all tests | -| `pnpm format` | Format code with Prettier | +| Command | Description | +| ---------------- | ---------------------------------- | +| `pnpm dev` | Start all apps in development mode | +| `pnpm build` | Build all apps and packages | +| `pnpm lint` | Lint all packages | +| `pnpm typecheck` | Type-check all packages | +| `pnpm test` | Run all tests | +| `pnpm format` | Format code with Prettier | ## Project Structure @@ -77,7 +79,7 @@ outpost/ │ ├── github-app/ # GitHub App for issue/discussion tracking │ └── docs/ # Public documentation site ├── packages/ -│ ├── ai/ # AI pipeline (Pathfinder + Claude) +│ ├── ai/ # AI pipeline (Pathfinder + OpenAI) │ ├── db/ # Prisma schema and database client │ ├── queue/ # Postgres-based job queue │ └── shared/ # Shared types, constants, utilities diff --git a/apps/discord-bot/Dockerfile b/apps/discord-bot/Dockerfile index 1d0ca56b..2f26eb5b 100644 --- a/apps/discord-bot/Dockerfile +++ b/apps/discord-bot/Dockerfile @@ -1,5 +1,5 @@ # ── Stage 1: prune the monorepo to only what @copilotkit/outpost-discord-bot needs ────── -FROM node:20-alpine AS pruner +FROM node:24-alpine AS pruner RUN apk add --no-cache libc6-compat WORKDIR /app @@ -10,7 +10,7 @@ COPY . . RUN turbo prune @copilotkit/outpost-discord-bot --docker # ── Stage 2: install dependencies and build ────────────────────────────────── -FROM node:20-alpine AS installer +FROM node:24-alpine AS installer RUN apk add --no-cache libc6-compat openssl WORKDIR /app @@ -24,7 +24,7 @@ COPY --from=pruner /app/tsconfig.json ./tsconfig.json RUN pnpm turbo run build --filter=@copilotkit/outpost-discord-bot # ── Stage 3: production image ──────────────────────────────────────────────── -FROM node:20-alpine AS runner +FROM node:24-alpine AS runner RUN apk add --no-cache libc6-compat openssl RUN addgroup --system --gid 1001 outpost && \ diff --git a/apps/docs/architecture/index.html b/apps/docs/architecture/index.html index b44456a1..21640428 100644 --- a/apps/docs/architecture/index.html +++ b/apps/docs/architecture/index.html @@ -58,7 +58,7 @@

System Diagram

├─────────┬────────┴──┬───────────┬───┴──────────────────┴────────────────────┤ │ pkg/ai │pkg/queue │pkg/shared │ pkg/db │ │Pathfinder│ Postgres │ Types & │ Prisma │ -│+ Claude │ Job Queue │ Constants │ Schema │ +│+ OpenAI │ Job Queue │ Constants │ Schema │ ├─────────┴───────────┴───────────┴───────────────────────────────────────────┤ │ PostgreSQL 16 │ └──────────────────────────────────────────────────────────────────────────────┘ @@ -108,8 +108,8 @@

Shared Packages

packages/ai — AI Pipeline

The intelligence layer. Uses Pathfinder - for semantic search across the knowledge base and Claude for ticket classification, - priority assignment, response drafting, and routing decisions. All AI operations go + for semantic search across the knowledge base and OpenAI Agents SDK with Luna for ticket classification, + priority assignment, response drafting, independent verification, sentiment analysis, and routing decisions. All AI operations go through this package.

@@ -198,7 +198,7 @@

Technology Stack

LanguageTypeScript DatabasePostgreSQL 16 ORMPrisma - AIClaude (Anthropic) + Pathfinder + AIOpenAI Agents SDK (Luna) + Pathfinder Discorddiscord.js Slack@slack/bolt TeamsBot Framework SDK (botbuilder) diff --git a/apps/docs/configuration/index.html b/apps/docs/configuration/index.html index 770f30da..cfaf61f3 100644 --- a/apps/docs/configuration/index.html +++ b/apps/docs/configuration/index.html @@ -51,12 +51,27 @@

AI Configuration

- - + + + + + + + + + +
VariableDescriptionDefault
ANTHROPIC_API_KEYAnthropic API key for Claude—
AI_MODELClaude model to use for triage and responsesclaude-sonnet-4-6
OPENAI_API_KEYRequired for the default Luna investigator, independent verifier, classifier, and sentiment analyzer—
ANTHROPIC_API_KEYOptional; required only for the Anthropic rollback or direct legacy generator—
AI_RESPONSE_PROVIDERProvider for response generation and auxiliary checks: openai or anthropicopenai
AI_RESPONSE_MODELInvestigator model; defaults to claude-sonnet-4-6 for Anthropicgpt-5.6-luna
AI_CONFIDENCE_MODELIndependent confidence verifier; defaults to claude-haiku-4-5-20251001 for Anthropicgpt-5.6-luna
AI_CLASSIFIER_MODELTicket classifier; defaults to claude-haiku-4-5-20251001 for Anthropicgpt-5.6-luna
AI_SENTIMENT_MODELSentiment analyzer; defaults to claude-haiku-4-5-20251001 for Anthropicgpt-5.6-luna
AI_LEGACY_RESPONSE_MODELDirect legacy-generator model when the pipeline provider is OpenAIclaude-sonnet-4-6
AI_DRAFT_LINT_MODEreport records violations; enforce routes blocking violations to reviewreport
OPENAI_AGENTS_DISABLE_TRACINGSet to 1 to disable SDK tracing; sensitive trace payloads are always excluded0
PATHFINDER_MCP_URLPathfinder MCP server URL for knowledge base searchhttps://mcp.copilotkit.ai
+

+ Configure OPENAI_API_KEY on the worker and web service. To roll back, set + AI_RESPONSE_PROVIDER=anthropic, provide ANTHROPIC_API_KEY, + and clear any OpenAI model overrides above. Model overrides must match the selected + provider; failures never switch providers automatically. +

+

Discord Bot

diff --git a/apps/docs/contributing/index.html b/apps/docs/contributing/index.html index c4bc66a3..b189722a 100644 --- a/apps/docs/contributing/index.html +++ b/apps/docs/contributing/index.html @@ -86,7 +86,7 @@

Project Structure

│ ├── github-app/ # GitHub App webhook receiver │ └── docs/ # Documentation site (this site) ├── packages/ -│ ├── ai/ # AI pipeline (Pathfinder + Claude) +│ ├── ai/ # AI pipeline (Pathfinder + OpenAI) │ ├── db/ # Prisma schema and client │ ├── queue/ # Postgres-backed job queue │ └── shared/ # Shared types and utilities diff --git a/apps/docs/deployment/index.html b/apps/docs/deployment/index.html index 6a2842de..4c3bf6b8 100644 --- a/apps/docs/deployment/index.html +++ b/apps/docs/deployment/index.html @@ -39,7 +39,7 @@

Deployment Guide

Requirements

@@ -151,7 +151,7 @@

Railway (Recommended)

  • Share DATABASE_URL across all services via Railway's variable references (${{Postgres.DATABASE_URL}})
  • -
  • Fill in secret environment variables (DISCORD_TOKEN, ANTHROPIC_API_KEY, etc.)
  • +
  • Fill in secret environment variables (DISCORD_TOKEN, OPENAI_API_KEY, etc.)
  • Configure custom domains for the web dashboard and GitHub App webhook endpoint
  • @@ -200,7 +200,8 @@

    Environment Checklist

    Before deploying, verify these are all set:

    VariableDescriptionDefault