georgeguimaraes

georgeguimaraes

I’m excited to share Arcana, a RAG (Retrieval Augmented Generation) library I’ve been building for Elixir/Phoenix applications.

What is it?

Arcana lets you add vector search, document retrieval, and AI-powered Q&A to any Phoenix app. It’s designed to be embeddable - it uses your existing Ecto Repo and PostgreSQL with pgvector, no separate vector database needed.

Key Features

Simple API for basic RAG:

  {:ok, doc} = Arcana.ingest("Your content", repo: MyApp.Repo)
  results = Arcana.search("query", repo: MyApp.Repo, mode: :hybrid)
  {:ok, answer} = Arcana.ask("What is Elixir?", repo: MyApp.Repo, llm: "openai:gpt-4o")

Agentic RAG Pipeline for complex questions:

  ctx =
    Agent.new("Compare Elixir and Erlang")
    |> Agent.select(collections: ["elixir-docs", "erlang-docs"])
    |> Agent.expand()
    |> Agent.decompose()
    |> Agent.search()
    |> Agent.rerank(threshold: 7)
    |> Agent.answer(self_correct: true)

The pipeline includes query rewriting, collection routing, query expansion, question decomposition, re-ranking, and self-correcting answers (reduces hallucinations by verifying answers are grounded in context).

Embeddings with Nx/Bumblebee:

  • Local embeddings with bge-small-en-v1.5 - no API keys needed
  • Or use OpenAI embeddings
  • Or bring your own via the Arcana.Embedder behaviour

Pluggable Everything:

Every pipeline step has a behaviour you can implement:

defmodule MyApp.CrossEncoderReranker do
    @behaviour Arcana.Agent.Reranker

    @impl true
    def rerank(question, chunks, opts) do
      # Your cross-encoder logic
      {:ok, scored_chunks}
    end
  end

Other highlights:

  • Hybrid search (vector + fulltext with Reciprocal Rank Fusion)
  • In-memory HNSWLib backend for testing or smaller apps
  • Built-in telemetry for all operations
  • Evaluation metrics (MRR, Recall@k, Precision@k)
  • Optional LiveView dashboard
  • File ingestion (text, markdown, PDF)

Links

GitHub: GitHub - georgeguimaraes/arcana: Embeddable RAG library for Elixir/Phoenix with agentic pipelines and dashboard · GitHub
Hex: arcana | Hex
Demo app with Doctor Who corpus: GitHub - georgeguimaraes/arcana-adept: Example Phoenix app demonstrating Arcana RAG toolkit · GitHub

Would love feedback from the community!

https://github.com/georgeguimaraes/arcana

First 3 of 3 Posts Switch mode

georgeguimaraes

georgeguimaraes OP

Dashboard example here:

SyntaxSorcerer

SyntaxSorcerer

I’m curious to how members of the community are using this. I have a small collection of PDFs I’d like to use in a RAG pipeline for some agentic workflows. Not sure what’s the best way to get started but Arcana looks like it could be useful.

georgeguimaraes

georgeguimaraes OP

Check GitHub - georgeguimaraes/arcana-adept: Example Phoenix app demonstrating Arcana RAG toolkit · GitHub

It’s not using PDF, but JSON files, but it’d give you a good overview of the whole workflow.

Also, Arcana has pdf “scraping” capabilities using https://poppler.freedesktop.org/. Not fancy, and not extremely exceptional. I want to experiment with GitHub - xberg-io/xberg: A polyglot document intelligence framework with a Rust core. Extract text, metadata, images, and structured information from PDFs, Office documents, images, and 97+ formats. Available for Rust, Python, Ruby, Java, Go, PHP, Elixir, C#, R, C, TypeScript (Node/Bun/Wasm/Deno)- or use via CLI, REST API, or MCP server. · GitHub to know how we can do better.

But remember, you can define your own PDF Parser and give it to Arcana.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

We're in Beta

About us Mission Statement