Examples¶
Practical examples demonstrating FactDb usage patterns.
Getting Started¶
- Basic Usage - Simple introduction to core functionality
Use Cases¶
- HR Onboarding - Track employee facts over time
- News Analysis - Extract facts from news articles
Common Patterns¶
Ingest and Extract¶
facts = FactDb.new
# Ingest content
source = facts.ingest(document_text, type: :document)
# Extract facts
extracted = facts.extract_facts(source.id, extractor: :llm)
Query Current State¶
Historical Query¶
# What did we know on a specific date?
historical = facts.facts_at(Date.parse("2023-06-15"), entity: paula.id)
Timeline¶
# Build complete timeline
timeline = facts.timeline_for(paula.id)
timeline.each do |fact|
puts "#{fact.valid_at}: #{fact.text}"
end