> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnifact.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Examples (Few-Shot Prompting)

> Show Omnifact exactly what you want by providing concrete examples of the desired output.

<Card title="Show, Don't Just Tell" horizontal>
  Examples are one of the most effective ways to guide Omnifact. When you show exactly what you want, you get much more accurate and consistent results.
</Card>

## What is Using Examples?

Using examples means providing Omnifact with samples of the kind of output you want before asking it to perform the same task. Instead of just describing what you want, you show it.

Think of it like training a new employee—you show them examples of well-done work, then ask them to do something similar.

This gives you consistent formatting, appropriate tone, and better accuracy.

In Omnifact, examples work at two levels:

* **In your prompt:** Show the AI exactly what you want for this task (few-shot prompting).
* **In [Chat Instructions](/en/platform/core-features/spaces/customizing-spaces):** Space admins can include standing examples so the Space assistant follows a consistent format across conversations.

## Basic Example Structure

Use this reliable pattern:

```
Here are examples of [what you want]:

EXAMPLE 1: [Your first example]

EXAMPLE 2: [Your second example]

Now do the same for: [Your specific request]
```

## When Examples Work Best

Examples work well in these common business scenarios:

<CardGroup cols={2}>
  <Card title="Classification Tasks" icon="tags">
    Categorizing emails, tickets, or feedback into specific types
  </Card>

  <Card title="Content Creation" icon="pen">
    Writing in a specific style, tone, or format
  </Card>

  <Card title="Data Extraction" icon="magnifying-glass">
    Pulling specific information from documents consistently
  </Card>

  <Card title="Format Matching" icon="square-check">
    Creating consistent layouts or structures
  </Card>
</CardGroup>

## Real-World Examples

<Tabs>
  <Tab title="Email Classification">
    **The Task:** Classify customer support emails by priority and type.

    **With Examples:**

    ```
    Here are examples of how to classify customer support emails:

    EXAMPLE 1: 
    Email: "My account has been charged twice this month. Please refund the duplicate charge immediately."
    Classification: HIGH PRIORITY - Billing Issue

    EXAMPLE 2:
    Email: "I'd like to know more about your premium features. Do you have a comparison chart?"
    Classification: LOW PRIORITY - Sales Inquiry

    Now classify this email:
    "Our entire team can't log in to the system. This is blocking all our work today."
    ```
  </Tab>

  <Tab title="Meeting Summary Format">
    **The Task:** Create consistent meeting summaries.

    **With Examples:**

    ```
    Here are examples of how to format meeting summaries:

    EXAMPLE 1:
    Meeting: Weekly Team Standup - March 15, 2025
    Attendees: Sarah, Mike, Jennifer (3 people)
    Key Decisions: 
    • Move project deadline to March 30th
    • Jennifer to lead customer interviews
    Action Items:
    • Mike: Complete user testing by Friday
    • Sarah: Update project timeline

    EXAMPLE 2:
    Meeting: Budget Review - March 20, 2025  
    Attendees: David, Lisa, Tom, Angela (4 people)
    Key Decisions:
    • Approve $15K marketing budget for Q2
    • Postpone office expansion plans
    Action Items:
    • Lisa: Create Q2 marketing plan
    • Tom: Research remote work tools

    Now format this meeting summary:
    [Your meeting notes]
    ```
  </Tab>

  <Tab title="Data Extraction">
    **The Task:** Extract key information from job applications.

    **With Examples:**

    ```
    Here are examples of extracting key info from resumes:

    EXAMPLE 1:
    Resume: [Resume content for John Smith]
    Extracted Info:
    • Name: John Smith
    • Years Experience: 5 years
    • Key Skills: Python, SQL, Project Management
    • Previous Role: Senior Analyst at TechCorp
    • Education: BS Computer Science, UCLA

    EXAMPLE 2:
    Resume: [Resume content for Maria Garcia]
    Extracted Info:
    • Name: Maria Garcia
    • Years Experience: 8 years  
    • Key Skills: Marketing, Social Media, Analytics
    • Previous Role: Marketing Manager at StartupXYZ
    • Education: MBA Marketing, UC Berkeley

    Now extract the same information from this resume:
    [New resume content]
    ```
  </Tab>
