text-sources
Text Sources#
Add knowledge to your agent by directly pasting or typing text content. Text sources are the fastest way to add information - no file upload needed!
What are Text Sources?#
Text sources let you add plain text content directly to your agent's knowledge base. Perfect for:
- Quick notes and policies
- Single-page information
- Content you want to paste from websites
- Testing your agent with sample content
- Short guides and instructions
How It Works#
1. Enter Text → Paste or type content
↓
2. Immediate Chunking → ChunkManager.storeChunksWithNamespace()
- Chunk size: 2000 characters (~500 words)
- Namespace: "docs"
↓
3. Generate Embeddings → embedding-generation queue
- Creates vector embeddings
↓
4. Status: Ready (30-60 seconds)
Processing Time: 30-60 seconds (much faster than file uploads!)
Step-by-Step: Adding a Text Source#
1. Navigate to Knowledge Base#
- Go to your agent's dashboard
- Click Knowledge Base tab
- Click Add Source → Text
2. Enter Content#
Source Name (required)
- Descriptive name for this text
- Examples: "Return Policy", "Business Hours", "Product Features"
Text Content (required)
- Paste or type your content
- Max length: 100,000 characters (~25,000 words)
- Supports multiple paragraphs and line breaks
Example content:
Business Hours and Contact Information
We're open Monday through Friday, 9:00 AM to 5:00 PM EST.
Closed on weekends and major holidays.
Contact us:
- Email: support@company.com
- Phone: +1 (555) 123-4567
- Live chat: Available during business hours
Response times:
- Email: Within 24 hours
- Phone: Immediate
- Live chat: Immediate during business hours
3. Configure Settings#
Priority (optional)
- Normal (default): Standard retrieval weight
- High: More likely to be retrieved
- Low: Lower retrieval priority
Mark as Price Information (checkbox)
- Check if this contains pricing information
- Auto-sets priority to 1.0 (highest)
4. Add and Train#
- Click Add Text Source
- Source appears in "Processing" status
- Click Train Agent
- Wait 30-60 seconds for "Ready" status
Your agent can now answer questions using this content!
Best Practices#
Content Formatting#
✅ Do:
- Use clear headings and sections
- Break content into paragraphs
- Use bullet points and numbered lists
- Include relevant keywords
- Keep information accurate and up-to-date
❌ Don't:
- Use complex formatting (tables, columns) - they won't render
- Include HTML or Markdown tags - they'll be treated as text
- Paste overly long content - split into multiple sources instead
- Include outdated information
- Use vague or ambiguous language
Content Structure#
Good structure:
Topic Title
Brief introduction explaining what this covers.
Key Point 1:
- Detail A
- Detail B
- Detail C
Key Point 2:
More information here.
Contact Information:
Email: example@company.com
Bad structure:
lots of info here with no structure just one big paragraph that goes on and on making it hard to read and process and retrieve relevant information because theres no clear organization or headings
Content Length#
Optimal lengths:
- Short content (100-500 words): Single topic, policy, or FAQ answer
- Medium content (500-2000 words): Detailed guide, multiple related topics
- Long content (2000-10000 words): Comprehensive documentation
Too long (>10000 words)?
- Split into multiple text sources by topic
- Or upload as a file instead
Common Use Cases#
1. Company Policies#
Return and Refund Policy
We offer a 30-day money-back guarantee on all purchases.
To request a refund:
1. Contact support within 30 days of purchase
2. Provide your order number
3. Explain the reason for return
Refunds are processed within 5-7 business days.
Exceptions:
- Digital products: 14-day return window
- Custom orders: Non-refundable
- Sale items: Final sale, no returns
2. Product Information#
Premium Plan Features
The Premium plan includes:
- Unlimited messages (no monthly cap)
- Priority support (24/7 live chat)
- Advanced analytics dashboard
- Custom branding (logo, colors)
- API access for integrations
- Dedicated account manager
Pricing: $99/month (billed annually at $990/year)
Upgrade anytime from your account dashboard.
3. FAQ Content#
Frequently Asked Questions
Q: How do I reset my password?
A: Click "Forgot Password" on the login page, enter your email, and follow the instructions sent to your inbox.
Q: Can I cancel my subscription anytime?
A: Yes! Cancel from your account settings. You'll retain access until the end of your billing period.
Q: Do you offer discounts for non-profits?
A: Yes! Non-profit organizations qualify for 20% off. Contact sales@company.com with proof of non-profit status.
Editing Text Sources#
Updating Content#
- Find the source in the Knowledge Base list
- Click Edit (pencil icon)
- Update the text content
- Click Save
- Re-train your agent for changes to take effect
Note: Content changes aren't live until you re-train!
Changing Name or Priority#
- Click Edit on the source
- Update name, priority, or "Is Price" setting
- Click Save
- Re-train your agent
Troubleshooting#
"Content Too Long" Error#
Problem: Your text exceeds 100,000 characters
Solutions:
- Split content into multiple text sources
- Upload as a file instead (supports larger content)
- Remove unnecessary information
"Agent Not Using Text Content"#
Causes:
- Forgot to train after adding/editing
- Source still processing
- Questions not related to content
Solutions:
- Click "Train Agent" button
- Wait for "Ready" status
- Test with questions directly from your text
"Text Content Lost After Edit"#
Prevention:
- Copy your text before editing (backup)
- Save frequently during editing
- Don't close browser during save
Recovery:
- Check if auto-save draft exists (some browsers)
- Re-enter content if lost (no recovery available)
Examples#
Example 1: Business Hours#
Name: "Store Hours and Holidays"
Content:
Store Hours
Monday - Friday: 9:00 AM - 9:00 PM
Saturday: 10:00 AM - 7:00 PM
Sunday: 11:00 AM - 6:00 PM
Holiday Hours:
- Thanksgiving: Closed
- Christmas Eve: 9:00 AM - 5:00 PM
- Christmas Day: Closed
- New Year's Day: 10:00 AM - 6:00 PM
Special summer hours (June-August):
Monday - Saturday: 9:00 AM - 10:00 PM
Expected questions:
- "What time do you close?"
- "Are you open on Sundays?"
- "What are your holiday hours?"
Example 2: Shipping Policy#
Name: "Shipping and Delivery Information"
Content:
Shipping Options
Standard Shipping (5-7 business days): FREE on orders $50+
Express Shipping (2-3 business days): $9.99
Overnight Shipping (1 business day): $24.99
We ship to:
- All 50 US states
- Canada (add $15 for standard)
- International (contact for rates)
Order processing:
- Orders placed before 2 PM EST ship same day
- Orders after 2 PM EST ship next business day
Tracking:
You'll receive a tracking number via email once your order ships.
Expected questions:
- "How much is shipping?"
- "Do you ship internationally?"
- "When will my order arrive?"
Example 3: Product Comparison#
Name: "Plan Comparison: Basic vs Pro"
Content:
Basic Plan ($29/month):
- 1,000 messages per month
- 1 agent
- Email support
- Basic analytics
- 7-day chat history
Pro Plan ($99/month):
- 10,000 messages per month
- 5 agents
- Priority support (live chat)
- Advanced analytics
- Unlimited chat history
- Custom branding
- API access
Best for:
- Basic: Small businesses, testing
- Pro: Growing businesses, teams
Expected questions:
- "What's the difference between Basic and Pro?"
- "How many messages do I get?"
- "Does the Basic plan include API access?"
API Reference#
For developers adding text sources programmatically:
Endpoint: POST /api/agents/[id]/sources/text
Request:
const response = await fetch(`/api/agents/${agentId}/sources/text`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
},
body: JSON.stringify({
name: 'My Text Source',
content: 'Your text content here...',
priority: 0.8,
isPrice: false
})
})
Response:
{
"success": true,
"source": {
"id": "source-uuid",
"name": "My Text Source",
"type": "text",
"status": "processing"
}
}
Limits#
| Plan | Max Text Length | Max Sources | Processing Time |
|---|---|---|---|
| Free | 50,000 chars | 10 sources | ~30 seconds |
| Pro | 100,000 chars | 100 sources | ~30 seconds |
| Enterprise | 500,000 chars | Unlimited | ~30 seconds |
Comparison: Text vs File vs Q&A#
| Feature | Text | File | Q&A |
|---|---|---|---|
| Speed | Fastest (instant) | Medium (1-5 min) | Fastest (instant) |
| Max Size | 100K chars | 50MB | N/A (1 Q&A at a time) |
| Images | No | No | Yes |
| Formatting | Plain text only | Preserves structure | Supports Q&A format |
| Best For | Quick notes, policies | Documents, manuals | FAQs, specific Q&A |
When to use Text:
- You have content ready to paste
- No file available
- Need fastest processing
- Content is under 100K characters
- No images needed
When to use File instead:
- Content is in a document already
- Need to preserve complex formatting
- Content exceeds 100K characters
- Have multiple pages/sections
When to use Q&A instead:
- Explicit question-answer pairs
- Need to attach images to answers
- Want high retrieval priority for specific questions
Next Steps#
- Q&A Sources - Create question-answer pairs
- File Sources - Upload documents
- Website Sources - Crawl websites
- Training Your Agent - Best practices for training