Skip to content

Getting Started

This section will help you get FactDb up and running in your Ruby application.

Prerequisites

Before installing FactDb, ensure you have:

  • Ruby 3.0+ - FactDb requires Ruby 3.0 or later
  • PostgreSQL 14+ - With the pgvector extension installed
  • Bundler - For dependency management

Quick Navigation

Overview

Getting started with FactDb involves three steps:

  1. Install the gem - Add FactDb to your Gemfile
  2. Set up the database - Create tables and enable pgvector
  3. Configure - Set database URL and optional LLM settings

Once configured, you can start ingesting content and extracting facts:

require 'fact_db'

# Configure
FactDb.configure do |config|
  config.database.url = ENV['DATABASE_URL']
end

# Create a facts instance
facts = FactDb.new

# Ingest content
source = facts.ingest("Important information...", type: :document)

# Extract and query facts
extracted = facts.extract_facts(source.id)

Continue to the Installation Guide to begin.