Prerequisites
- Elixir 1.14+ and Phoenix 1.7+
- PostgreSQL running with pgvector extension
- OpenAI API key (or use local embeddings)
If you haven’t installed Arcana yet, follow the Installation Guide first.
Complete Working Example
This tutorial walks through building a simple RAG system for Elixir documentation. Copy and run each step in your IEx session.Ingest some documents
Add content to your vector store. We’ll ingest a few facts about Elixir:
Behind the scenes, Arcana is chunking the text, generating embeddings, and storing them in PostgreSQL with pgvector.
Try Different Search Modes
Arcana supports multiple search strategies. Here’s how they compare:- Semantic Search
- Full-Text Search
- Hybrid Search
Best for natural language and conceptual queries:Finds content by meaning, not just keywords. Great for “What is X?” or “How do I Y?” questions.
Add More Advanced Features
Filter by Collection
Organize documents into collections for better routing:Set Similarity Threshold
Filter out low-quality matches:Ingest Files
Load content from text, markdown, or PDF files:Complete End-to-End Example
Here’s a complete working script you can save and run:complete_example.exs
Using Local Embeddings
Don’t want to use OpenAI? Use local embeddings instead:Next Steps
Agentic RAG
Build multi-step RAG pipelines with query expansion and re-ranking
GraphRAG
Extract entities and relationships for knowledge graph search
Search Algorithms
Deep dive into semantic, full-text, and hybrid search
Dashboard
Use the LiveView UI to manage documents and test queries
Common Issues
Search returns no results
Search returns no results
Check that documents were ingested successfully:Lower the similarity threshold:
OpenAI API errors
OpenAI API errors
Make sure your API key is set:Verify it’s accessible:Or pass the LLM configuration explicitly:
Slow first-time embedding
Slow first-time embedding
Local embeddings download models on first use (~133MB for default model). This is a one-time download:
- Default (BGE Small): 133MB
- BGE Base: 438MB
- BGE Large: 1.3GB