AI Tools
Multi-model streaming chat, AI workbench, RAG administration, content generation, and fact-checking tools in the Arcturus-Prime admin
AI Tools
The Arcturus-Prime admin panel includes a suite of AI-powered tools for content creation, conversation, knowledge management, and quality assurance. All tools support multiple AI providers (OpenRouter, Anthropic, Google GenAI, and local Ollama) with model selection at the point of use. Streaming responses are delivered via server-sent events across all chat-based interfaces.
Chat (/admin/chat)
The chat interface at /admin/chat provides a multi-model streaming chat environment for direct conversation with AI models. It is the primary interface for ad-hoc AI interactions that do not fit into structured workflows.
Conversation Management
Chat supports persistent conversations stored server-side. Each conversation has a unique ID, a title (auto-generated from the first message or manually set), and a full message history. Conversations are listed in a sidebar panel sorted by last activity. Users can create new conversations, rename existing ones, delete old ones, or pin frequently used conversations to the top of the list.
Streaming Architecture
All chat responses stream via server-sent events (SSE) through the /api/admin/chat endpoint. The flow:
- The client sends a POST request with the conversation history and selected model
- The server opens a connection to the selected provider’s streaming API
- As tokens arrive from the provider, the server re-emits them as SSE
dataevents - The client appends tokens to the response message in real-time
- On stream completion, the server sends a final
doneevent with token usage metadata - The client saves the complete message to the conversation history
This architecture avoids exposing API keys to the browser and provides a consistent streaming interface regardless of the underlying provider.
Model Selection
A model picker dropdown in the chat header allows switching between available models. The picker groups models by provider:
- OpenRouter — Kimi K2.5 (free tier, used for public chat), DeepSeek V3, Llama 3.3 70B, Mistral Large, and additional models as configured
- Anthropic — Claude Sonnet 4, Claude Opus 4 (admin workbench only)
- Google GenAI — Gemini 2.5 Pro, Gemini 2.5 Flash
- Ollama — locally running models discovered via the Ollama API at
http://localhost:11434(runs on Capella-Outpost at 10.42.0.100 with RTX 4070 Ti), currently nomic-embed-text and qwen2.5:14b
The selected model persists per conversation, so different conversations can use different models simultaneously.
System Prompts
Each conversation can have a custom system prompt. A library of pre-built system prompts is available through the /api/admin/ai-prompts endpoint, covering roles like technical writer, code reviewer, devops consultant, and security auditor. Custom system prompts can be saved to the library for reuse.
Workbench (/admin/workbench)
The AI workbench at /admin/workbench extends the chat concept into a multi-conversation workspace. Where chat handles one conversation at a time, the workbench manages multiple simultaneous conversations in a tabbed or split-pane layout.
Multi-Conversation Interface
The workbench renders conversations in configurable layouts:
- Tabs — each conversation in its own tab, one visible at a time
- Side by side — two conversations visible simultaneously in a horizontal split
- Grid — four conversations visible in a 2x2 grid, useful for comparing outputs across models
Each conversation pane is a full chat interface with its own model selection, system prompt, and message history. This makes the workbench ideal for A/B testing prompts across different models or working on multiple content pieces simultaneously.
Workbench-Only Features
- Cross-conversation paste — copy a response from one conversation and paste it as user input in another
- Model comparison — send the same prompt to multiple models simultaneously and view responses side by side
- Export — export conversation history as Markdown, JSON, or plain text
- Context injection — inject content from the CMS (posts, journal entries, docs) directly into a conversation as context
RAG Admin (/admin/rag)
The RAG administration interface at /admin/rag provides management tools for the retrieval-augmented generation knowledge base. The knowledge base powers contextual AI responses across the platform by providing relevant content chunks as context to AI models.
Knowledge Base Overview
The main view shows statistics about the current embedding index:
- Total documents indexed
- Total chunks generated
- Index file size (
/public/embeddings-index.json) - Last build timestamp
- Collection breakdown (posts, journal, docs, projects, learn)
Index Management
Administrators can trigger a full re-index or a selective re-index of specific collections. The re-index process runs scripts/build-embeddings.js which chunks content, generates embeddings via the configured provider, and writes the updated index. Progress is displayed in real-time as collections are processed.
Search Testing
A search test panel allows administrators to enter a query and see the RAG retrieval results: which chunks are returned, their similarity scores, and which source documents they came from. This is essential for tuning the retrieval pipeline and verifying that the knowledge base returns relevant results.
For the full RAG pipeline architecture, see the RAG Pipeline documentation.
Content Generation
The content generation tools provide AI-assisted creation capabilities driven by the Arcturus-Prime voice profile.
/api/admin/content-gen (POST)
The primary content generation endpoint. Accepts a JSON body with:
type— target content type:post,journal,doc, orprojecttopic— the subject to write aboutoutline— optional structured outline to followlength— target word count (short: 500, medium: 1000, long: 2000)model— which AI model to use (defaults to the configured generation model)
The endpoint loads the voice profile from data/voice-profile.md, constructs a system prompt that combines the voice profile with content-type-specific instructions, and streams the generated content back. The response includes both the generated Markdown and suggested frontmatter.
/api/admin/generate-image (POST)
Generates images for content using AI image generation models. Accepts a prompt and optional parameters (aspect ratio, style). Returns a URL to the generated image, which is automatically downloaded and stored in public/images/generated/. The endpoint currently routes through OpenRouter to supported image models.
/api/admin/ai-coach (POST)
The AI writing coach provides feedback on content quality. Submit a piece of content and the coach returns structured feedback covering:
- Clarity — are the ideas expressed clearly and unambiguously?
- Technical accuracy — are technical claims correct and well-supported?
- Voice alignment — does the content match the Arcturus-Prime voice profile?
- Structure — is the content well-organized with effective headings and flow?
- Engagement — will the target audience find this interesting and useful?
Each category receives a score from 1-10 with specific suggestions for improvement. The coach uses the voice profile as its rubric for voice alignment scoring.
/api/admin/ai-prompts (GET/POST)
A stored prompt template library. GET returns all saved prompts. POST creates or updates a prompt. Each prompt has a name, category, template text with variable placeholders, and metadata about which models it works best with. Prompts are used by the chat, workbench, and content generation interfaces.
Identity Authenticity & Fact Checking
The Identity Authenticity System verifies factual claims across all site content against a ground truth database and multiple search indexes. It uses a multi-tier verification pipeline that minimizes LLM calls by resolving claims locally first.
Ground Truth Database
The file data/identity-ground-truth.json stores verified facts organized by category (professional, technical, personal, infrastructure, network). Each fact entry has:
- fact — the verified claim text
- confidence —
high,medium, orlow - source — where the fact was verified (e.g., “interview-2026-02-23”, “linkedin-profile”)
- category — grouping for efficient lookup
Ground truth is the fastest verification tier — regex matching against known facts with no API calls.
Claim Extraction (src/lib/fact-checker.ts)
The extractClaims() function scans Markdown content using 15 regex patterns to identify factual assertions:
- Numeric claims (“18+ years”, “66 cores”, “4 servers”)
- Technology claims (“runs Gentoo”, “uses Proxmox”)
- Professional claims (“works at”, “certified in”)
- Temporal claims (“since 2008”, “started in”)
- Geographic claims (“based in”, “located at”)
Claims are deduplicated and returned with surrounding context for verification.
Multi-Tier Verification Pipeline
The fact_scan action in /api/admin/probes runs the full pipeline:
- Extract claims — regex patterns find factual assertions in content
- Ground truth check —
checkClaimsAgainstGroundTruth()matches claims against the verified facts database. Resolved claims skip all remaining tiers - RAG search — queries both the vault RAG index (BM25 + vector hybrid) and site embeddings (cosine similarity) for supporting or contradicting context
- LLM verification — the
contentFactCheckerprompt sends unresolved claims to Groq with all gathered context. The LLM returns a verdict for each claim - Probe creation — claims with
contradicted,unverifiable, orembellishedverdicts are created as probes for human review
Each claim receives a verdict: verified, contradicted, unverifiable, or embellished.
API Actions (/api/admin/probes)
fact_scan — Scans a single file. Requires fileId and collection. Runs the full pipeline and returns a summary with verdict counts and created probes.
fact_scan_batch — Iterates all content files (filterable by collections, fileIds, skipReviewed). Runs fact_scan per file and tracks results in a session.
add_probe — Creates a probe directly from user input (manual). Requires id, collection, and data.question. Sets auditType: 'manual'.
Probe Studio UI (/admin/probe-studio)
The Probe Studio provides batch fact scanning across multiple files:
- Fact Scan button — amber toolbar button that scans all selected files
- Progress modal — shows per-file progress during batch scans
- Verdict summary — displays counts of verified/contradicted/unverifiable/embellished claims after scan
- Session type badges — fact_scan and identity_audit sessions are visually distinguished in session history
Editor UI (/admin/edit)
The editor integrates per-file fact checking in the probe panel:
- Fact Check button — runs
fact_scanon the currently open file - Verdict summary banner — color-coded verdict counts appear at the top of the probe panel
- Fact scan probes — probes created by fact scanning show verdict badges, claim type tags, and evidence blocks with supporting/contradicting context
- Manual probe creation — “Add Probe” form allows creating probes manually via the
add_probeAPI
Security Analysis (/api/admin/doc-security-analyze)
The AI security analyzer provides on-demand risk assessment for documentation flagged by the Public Docs Security Review page. When an admin clicks “AI Analyze” on a doc card, the doc’s risk data (categories, severities, match counts, content samples) is sent to this endpoint for evaluation.
How It Works
The endpoint constructs a prompt that includes the doc’s security scan results and context about the Arcturus-Prime identity sanitization system (Galactic Identity System — star-system names, sanitized IP ranges, role-based user aliases). The AI evaluates whether the remaining patterns (those that survived sanitization) pose a real security risk.
Response Structure
{
"safetyRating": "CAUTION",
"summary": "Port numbers combined with service management commands reveal internal service topology",
"riskBreakdown": [
{
"category": "network-topology",
"severity": "medium",
"explanation": "Internal port numbers reveal which services run on which ports",
"threat": "Attacker could probe these ports to find running services"
}
],
"attackerPerspective": "An attacker could correlate port numbers with known service defaults...",
"recommendations": ["Replace specific port numbers with generic references"],
"sanitizationAdvice": "Add port number ranges to identity_map.json",
"publishable": false
}
Make Safe Mode
The same endpoint supports mode: "make-safe" which switches the AI prompt from risk analysis to strip-rule generation. Instead of a full security assessment, the AI returns specific find-and-replace rules that remove the flagged patterns while preserving educational value:
find— plain literal string or simple regex matching the dangerous content (the prompt instructs the AI to prefer readable literal text over regex syntax)replace— safe, human-readable alternative (e.g.,<port>,user@<host>,SERVICE_TOKEN)example— concrete before→after showing what the change looks like (e.g.,ssh [email protected] → ssh user@<host>)description— plain-English explanation of what is being removed and why it’s dangerouscategory— which risk category it addresses
These strip rules are stored in the approval file and applied by the sanitize script during build. See Public Docs Security Review for the full Make Safe workflow.
Model
Uses the fast tier (Gemini 2.0 Flash) via callAIJson() for low latency. Both analysis and make-safe modes typically return in 2-4 seconds. When GOOGLE_API_KEY is set, calls go directly to Google’s free API (generativelanguage.googleapis.com). Falls back to OpenRouter only if the Google key is missing.
Voice Scoring
/api/admin/voice-check (POST)
Analyzes content against the Arcturus-Prime voice profile and returns an authenticity score. The score ranges from 0-100, where 100 means the content perfectly matches the expected writing style. The response includes:
- Overall score — aggregate voice alignment percentage
- Dimension scores — individual scores for tone, vocabulary, sentence structure, technical depth, and personality
- Specific feedback — line-by-line annotations where the content deviates from the voice profile
- Rewrite suggestions — alternative phrasings that better match the voice
/api/argonaut/voice-score (POST)
An alternative voice scoring endpoint exposed through the Argonaut agent API. This endpoint uses the Argonaut’s internal voice model which has been fine-tuned on the full corpus of Arcturus-Prime content. It provides a more nuanced score but is slower than the direct voice-check endpoint. Both endpoints return compatible response formats so they can be used interchangeably in the content pipeline.
Model Routing Strategy
Different tools route to different models based on their requirements:
| Use Case | Default Model | Provider | Reason |
|---|---|---|---|
| Public chat | Kimi K2.5 | OpenRouter (free) | Zero cost for public visitors |
| Admin chat | DeepSeek V3 | OpenRouter | Fast, capable, cost-effective |
| Content generation | Claude Sonnet 4 | Anthropic | Best writing quality |
| Fact checking | Gemini 2.5 Pro | Google GenAI | Strong factual grounding |
| Voice scoring | Claude Sonnet 4 | Anthropic | Nuanced style analysis |
| Embeddings | text-embedding-3-small | OpenRouter/Ollama | Standard embedding model |
| Code tasks | Claude Opus 4 | Anthropic | Strongest reasoning |
| Security analysis | Gemini 2.0 Flash | Google GenAI | Fast, structured JSON output |
Model routing is configured in the environment and can be overridden per-request in admin tools.