Prompts

Save and organize prompts for your RAG agents.

Overview

Prompts allow you to save reusable query templates that you can use with your agents. Instead of typing the same complex queries repeatedly, create a prompt once and use it whenever needed.

Key features:

  • Variable placeholders: Use {{variable}} syntax for dynamic content
  • Organization: Group prompts into folders
  • Favorites: Mark frequently used prompts for quick access
  • Scope: Apply to entire workspace or specific datastores

Creating Prompts

Using the Dashboard

  1. Navigate to Prompts in the sidebar
  2. Click Create Prompt
  3. Fill in the prompt details:
    • Title: A descriptive name
    • Description: What this prompt is for (optional)
    • Content: The prompt template
  4. Choose the scope (workspace or datastore)
  5. Click Create

Using the API

javascript
1const prompt = await client.prompts.create({
2 title: 'Contract Risk Assessment',
3 description: 'Analyze a contract for potential risks',
4 content: `Analyze the following contract for {{company_name}} and identify:
51. Liability risks
62. Termination clauses
73. Payment terms
84. Unusual provisions
9
10Contract type: {{contract_type}}
11Focus areas: {{focus_areas}}`,
12});

Variable Syntax

Use double curly braces to define variables in your prompts:

Summarize the {{document_type}} for {{company_name}}. Focus on: - {{focus_area_1}} - {{focus_area_2}} Output format: {{output_format}}

Variable Extraction

When you use a prompt, Orka automatically extracts variables and prompts you to fill them in:

| Variable | Value | |----------|-------| | document_type | quarterly report | | company_name | Acme Corp | | focus_area_1 | revenue trends | | focus_area_2 | risk factors | | output_format | bullet points |

Default Values

You can provide default values using the pipe syntax:

Summarize the {{document_type|contract}} for {{company_name}}. Output format: {{output_format|bullet points}}

Managing Prompts

Folders

Organize prompts into folders for easier navigation:

javascript
1// Create a folder
2const folder = await client.prompts.createFolder({
3 name: 'Legal Analysis',
4});
5
6// Create prompt in folder
7const prompt = await client.prompts.create({
8 title: 'Due Diligence Check',
9 content: '...',
10 folder_id: folder.id,
11});

Favorites

Mark prompts as favorites for quick access:

javascript
1await client.prompts.favorite('prompt_abc123');
2
3// List favorites
4const favorites = await client.prompts.list({
5 favorites_only: true,
6});

Updating Prompts

javascript
1await client.prompts.update('prompt_abc123', {
2 title: 'Updated Title',
3 content: 'Updated content with {{new_variable}}',
4});

Deleting Prompts

javascript
1await client.prompts.delete('prompt_abc123');

Using Prompts with Agents

In the Chat Interface

  1. Open the chat with your agent
  2. Click the Prompts button (or press /)
  3. Select a prompt from the list
  4. Fill in any variables
  5. Send the query

Via API

javascript
1// Use a prompt directly
2const response = await client.chat.query({
3 agent_id: 'agt_abc123',
4 prompt_id: 'prompt_xyz789',
5 variables: {
6 company_name: 'Acme Corp',
7 document_type: 'contract',
8 },
9});

Scope

Workspace-level

Prompts available across your entire workspace:

javascript
1await client.prompts.create({
2 title: 'General Summary',
3 content: 'Summarize the key points of {{topic}}',
4 // No datastore_id = workspace-level
5});

Datastore-specific

Prompts only available when querying a specific datastore:

javascript
1await client.prompts.create({
2 title: 'Legal Contract Analysis',
3 content: 'Analyze {{contract_name}} for compliance issues',
4 datastore_id: 'ds_legal123',
5});

Best Practices

Writing Effective Prompts

  1. Be specific: Include clear instructions for the AI
  2. Use structure: Break complex prompts into numbered steps
  3. Include output format: Specify how you want results formatted
  4. Add context: Include relevant background when helpful

Example: Good Prompt

Analyze the {{document_type}} and provide: 1. **Executive Summary** (2-3 sentences) 2. **Key Findings** (bullet points) 3. **Risk Assessment** (High/Medium/Low with explanation) 4. **Recommended Actions** (numbered list) Focus area: {{focus_area}} Audience: {{audience|executive leadership}}

Example: Poor Prompt

Tell me about {{thing}}

Next Steps