Strings are lightweight resources for ingesting raw text without creating files. The endpoint accepts batches so you can import multiple snippets in one request. Each record is queued for ingestion, then chunked and indexed for retrieval just like uploaded files.
Perfect for: Code snippets, FAQs, short documents, configuration examples, or any text content that doesn’t require file uploads.
Strings are processed asynchronously. Monitor indexing_status to track when content is ready for querying.
Use descriptive titles - Helps with search context and user navigation
Keep content focused - One topic per string for better semantic matching
Include relevant keywords - Natural language is best, avoid keyword stuffing
Add contextual information - Background details improve answer quality
Format code properly - Use markdown code blocks for syntax highlighting
Example - Good Structure:
Copy
{ "title": "JWT Token Refresh Endpoint", "string": "To refresh an expired JWT token, send a POST request to /api/auth/token/refresh/ with your refresh token in the request body. The endpoint returns a new access token valid for 1 hour."}
Batch Import Strategies
Efficient batch importing techniques:
Group related content - Import FAQ sets, documentation sections together
Use consistent naming - Helps with organization and search
Start small - Test with 5-10 strings before bulk importing
Monitor progress - Poll status endpoint after each batch
Handle failures gracefully - Retry failed batches with corrections
Typical workflow:
Prepare 20-50 strings in a batch
Submit batch via POST request
Wait 5-10 seconds for initial processing
Poll status endpoint until all show IND
Proceed to next batch
Common Use Cases
Ideal scenarios for string resources:Developer Documentation:
API endpoint descriptions
Code examples and snippets
Configuration templates
Error messages and solutions
Knowledge Base:
FAQ answers
Policy statements
Product specifications
Troubleshooting steps
Training Content:
Glossary definitions
Best practice guidelines
Process documentation
Quick reference guides
Error Prevention
Avoid common issues:Validation Errors:
Ensure every object has both title and string
Check title length doesn’t exceed 100 characters
Verify corpus ID is valid UUID format
Processing Failures:
Avoid extremely long strings (>50,000 chars)
Remove special control characters
Use UTF-8 encoding for text with unicode
Test special characters in small batches first
Performance Issues:
Don’t send more than 100 strings per request
Wait for previous batch to complete before sending next