A hat in Kyva is essentially a set of instructions that guides how the AI responds to users. Think of it as creating a specialized assistant with a particular focus, expertise, and way of communicating. When you create a hat, you're designing a personality and skill set for the AI to adopt when interacting with users.
Hats have certain limitations to keep in mind:
• They work best when focused on specific tasks rather than trying to do everything
• They rely on the information you provide in your instructions
• They can't access external databases or run code unless specifically enabled
• Their effectiveness depends largely on how clearly you define their purpose and process
For complex projects, consider breaking them down into multiple hats that each handle a simpler sub-task. This approach often yields better results than trying to create one hat that does everything.
1. Be specific and clear about the hat's purpose and capabilities
2. Define the hat's role and expertise precisely
3. Structure your instructions with clear sections for better organization
4. Include expected input and output formats when applicable
5. Provide examples of ideal responses when possible
6. Include constraints and limitations to guide the hat's behavior
7. Use a consistent tone that matches the intended use case
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."
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."
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."
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.
• 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.