Skip to content

xiaohongsimon/prism

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prism

AI-powered personal recommendation engine that learns your preferences through pairwise comparison.

Instead of dumping a news feed on you, Prism reads everything from your configured sources and presents just two items at a time. Pick the one you find more interesting. Over time, Prism learns what you care about and gets better at surfacing the right signals.

How It Works

                    ┌─────────────────────────────────┐
                    │         You pick A or B          │
                    │      (pairwise comparison)       │
                    └──────────┬──────────────────────┘
                               │
                    ┌──────────▼──────────────────────┐
                    │   Bradley-Terry Ranking Model    │
                    │   updates Elo scores + weights   │
                    └──────────┬──────────────────────┘
                               │
              ┌────────────────┼────────────────┐
              ▼                ▼                ▼
     ┌────────────┐   ┌──────────────┐  ┌────────────┐
     │   Recall   │   │   Ranking    │  │  Decision   │
     │   Layer    │   │   Layer      │  │    Log      │
     │            │   │              │  │             │
     │ "where to  │   │ "how to      │  │ every auto  │
     │  find"     │   │  rank"       │  │ decision    │
     │            │   │              │  │ is recorded │
     │ source     │   │ BT scores    │  │ for audit   │
     │ weights    │◄──│ topic/author │  │ & rollback  │
     │ adjust     │   │ weights      │  │             │
     └────────────┘   └──────────────┘  └─────────────┘

Two-Layer Closed Loop

  1. Recall Layer — decides where to look for information. Source weights automatically adjust based on how often their content wins in pairwise comparisons.

  2. Ranking Layer — decides how to rank what's found. Uses Bradley-Terry model (the same math behind Elo ratings in chess) to score each signal, plus multi-dimensional weights for topics, sources, and authors.

Every automated decision is logged in a Decision Log for full auditability.

Features

  • Pairwise comparison UI — two cards side by side, pick the better one (or skip / mark both)
  • 14 source adapters — X/Twitter, Hacker News, arXiv, YouTube, GitHub Trending, GitHub Releases, Reddit, Product Hunt, and more
  • Active learning pair selection — 70% high-score+uncertain / 20% exploration / 10% random
  • Daily briefing generation — auto-generated HTML briefings from top signals
  • Notion publishing — push briefings to your Notion workspace
  • MCP API — expose signals to AI agents via Model Context Protocol
  • PWA support — installable on mobile, works offline
  • Zero frontend build tools — pure Jinja2 + HTMX + vanilla CSS

Quick Start

# 1. Clone
git clone https://github.com/xiaohongsimon/prism.git
cd prism

# 2. Set up environment
python -m venv .venv
source .venv/bin/activate
pip install -e .

# 3. Configure
cp .env.example .env
cp config/sources.example.yaml config/sources.yaml
# Edit .env with your LLM API key
# Edit config/sources.yaml with your preferred sources

# 4. Initialize and sync
prism sync          # Fetch from all sources
prism cluster       # Deduplicate and cluster
prism analyze       # LLM analysis of signals

# 5. Launch
prism serve --port 8080
# Open http://localhost:8080

Source Adapters

Source Type What it captures
X/Twitter x Tweets + full thread expansion
Hacker News hackernews Top/best stories
HN Search hn_search Keyword-based HN search
arXiv arxiv Papers by category
YouTube youtube Videos + transcript enrichment
GitHub Trending github_trending Trending repos with deep fetch
GitHub Releases github_releases Release notes from tracked orgs
Reddit reddit Top posts from subreddits
Product Hunt producthunt Daily top launches
Model Economics model_economics LLM pricing changes
Git Practice git_practice Your own commit history
Claude Sessions claude_sessions Claude Code memory files

Tech Stack

  • Backend: Python, FastAPI, SQLite
  • Frontend: Jinja2, HTMX, vanilla CSS
  • LLM: Any OpenAI-compatible API
  • Scheduling: macOS launchd (hourly sync + daily analysis)

Configuration

Environment Variables

See .env.example for all available options.

Source Configuration

See config/sources.example.yaml for the full source configuration format. Each source type has its own adapter in prism/sources/.

Scheduling

Prism includes launchd plist templates for automated operation:

  • Hourly: sync sources, cluster, analyze, generate slides
  • Daily: full pipeline + briefing generation + Notion publish + source weight adjustment

See prism/scheduling/ for templates. Replace $PRISM_HOME with your installation path.

License

MIT

About

AI-powered personal recommendation engine that learns preferences through pairwise comparison

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors