v2.1.0 Stable

Technical Documentation

API reference, framework selection logic, model specifications, and input field documentation for the Advi prompt engineering platform.

01

API Reference

All prompt generation flows through a single endpoint. The server is stateless — requests are processed in-memory and discarded after the response is returned.

POST/api/refineRequires Clerk auth (userId + orgId)

Request Body

goal: string (required, min 10 chars)

background: string

role: string

audience: string

format: string

tone: string

examples: string

constraints: string

model: string (default: meta-llama/llama-3.1-8b-instruct:free)

outputLength: string

complexity: "simple" | "moderate" | "advanced" | "expert"

priority: "speed" | "balanced" | "quality" | "creative"

domain: string

language: string (default: english)

Response

{ "result": "# FRAMEWORK: [NAME] | REASON: ... | ..." }

400Goal missing or under 10 characters
401Missing userId or orgId
429Rate limit exceeded
503Provider config error (missing API key)
504Request timeout
500Generation failed (generic)
Temperature: 0.7 Max tokens: 4,000 Provider: OpenRouter
02

Framework Selection Engine

The engine analyzes all 14 input fields to select the optimal framework for each request. There is no default — every generation runs a 4-step analysis pipeline before choosing a methodology.

01

Requirements Analysis

Extracts intent from the goal field, assesses complexity level, maps constraints, and identifies information gaps across all provided fields.

02

Structural Assessment

Evaluates which structural pattern fits: role-based, process-based, creative, analytical, or problem-solving. Maps input density to framework complexity.

03

Framework Matching

Selects the single best framework from 20 methodologies. Selection is influenced by complexity level, optimization priority, and domain context.

04

Prompt Optimization

Applies structural delimiters, persona engineering, constraint injection (positive + negative), reasoning activation tokens, and output format specification.

Supported Frameworks

CO-STARComprehensive tasks
RISEMulti-step processes
TRACETechnical instructions
CREATECreative content
SCOPEBusiness analysis
CAREDebugging & resolution
PAINIssue resolution
RTFStreamlined execution
STARProfessional scenarios
ROSESScenario planning
GRADEEducational content
PROMPTFine-grained style
BABTransformation narratives
SOARStorytelling
PREPArgumentation
5W1HInformation gathering
APEAgent delegation
ERARole-based assignment
TAGPurpose-driven execution
Few-ShotPattern matching
03

Model Configuration

All requests route through OpenRouter. The selected model is stored in localStorage as advi_selected_model and persists across sessions.

Llama 3.1 8B Instruct

Default

Meta

128K contextFastFree

meta-llama/llama-3.1-8b-instruct:free

Gemini 3 Flash Preview

Fast

Google

1M contextVery FastLow

google/gemini-3-flash-preview

Claude Sonnet 4.5

Recommended

Anthropic

200K contextFastMedium

anthropic/claude-sonnet-4.5

Grok 4.1 Fast

Beta

xAI

128K contextVery FastMedium

x-ai/grok-4.1-fast

GPT-4o

Stable

OpenAI

128K contextFastMedium

openai/gpt-4o

04

Dashboard Input Fields

The dashboard is organized into 4 collapsible sections. Each field is passed to the API and injected into the system instruction for framework-aware prompt generation.

01

Core Objectives

Primary GoalREQ
textarea

What should the AI accomplish? Minimum 10 characters.

Red (<10) → Yellow (10-49) → Green (50+)

Background Context
textarea

Relevant context, data structures, or requirements that inform the task.

02

Persona & Targeting

Expert Role
text

The AI's assumed expertise, e.g. "Senior Full-Stack Engineer"

Target Audience
text

Who receives the output, e.g. "Junior Developers"

Domain / Industry
text

Specialized field context, e.g. "Healthcare, Finance"

Output Language
select

10 options: English, Spanish, French, German, Russian, Ukrainian, Armenian, Chinese, Japanese, Korean

03

Output Configuration

Format
text

Expected structure: JSON, Markdown, Code, etc.

Tone
text

Communication style: Technical, Conversational, etc.

Output Length
text

Desired size: "500 words", "3 paragraphs"

Complexity Level
select

Simple → Moderate → Advanced → Expert. Maps to technical depth modifiers.

04

Advanced Configuration

Optimization Priority
select

Speed (favors RTF/APE/TAG) → Balanced → Quality (favors CO-STAR/RISE/TRACE) → Creative

Few-Shot Examples
textarea

Input-output pattern demonstrations for behavioral conditioning.

Negative Constraints
textarea

What to explicitly avoid. Injected as NEVER/AVOID directives.

05

Data Architecture

Advi is fully stateless on the server. All persistence is client-side via localStorage.

localStorage keys
advi_historyJSON array of HistoryItem objects, scoped by orgId
advi_selected_modelModel ID string, e.g. "meta-llama/llama-3.1-8b-instruct:free"

HistoryItem Schema

interface HistoryItem {

id: string;

timestamp: number;

goal: string;

result: string;

orgId: string | null;

inputs: {

background?, role?, audience?, format?,

tone?, examples?, constraints?, model?,

outputLength?, complexity?, priority?,

domain?, language?

};

}

Server retention

0 seconds

History scoping

Filtered by orgId

Deletion

Instant & permanent

06

Output Format

Every generated prompt follows a strict output protocol. The first line always identifies the selected framework, the reasoning, and optimization techniques applied.

Generated output structure

# FRAMEWORK: RISE | REASON: Multi-step process | OPTIMIZATIONS: CoT, delimiters

─────────────────────────────────

### ROLE

You are a senior backend engineer with 10+ years...

### INPUT

Given the following database schema and requirements...

### STEPS

1. Analyze the current query performance...

### EXPECTATION

Deliver optimized queries with execution plans...

### CONSTRAINTS

MUST use parameterized queries. NEVER use SELECT *...

### RESPONSE FORMAT

Markdown with SQL code blocks and explanations...

Copy to clipboard

One-click

Download format

.md (Markdown)

Stats display

Chars / Words / Lines