What Youβre Building
An AI that answers questions using YOUR documents instead of guessing. Before Alchemyst:Prerequisites
- Alchemyst account (sign up)
- Your
ALCHEMYST_AI_API_KEY - Node.js 18+ or Python 3.9+
Step 1: Install
Step 2: Initialize
Step 3: Store a Document
- Your document was chunked into searchable pieces (~500 word chunks)
- Embeddings were generated automatically (vector representations)
- Everything is indexed and ready to search
- Visit platform.getalchemystai.com/context
- You should see your document listed
- Click to view chunks and metadata
Step 4: Search for Context
Understanding similarity_threshold
Tip: Start at 0.7, lower to 0.5 if you get no results, raise to 0.9 if results are too broad.
Step 5: Feed Context to Your LLM
Complete Working Example
- TypeScript
- Python
Next: Add Real Documents
Now that you understand the basics, letβs add real documents:- From File
- From API
- Multiple Files
Advanced: Organize with Metadata
Usegroup_name to filter searches by category:
Naming difference: Storage uses
group_name (snake_case in metadata) but TypeScript search uses groupName (camelCase). Python uses group_name consistently. Both refer to the same field - this is due to API design conventions.Why use groups?
Example hierarchy:
Troubleshooting
No results from search
No results from search
Error symptoms:Step 2: Verify documents were stored:Expected output:Step 3: Check scope matches:
contexts?.lengthreturns 0- Empty array in search results
similarity_thresholdis too high- Document wasnβt stored successfully
scopemismatch between add and search
Too many irrelevant results
Too many irrelevant results
Error symptoms:Step 2: Use group filtering:Step 3: Add more specific metadata:
- Getting documents that donβt match the query
- Too many results to process efficiently
similarity_thresholdis too low- Documents are too broad or generic
- Not using group filtering
Document already exists error
Document already exists error
Error message:Cause: Trying to add a document with duplicate Step 2: Use versioned names:Step 3: Use unique identifiers:
file_name in metadata.Fixes:Step 1: Delete old version first:API authentication errors
API authentication errors
Error message:Fixes:Step 1: Verify API key is set:Step 2: Check key format:Step 3: Get a new key:
- Visit platform.getalchemystai.com/settings
- Generate a new API key
- Update your
.envfile
Rate limit exceeded
Rate limit exceeded
Error message:Cause: Too many requests in a short time period.Fixes:Step 1: Add retry logic:Step 2: Check your rate limits:
- Free tier: 100 operations/day
- Pro tier: 10,000 operations/day
Best Practices
Document Organization
Chunk Size Considerations
- Small documents (under 1000 words): Add as-is
- Medium documents (1000-5000 words): Let Alchemyst auto-chunk
- Large documents (over 5000 words): Consider splitting by section
Search Optimization
Error Handling
Verify Your Setup
After implementing context search, verify everything is working:Check Platform UI
- Visit platform.getalchemystai.com/context
- You should see your stored documents
- Click to view chunks and embeddings
- Check document count matches what you uploaded
Test with Code
Whatβs Next?
Add Memory
Make your AI remember users across sessions
TypeScript SDK
Complete TypeScript SDK reference
Python SDK
Complete Python SDK reference
API Reference
REST API documentation
Learn Advanced Patterns
Context Arithmetic
Master advanced filtering and organization
Usage Patterns
Best practices and anti-patterns
Real-World Use Cases
Customer support, code assistants, and more
Sample Projects
Community-built projects
Need Help?
Discord Community
Get real-time help from our community
Documentation
Browse guides and tutorials
Email Support
Contact our support team
GitHub Issues
Report bugs or request features

