Skip to main content

Overview

The lua resources command manages your agent’s knowledge base - documents and information that your agent can reference during conversations.
lua resources

Knowledge Base

Create documents for your agent to reference

Full CRUD

Create, read, update, and delete resources

Editor Integration

Write long-form content easily

Always Current

Update resources as info changes

What Are Resources?

Resources are documents that your agent can access and reference - think of them as your agent’s knowledge library. Examples:
  • Product catalogs and specifications
  • Company policies and procedures
  • FAQs and common questions
  • Return/refund policies
  • Shipping information
  • Troubleshooting guides
  • Company history and values
  • Pricing information

Quick Start

1

Run Command

lua resources
2

Create Resource

? What would you like to do? ➕ Create new resource
? Resource name: Product Catalog
Opens your editor
3

Write Content

Write your content in the editor:
Our complete product catalog for 2024.

Categories:
- Electronics
- Home & Garden
- Clothing
...
4

Save

Save and close editor
✅ Resource "Product Catalog" created successfully

Operations

Create New Resource

? What would you like to do? ➕ Create new resource

? Resource name: Return Policy
[Opens editor]

# Write content:
AcmeCorp Return Policy

Returns accepted within 45 days of purchase.

Conditions:
- Item must be unused in original packaging
- Receipt or order number required
- Free return shipping on defective items

Process:
1. Contact [email protected]
2. Receive return authorization
3. Ship item within 7 days
4. Refund processed within 3-5 business days

[Save and close]

🔄 Creating resource...
 Resource "Return Policy" created successfully

Update Existing Resource

? What would you like to do? ✏️ Update existing resource

? Select resource to update:
 Return Policy
  Shipping Information
  Product Catalog

? Resource name: (Return Policy) Return Policy - 2024
[Opens editor with current content]

# Modify content
# Save and close

🔄 Updating resource...
 Resource "Return Policy - 2024" updated successfully

View Resource

? What would you like to do? 👁️  View resource content

? Select resource to view: Product Catalog

============================================================
📄 Resource: Product Catalog
============================================================
Created: 1/10/2024, 9:00:00 AM
Updated: 1/15/2024, 2:30:00 PM
============================================================

Our complete product catalog for 2024.

Categories:
- Electronics: Laptops, tablets, smartphones
- Home & Garden: Furniture, appliances, tools
...

============================================================

Press Enter to continue...

Delete Resource

? What would you like to do? 🗑️  Delete resource

? Select resource to delete: Old FAQ 2023

? Are you sure you want to delete "Old FAQ 2023"? Yes

🔄 Deleting resource...
 Resource "Old FAQ 2023" deleted successfully
Deletion is permanent and cannot be undone. Always confirm before deleting.

Resource Best Practices

Structure Your Resources

- Company Information
- Product Catalog
- Policies (Return, Shipping, Privacy)
- FAQ Documents
- Troubleshooting Guides
- Regional Information

Content Guidelines

❌ "We have good return policy"

✅ "Returns accepted within 45 days.
    Item must be unused in original packaging.
    Receipt required.
    Refund processed in 3-5 business days."
Product Name: UltraBook Pro
Price: $1,299

Specs:
- 16GB RAM
- 512GB SSD
- 14" Display

Best For:
- Professionals
- Content creators
Last Updated: January 15, 2024
Valid Through: December 31, 2024
Next Review: July 1, 2024
Q: Can I return opened items?
A: Yes, if defective. No, if unwanted.

Q: What if I lost my receipt?
A: We can look up by email or phone.

Use Cases

Product Knowledge Base

$ lua resources Create

Name: Electronics Catalog
Content:
Laptops:
1. UltraBook Pro - $1299
   - Professional grade
   - 16GB RAM, 512GB SSD
   - 12-hour battery

2. Student Laptop - $599
   - Perfect for students
   - 8GB RAM, 256GB SSD
   - 8-hour battery

Policy Documentation

$ lua resources Create

Name: Customer Service Policies
Content:
Returns: 45 days, original packaging
Exchanges: Same item or store credit
Refunds: 3-5 business days
Warranties: Manufacturer warranty
Price Matching: Within 14 days

FAQ Repository

$ lua resources Create

Name: Shipping FAQ
Content:
Q: How long does shipping take?
A: Standard 3-5 days, Express 1-2 days

Q: International shipping?
A: US and Canada only currently

Q: Track my order?
A: Tracking link sent via email

Integration with Agent

How Agents Use Resources

Automatically:
  • Searches when relevant
  • Retrieves accurate information
  • Provides consistent answers
  • References specific resources
Example conversation:
User: "What's your return policy?"

Agent: [Searches resources]
       [Finds "Return Policy"]
       [Reads content]
       
Response: "We accept returns within 45 days of purchase.
The item must be unused in original packaging..."

Combine with Persona

# In persona
$ lua persona Edit

"You are a customer service agent.

When answering questions, always check your resources for:
- Product details → Product Catalog
- Return questions → Return Policy
- Shipping questions → Shipping Information

Provide accurate information from resources, not guesses."

Common Workflows

Build Knowledge Base

$ lua resources

# Day 1: Core resources
 Create: Company Information
 Create: Product Catalog
 Create: Return Policy

# Day 2: Support resources
 Create: FAQ - General
 Create: Troubleshooting Guide

# Day 3: Details
 Create: Product Specifications
 Create: Warranty Information

Seasonal Update

# Before holidays
$ lua resources
 Update: Product Catalog  # Add gift guides
 Update: Shipping Info    # Add deadlines
 Create: Holiday Guide

# After holidays
$ lua resources
 Update: Product Catalog  # Remove holiday items
 Delete: Holiday Guide

Policy Change

# Return window extended 30 → 45 days

$ lua resources
 View: Return Policy  # Check current
 Update: Return Policy  # Change to 45 days
 Updated

# Test
$ lua chat
💬: "What's your return policy?"
🤖: "45 days..." Using updated policy

Best Practices

  • Update monthly minimum
  • Review quarterly
  • Archive old resources
  • Track last update dates
✅ Product Catalog 2024
✅ Return Policy - Updated Jan 2024
✅ FAQ - Shipping Questions

❌ Doc1
❌ stuff
❌ temp
  • Good: 500-5000 characters
  • Too small: < 100 characters
  • Too large: > 50,000 characters
Break large docs into focused resources
$ lua resources Update
$ lua chat  # Test agent uses updated info

Troubleshooting

Solution: Update persona to reference resources
$ lua persona Edit
# Add: "Always check resources for accurate info"
Solution: Set default editor
export EDITOR=nano
$ lua resources
Solution: Split into multiple resourcesOne large doc → Multiple focused docs

Next Steps