Kyva Lessons

How to Create a Hat in Kyva

Naming Your Hat

When creating a custom hat in Kyva, choose a name that reflects its purpose and functionality. A good name is:

  • Clear and descriptive
  • Easy to remember
  • Relevant to the hat's function
  • Unique enough to stand out

For example, if creating a receipt analysis tool, you might name it "ReceiptWiz" or "ExpenseOrganizer."

Summary Window

The summary window is your hat's first impression. This brief description should:

  • Explain what your hat does in 1-2 sentences
  • Highlight key benefits or features
  • Use engaging language to attract users
  • Set appropriate expectations

Example summary for a receipt analyzer:

"ReceiptWiz analyzes your receipts, automatically categorizes expenses, and generates organized financial reports. Save time on expense tracking and gain insights into your spending patterns with just a photo of your receipt."

Directions Window

In the directions window, you'll create the detailed instructions that power your hat's functionality. This is where you provide Kyva with specific guidance on how to process inputs and generate responses.

Your directions should include:

1. Define the Hat's Role and Expertise

"You are a Receipt Analysis Expert, specialized in processing receipt images and extracting structured financial data. Your purpose is to help users categorize expenses and create organized financial records."

2. Outline the Process

"When analyzing receipts: First, carefully examine the receipt image or text to identify key elements: vendor name, date, individual items, prices, and total amount. Extract all line items with their corresponding prices. Automatically categorize each expense into standard categories: Food & Dining, Transportation, Entertainment, Utilities, Office Supplies, Personal Care, and Other. Calculate subtotals for each category. Present the analysis in a clear, tabular format. Provide a brief summary highlighting the largest expense categories."

3. Specify Input Requirements

"Users will upload images of receipts or provide text descriptions of receipts. You should be able to process both clear and slightly blurry images, as well as complete or partial text descriptions."

4. Define Output Format

"Present your analysis as a table with columns for Item, Price, and Category, followed by a category summary table. Use markdown formatting to ensure readability."

5. Add Constraints and Edge Case Handling

"If the receipt image is unclear or text is incomplete, ask for specific clarifications rather than making assumptions. For users tracking business expenses, flag potential tax-deductible items based on common business expense guidelines."

6. Include Fallback Instructions

"If no receipt is provided, guide the user on how to submit one for analysis. If the user asks questions unrelated to receipt analysis, politely redirect them to the hat's primary function."

Testing Your Hat

After creating your hat, test it with various inputs to ensure it:

  • Responds as expected to typical requests
  • Handles edge cases gracefully
  • Maintains its specialized focus
  • Provides valuable and accurate information

Refine your directions based on testing results, adjusting language and instructions to improve performance.

Best Practices

  • Be specific about the hat's capabilities and limitations
  • Use clear, concise language in your directions
  • Include examples when helpful
  • Consider different user scenarios
  • Balance specificity with flexibility
  • Regularly update your hat based on user feedback

By following these guidelines, you'll create a Kyva hat that effectively serves its purpose and provides value to users through consistent, accurate, and helpful responses.