</Tabs>

## Advanced Example Techniques

### Multiple Example Types

When you need to handle different scenarios, provide examples for each:

```
Here are examples of how to respond to different types of customer feedback:

POSITIVE FEEDBACK EXAMPLE:
Customer: "Love the new feature! Makes my job so much easier."
Response: "Thank you for the positive feedback! We're thrilled the new feature is helping your workflow. Please let us know if you have any other suggestions."

NEGATIVE FEEDBACK EXAMPLE:
Customer: "The interface is confusing and slow. Very disappointed."
Response: "Thank you for bringing this to our attention. We understand your frustration and are actively working on interface improvements. I'll connect you with our product team to discuss specific issues."

FEATURE REQUEST EXAMPLE:
Customer: "Would be great if you could add dark mode to the app."
Response: "Great suggestion! Dark mode is actually on our roadmap for the next quarter. I'll add your vote to the request and notify you when it's available."

Now respond to this customer feedback:
[Customer message]
```

### Progressive Examples

Show how complexity can increase across examples:

```
Here are examples of project status updates with increasing detail:

SIMPLE PROJECT:
Status: On Track | Timeline: 2 weeks remaining | Blockers: None

MODERATE PROJECT:
Status: Minor Delays | Timeline: 3 weeks remaining (1 week behind) | Blockers: Waiting for client approval on designs | Next Steps: Follow up with client by Friday

COMPLEX PROJECT:
Status: At Risk | Timeline: 6 weeks remaining (2 weeks behind) | Blockers: (1) Technical integration issues with third-party API, (2) Key team member out sick, (3) Scope creep from stakeholder requests | Next Steps: (1) Schedule technical review meeting, (2) Identify backup resources, (3) Stakeholder alignment meeting to confirm scope

Now create a status update for this project:
[Project details]
```

## Common Few-Shot Mistakes

<AccordionGroup>
  <Accordion title="Too Few Examples">
    **Problem:** Only providing one example, which may not capture the variation you need <br />
    **Solution:** Provide 2-3 examples that show different scenarios or complexity levels <br />
    **Instead of:** One example of email classification <br />
    **Try:** Examples of high-priority, medium-priority, and low-priority classifications <br />
  </Accordion>

  <Accordion title="Inconsistent Examples">
    **Problem:** Examples that use different formats or styles <br />
    **Solution:** Ensure all examples follow the exact same structure and format <br />
    **Check for:** Same headings, same level of detail, same tone across all examples <br />
  </Accordion>

  <Accordion title="Examples Too Complex">
    **Problem:** Examples that are too detailed or contain irrelevant information <br />
    **Solution:** Keep examples focused on the specific task at hand <br />
    **Instead of:** Full email with headers, signatures, and conversation history <br />
    **Try:** Just the essential content needed for the classification task <br />
  </Accordion>
</AccordionGroup>

## Tips for Great Examples

<AccordionGroup>
  <Accordion title="Match Your Real Use Case">
    Make examples as close to your actual work as possible. If you classify support tickets, use realistic support ticket examples.
  </Accordion>

  <Accordion title="Show Edge Cases">
    Include examples of tricky or borderline cases that Omnifact might encounter in your real work.
  </Accordion>

  <Accordion title="Be Consistent">
    All examples should follow exactly the same format, style, and level of detail you want in the final output.
  </Accordion>

  <Accordion title="Test and Refine">
    Try your few-shot prompt with different inputs and adjust your examples if the results aren't consistent.
  </Accordion>
</AccordionGroup>

<Tip>
  The time you spend creating good examples pays off immediately. Well-crafted examples can eliminate hours of back-and-forth refinement on complex tasks.
</Tip>

## Other Intermediate Guides

* Review [Separating Data and Instructions](/en/guides/prompt-engineering/intermediate/separating-data-instructions) to structure your prompts clearly
* Learn [Thinking Step by Step](/en/guides/prompt-engineering/intermediate/step-by-step) to guide AI reasoning processes
* Master [Avoiding Hallucinations](/en/guides/prompt-engineering/intermediate/staying-grounded) to keep responses factual and grounded
