Skip to content

Installation

Requirements

  • Ruby >= 3.0.0
  • PostgreSQL >= 14 with pgvector extension
  • Bundler

Install the Gem

Add FactDb to your Gemfile:

gem 'fact_db'

Then install:

bundle install

Or install directly:

gem install fact_db

Install pgvector

FactDb uses pgvector for semantic search. Install the PostgreSQL extension:

brew install pgvector
sudo apt install postgresql-14-pgvector
git clone https://github.com/pgvector/pgvector.git
cd pgvector
make
sudo make install

Then enable the extension in your database:

CREATE EXTENSION IF NOT EXISTS vector;

Optional Dependencies

LLM Extraction

For LLM-powered fact extraction, add the ruby_llm gem:

gem 'ruby_llm'

Async Processing

For parallel pipeline processing with async fibers:

gem 'async', '~> 2.0'

Verify Installation

Create a simple test script:

require 'fact_db'

puts "FactDb version: #{FactDb::VERSION}"
puts "Installation successful!"

Run it:

ruby test_install.rb

Next Steps