Installation
Arcana requires PostgreSQL with the pgvector extension and an Nx backend for local embeddings. This guide covers installation with Igniter (recommended) and manual setup.Prerequisites
- Elixir 1.14+ and Phoenix 1.7+
- PostgreSQL 12+ with pgvector extension
- An Nx backend (EXLA, EMLX, or Torchx) for local embeddings
Installation Methods
- With Igniter (Recommended)
- Manual Installation
Install with Igniter
The easiest way to install Arcana is using Igniter, which automatically configures your application:- Add the
arcanadependency tomix.exs - Create database migrations for documents and chunks
- Configure Postgrex types for pgvector
- Set up your repo configuration
- Optionally mount the LiveView dashboard
You’ll still need to set up PostgreSQL with pgvector and configure an Nx backend (see below).
Database Setup
PostgreSQL with pgvector
Arcana requires PostgreSQL with the pgvector extension for vector similarity search.Start PostgreSQL with pgvector
The easiest way is using Docker with the official pgvector image:Start the database:
docker-compose.yml
Run migrations
The Arcana installer creates migrations for:
arcana_documents- Stores document metadata and contentarcana_chunks- Stores text chunks with embeddingsarcana_collections- Organizes documents into named collections- pgvector extension activation
Supervision Tree Setup
Add Arcana components to your application’s supervision tree:lib/my_app/application.ex
Arcana.TaskSupervisoris required if you’re using the dashboard’s Ask or Maintenance featuresArcana.Embedder.Localis only needed when using local Bumblebee embeddings (the default)- For OpenAI or other cloud embeddings, you can skip
Arcana.Embedder.Local
Nx Backend Configuration
For local embeddings, Arcana needs an Nx backend to run neural network models. Choose one based on your platform:- EXLA (Recommended)
- EMLX (Apple Silicon)
- Torchx
EXLA - Google’s XLA Compiler
Best performance on most platforms (Linux, macOS, Windows).Embedding Provider Configuration
Arcana supports multiple embedding providers. Choose based on your needs:Local Embeddings (Default)
Use Bumblebee for local embeddings - no API keys required:config/config.exs
Local embeddings require an Nx backend (configured above).
Available Local Models
| Model | Dimensions | Size | Use Case |
|---|---|---|---|
BAAI/bge-small-en-v1.5 | 384 | 133MB | Default, good balance |
BAAI/bge-base-en-v1.5 | 768 | 438MB | Better accuracy |
BAAI/bge-large-en-v1.5 | 1024 | 1.3GB | Best accuracy |
intfloat/e5-small-v2 | 384 | 133MB | Alternative to BGE |
intfloat/e5-base-v2 | 768 | 438MB | E5 medium size |
intfloat/e5-large-v2 | 1024 | 1.3GB | E5 best accuracy |
thenlper/gte-small | 384 | 67MB | Smallest, fastest |
OpenAI Embeddings
Use OpenAI’s embedding API:config/config.exs
When using OpenAI embeddings, you don’t need an Nx backend or
Arcana.Embedder.Local in your supervision tree.Custom Embeddings
Implement theArcana.Embedder behaviour for custom providers (Cohere, Voyage, etc.):
lib/my_app/cohere_embedder.ex
config/config.exs
Verify Installation
Test your installation in an IEx session:Optional: GraphRAG Setup
If you want to use GraphRAG features (entity extraction, knowledge graphs):Next Steps
Quickstart Tutorial
Build your first RAG application with a complete example
Configure Chunking
Learn how to optimize text chunking for your use case
LLM Integration
Connect Arcana to OpenAI, Anthropic, or custom LLMs
Dashboard Setup
Set up the LiveView dashboard for document management
Troubleshooting
pgvector extension not found
pgvector extension not found
If you see errors about the
vector extension:- Make sure you’re using the pgvector/pgvector Docker image, or
- Install pgvector on your local PostgreSQL installation
- Run
CREATE EXTENSION IF NOT EXISTS vector;in your database
Nx backend compilation errors
Nx backend compilation errors
If EXLA fails to compile:
- Make sure you have build tools installed (gcc, make)
- On macOS:
xcode-select --install - On Ubuntu:
sudo apt install build-essential - Try Torchx as an alternative:
{:torchx, "~> 0.9"}
Model download is slow
Model download is slow
First time using local embeddings downloads models from HuggingFace:
- BGE Small: ~133MB
- BGE Base: ~438MB
- BGE Large: ~1.3GB
Postgrex types error
Postgrex types error
If you see errors about vector types not being recognized:
- Ensure you created the
PostgrexTypesmodule - Added it to your repo config:
types: MyApp.PostgrexTypes - Restarted your application after config changes