Skip to content

About

AI system that sifts through thousands of chat sessions to find intellectual gems. Parliament of 5 AI personas triages your conversations for $0.42.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

The Notebook Archaeologist 🏺

Mine your AI conversation history for intellectual gems.

A Python CLI that uses a "Parliament of Taste" — five AI personas in a single LLM call — to triage thousands of chat sessions and surface the ones worth revisiting. Built for anyone who has accumulated hundreds or thousands of AI conversations and suspects their best ideas are buried in there somewhere.

Cost: ~$0.005 per session triaged. Full archive of 3,000+ sessions for ~$14.

Quick Start

# Clone and set up
git clone https://github.com/erikbethke/notebook-archaeologist.git
cd notebook-archaeologist
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Set your Anthropic API key
export ANTHROPIC_API_KEY="sk-ant-..."

# Initialize the database
python archaeologist.py init

# Import your chat exports (see "Preparing Your Data" below)
python archaeologist.py import --dir=/path/to/your/exports

# Triage 10 sessions to test
python archaeologist.py triage --limit=10

# See results
python archaeologist.py results

# Review sessions interactively
python archaeologist.py review --tier=gem
python archaeologist.py review --tier=interesting

Optional: Shell Alias

# Add to ~/.zshrc or ~/.bashrc
alias dig='/path/to/notebook-archaeologist/dig'

# Then use:
dig init
dig triage --limit=10
dig review --tier=gem
dig cost

How It Works

The Parliament of Taste

Each session is evaluated by five personas in a single LLM call (Claude Haiku, ~$0.005/session):

Persona Evaluates
Philosopher Depth of ideas, original frameworks, perspective shifts
Entrepreneur Business insights, strategic thinking, product ideas
Storyteller Narrative potential, metaphors, quotable lines
Technologist Technical substance, architecture insights, novel approaches
Contrarian Mandatory dissenter — finds what others miss

The Contrarian is the secret weapon. It must disagree with the majority, preventing bland consensus and surfacing non-obvious gems.

Verdict Tiers

Each session gets scored 1-10 by all five personas, then receives a verdict:

  • ⭐ Gem (Tier 1) — Average ≥ 7.5 or any persona scores 9+
  • ◆ Interesting (Tier 2) — Average ≥ 5.5
  • ● Routine (Tier 3) — Average ≥ 3.5
  • ○ Skip (Tier 4) — Average < 3.5

Calibration Results

From a 92-session survey sample:

Tier Accuracy
Gem 100% — humans agreed every time
Interesting 100% — all correctly identified
Routine 60% — the noisy middle (hidden gems + junk mixed)
Skip 100% — all correctly filtered

The system is sharp at the extremes and noisy in the middle — which is exactly what you want. It never misses a gem, and the routine tier is where human review adds the most value.

Preparing Your Data

Option 1: JSON Export (Any Platform)

Create a sample-sessions/ directory with:

sessions-index.json — Array of session metadata:

[
  {
    "id": "unique-session-id",
    "name": "Session Title",
    "createdAt": "2025-01-15T10:30:00Z",
    "messageCount": 12,
    "summary": "Optional auto-generated summary"
  }
]

{session-id}.json — Individual session files:

{
  "session": { "...metadata..." },
  "chat": {
    "data": [
      {
        "prompt": "What the user said",
        "replies": ["What the AI responded", "", "", ""]
      }
    ]
  }
}

Option 2: Custom API Client

If your platform has an API, implement a client in core/api.py and add download logic to phases/download.py. The existing code shows the pattern — rate limiting, pagination, resumable checkpointing.

Option 3: ChatGPT Export

Export your data from Settings → Data Controls → Export. Convert the conversations.json to the format above. (A converter script is on the roadmap.)

Commands

Command Description
dig init Create database, import from sample-sessions/
dig import --dir=PATH Import sessions from a directory
dig triage --limit=N Triage N sessions through the Parliament
dig triage --all Triage all imported sessions
dig results Show verdict breakdown and top gems
dig review Interactive review (mix of all tiers)
dig review --tier=gem Review only gems
dig review --tier=interesting Review only interesting
dig review --tier=routine Review the noisy middle
dig status Progress dashboard
dig cost LLM cost breakdown by phase

Customizing the Personas

The Parliament prompt lives in phases/triage.py. Edit PARLIAMENT_SYSTEM to match your interests:

  • Swap personas — replace Entrepreneur with Artist, Scientist, Historian, etc.
  • Add context — tell the personas what your "sweet spots" are
  • Adjust thresholds — change the gem/interesting/routine/skip cutoffs
  • Change the Contrarian's behavior — make it more or less aggressive

The five-persona-with-mandatory-Contrarian pattern works for any evaluation task, not just notebook triage.

Architecture

SQLite (WAL mode)     →  11 tables, single file, fully queryable
Claude Haiku          →  $0.005/session for triage
Single LLM call       →  5 personas evaluated simultaneously
Budget guardrail      →  $25 hard cap per run, visible cost tracking
Resumable downloads   →  Checkpoint after each session, Ctrl-C safe
Rich terminal UI      →  Progress bars, status panels, score visualizations

Cost Tracking

Every LLM call is logged to the cost_ledger table. The dig cost command shows spending by phase. There's a hard budget cap ($25/run by default) — the system stops before you get a surprise bill.

╭──────────────── Cost Summary — Total: $0.4263 ─────────────────╮
│ Phase   Calls   Input Tokens   Output Tokens      Cost         │
│ triage     94       239,083          56,910    $0.4263          │
╰────────────────────────────────────────────────────────────────╯

Requirements

  • Python 3.11+
  • An Anthropic API key (ANTHROPIC_API_KEY)
  • Your chat history exported as JSON

Roadmap

  • ChatGPT export converter
  • Claude.ai export converter
  • Taste profile learning from human reviews
  • Constellation Engine (embedding + HDBSCAN clustering)
  • Gem Extractor (atomic insight extraction)
  • Blog draft generator

License

MIT — see LICENSE.

Credits

Built by Erik Bethke with Claude Code.

Read the full build story: The Notebook Archaeologist

About

AI system that sifts through thousands of chat sessions to find intellectual gems. Parliament of 5 AI personas triages your conversations for $0.42.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages