Skip to content

Silknode1/purple-prism

Repository files navigation

๐Ÿ”ฎ Purple Prism

Multi-Domain Research Intelligence with Autonomous Browser Automation

Where knowledge converges through parallel autonomous intelligence


๐Ÿš€ What Is This?

Purple Prism is the first AI research engine with autonomous parallel browsing. Powered by Lightpanda headless browser + Claude Sonnet, it deploys multiple lightweight browsers simultaneously to research your query from every angle.

Key Innovation: While Perplexity searches and summarizes, Purple Prism autonomously browses 5+ websites in parallel, extracts information, cross-references claims, and synthesizes comprehensive reports.


โœจ Features

๐ŸŒ Deep Research Mode (NEW!)

  • Parallel browsing: 5 Lightpanda instances scraping simultaneously
  • 11x faster than traditional browser automation
  • 9x less memory (24MB per browser vs 207MB for Chrome)
  • Server-side execution: No user browser required
  • Real-time synthesis: Claude combines findings into coherent reports

๐ŸŽจ Premium UI

  • Animated purple prism logo with light refraction
  • Dynamic video background (120s prism loop)
  • Liquid glass dark mode overlay
  • A/B video toggle (V1: dynamic, V2: subtle)

โšก Research Modes

  • Standard Mode: Fast Claude synthesis from knowledge base
  • Deep Research Mode: Autonomous multi-source web research

๐Ÿค– Multi-Provider AI (NEW!)

  • Bring 1-5 API keys: Claude, GPT-4, Gemini, or all of them
  • Automatic load balancing: Distribute synthesis across providers
  • Redundancy: Auto-fallback if one API fails
  • Advanced: Parallel multi-model analysis (coming soon)
  • See MULTI-PROVIDER-AI.md for details

๐Ÿ“Š Output Formats

  • Quick summary
  • Notion-ready document
  • Presentation slides
  • Deep research report
  • Podcast-ready audio script

๐ŸŠ Research Depths

  • ๐Ÿƒ Quick (5-min scan)
  • ๐Ÿšถ Standard (15-min dive)
  • ๐ŸŠ Deep (30+ min immersion)

๐Ÿ—๏ธ Architecture

User Query
    โ†“
Purple Prism API
    โ†“
Lightpanda (5 parallel instances)
    โ†“
[Site 1] [Site 2] [Site 3] [Site 4] [Site 5]
    โ†“
Claude Sonnet 4.5 (synthesis)
    โ†“
Comprehensive Report (streamed)

Tech Stack

Frontend:

  • Next.js 14 (App Router)
  • React 18
  • Tailwind CSS
  • TypeScript

AI/Automation:

  • Claude Sonnet 4.5 (Anthropic API)
  • Lightpanda Browser (11x faster, 9x less memory than Chrome)
  • Custom TypeScript wrapper for browser automation

Optional Integrations:

  • Notion API (auto-save research)
  • Vercel Analytics

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js 18+
  • Anthropic API key (get one here)
  • (Optional) OpenAI API key for GPT-4 support
  • (Optional) Google API key for Gemini support
  • (Optional) Notion API key for auto-save

Quick Start

# 1. Clone the repo
git clone https://github.com/your-username/purple-prism.git
cd purple-prism

# 2. Install dependencies
npm install

# 3. (Optional) Install additional AI providers
npm install openai @google/generative-ai

# 4. Download Lightpanda binary
# For Mac (M1/M2/M3):
curl -L -o bin/lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos
chmod +x bin/lightpanda

# For Linux:
curl -L -o bin/lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux
chmod +x bin/lightpanda

# 5. Set up environment variables
cp .env.example .env
# Edit .env and add your API key(s)

# 6. Run development server
npm run dev

Visit http://localhost:3000


๐ŸŽฏ Usage

Basic Research

  1. Enter your query
  2. Select output format (Quick, Notion, Presentation, etc.)
  3. Choose research depth (Quick ๐Ÿƒ, Standard ๐Ÿšถ, Deep ๐ŸŠ)
  4. Click "Refract Knowledge"

Deep Research Mode

  1. Toggle "๐ŸŒ Deep Research ON" in header
  2. Enter complex query (e.g., "Latest quantum computing breakthroughs 2026")
  3. Watch real-time scraping:
    ๐ŸŒ Browsing: techcrunch.com
    ๐Ÿ“Š Found: IBM announces 1000-qubit processor
    ๐ŸŒ Browsing: arxiv.org
    ๐Ÿ“Š Found: New error correction breakthrough
    ...
    
  4. Receive comprehensive synthesized report

๐Ÿ”ง Configuration

Environment Variables

# Required (at least one)
ANTHROPIC_API_KEY=sk-ant-xxx

# Optional (add for multi-provider support)
OPENAI_API_KEY=sk-xxx
GOOGLE_API_KEY=xxx

# Optional (for Notion integration)
NOTION_API_KEY=secret_xxx
NOTION_DATABASE_ID=xxx

Multi-Provider Benefits:

  • 1 provider: Basic Deep Research works
  • 2-3 providers: Auto-fallback + load balancing
  • 4-5 providers: Parallel multi-model synthesis

See MULTI-PROVIDER-AI.md for complete guide.

Lightpanda Settings

Edit lib/lightpanda.ts to customize:

// Timeout per scrape
{ timeout: 10000 } // 10 seconds

# Max concurrent scrapes
const limit = pLimit(5); // 5 parallel browsers

๐Ÿ“Š Performance

Benchmarks

Test: Research query requiring 5 source sites

Mode Time Memory Sources
Standard (Claude only) ~3s 50MB 0 (knowledge base)
Deep Research (Lightpanda) ~2-3s 120MB 5 (parallel web scraping)
Traditional (Puppeteer) ~15s 1GB+ 5 (sequential)

Result: Deep Research Mode is 5x faster than traditional browser automation with 8x less memory.


๐ŸŽจ Customization

Video Background

Toggle between two prism videos:

  • V1 (default): 120-second dynamic prism loop
  • V2: 61-second subtle geometric shifts

Button in UI header switches between them.

Theme Colors

Purple Prism uses a purple/indigo gradient palette:

  • Primary: #8B5CF6 (purple-500)
  • Dark: #5B21B6 (purple-900)
  • Light: #C4B5FD (purple-300)
  • Accent: #6366F1 (indigo-500)

Edit app/globals.css and tailwind.config.js to modify.


๐Ÿš€ Deployment

Netlify (Recommended)

# Build for production
npm run build

# Deploy
netlify deploy --prod

Important: Ensure bin/lightpanda is included in deployment.

Update netlify.toml:

[functions]
  node_bundler = "esbuild"
  included_files = ["bin/lightpanda"]

Vercel

vercel --prod

Docker

docker build -t purple-prism .
docker run -p 3000:3000 -e ANTHROPIC_API_KEY=xxx purple-prism

๐Ÿงช Testing

Test Lightpanda Integration

# Run benchmark
npx tsx test/lightpanda-benchmark.ts

Expected output:

๐Ÿš€ Benchmarking Lightpanda parallel scraping...

๐Ÿ“Š Results:
Total time: 2847ms
Average per site: 569ms
Successful: 5/5

โœ… Benchmark complete!

Test UI Locally

npm run dev
# Visit http://localhost:3000
# Toggle Deep Research ON
# Try query: "Latest RISC-V AI developments"

๐Ÿ“š Documentation


๐Ÿค Contributing

This is currently a personal project, but suggestions are welcome!

  1. Fork the repo
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

๐Ÿ“„ License

MIT License - feel free to fork and adapt.


๐Ÿ™ Credits

Built by: Derayc
AI Partner: Claude Sonnet 4.5
Browser Engine: Lightpanda (22.2k โญ)
Inspired by: Pink Floyd's Dark Side of the Moon (prism concept)


๐Ÿ”ฎ Roadmap

v1.0 (Current)

  • โœ… Deep Research Mode with Lightpanda
  • โœ… Parallel autonomous browsing
  • โœ… Animated UI with video backgrounds
  • โœ… Multiple output formats

v1.1 (Next)

  • Interactive research steering ("Focus more on technical specs")
  • Better source discovery (integrate web search API)
  • Citation management
  • Export to PDF/DOCX

v2.0 (Future)

  • Multi-agent research (3 Claude agents researching different angles)
  • Knowledge graph (entity relationships across queries)
  • Voice input for queries
  • Mobile app (React Native)

๐Ÿ’ฌ FAQ

Q: Why Lightpanda instead of Puppeteer/Playwright?
A: Lightpanda is 11x faster and uses 9x less memory. For parallel research (5+ browsers), this means Purple Prism can run on cheap servers instead of requiring expensive compute.

Q: Does Deep Research Mode work without Lightpanda?
A: No, it requires the Lightpanda binary. But you can still use Standard Mode (Claude knowledge base) without it.

Q: Can I add my own research sources?
A: Yes! Edit lib/lightpanda.ts โ†’ findResearchSources() function.

Q: How much does it cost to run?
A: Only Anthropic API usage (~$0.01-0.10 per query depending on depth). Lightpanda is free and open-source.

Q: Is my data secure?
A: Yes. All research happens server-side. Your queries and results are not stored (unless you enable Notion integration).


๐Ÿšจ Known Issues

  • Lightpanda compatibility: Some sites with complex JavaScript may not scrape perfectly (fallback to standard mode)
  • Rate limiting: Some sites may block rapid requests (add delays if needed)
  • Memory limits: On free Netlify, limit concurrent browsers to 3 (vs 5)

See Issues for full list.


Purple Prism - Where knowledge converges ๐Ÿ”ฎโœจ

About

Only Research Engine with autonomous parallel browsing powered by Lightpanda + Claude + Multi Provider API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors