Skip to content
Reunify-LabsPublic

About

The official page for First Principle AI web app.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

First Principle AI

Think like a scientist. Learn anything from the fundamental truth.
Imagine Notion and ChatGPT had a baby.

Live site · Launch post · Why multimodality


What it is

First Principle AI is an AI that helps you learn in depth. Instead of a long linear chat, every answer is a block: a short, textbook-style lesson. Your follow-up questions branch out to the right like a tree, so you always know where you are.

Why we built it

It started with a problem we had while cramming for a midterm with ChatGPT:

  • You paste all your notes and ask it to teach you something from scratch.
  • Halfway through the response, you get confused.
  • So you ask a follow-up. Then another one.
  • Soon the chat is long and messy, and you've lost track of where you left off.

Modern LLM interfaces are bad at in-depth learning, so we built a block interface instead.

We also believe people learn in different ways. Some want full paragraphs, some understand faster through diagrams, and some need an animation. We don't learn by consuming, we learn by doing.

Why open source? Claude and ChatGPT have since shipped their own multimodal interfaces, so we're opening this up as a fun project for people to try, fork, and build on.

Key features

Never lose context

Traditional chat turns learning into a long scroll where you forget where you were. With the block interface, your main block stays visible and sub-blocks branch out, so you can track your progress and jump back anytime. Highlight any text, click Dive deeper, and a new sub-block opens one level down. The Block Map shows the whole tree.

Block interface and Block Map

Multimodality

Ideas aren't limited to plain text. First Principle can generate 20+ block types, including charts, diagrams, animations, tables, and more, so each concept shows up in the format that fits it best.

Animations, math, tables and charts inside a block

Block types include paragraphs, headings, LaTeX math, code with syntax highlighting, tables that turn into charts (bar, pie, line, area, scatter), diagrams, generated Manim animations, images, YouTube embeds, definitions, quizzes, flashcards, key terms, learning objectives, a table of contents, references, translations, and simulations.

Adaptive learning

As you learn, First Principle remembers your background, your level, and what you've already covered across your blocks. Each new block is tailored to your current understanding, so explanations stay consistent and pick up where you left off. You can also upload your own documents (like exam notes) to learn from them.

Saved learner memory and uploaded documents

Also included

  • Short / Medium / Long depth control for every main block
  • Analyze table: ask the AI to explain any table in a side panel
  • Voice input, web search, file attachments
  • Session search, sharing, and export

How it works

You ask a question
   │
   ├─ New topic   → checks context → splits the topic into sections → writes them in parallel → one Main Block
   ├─ Dive deeper → highlighted text + summary of the parent → Sub-block (depth 1, 2, 3…)
   └─ Follow-up   → full parent block as context → threaded Response
   │
   ▼
The answer comes back as modular content blocks (text, math, chart, animation…),
each rendered by its own component.
Part Stack
frontend/ Next.js 16 (App Router), TypeScript, Tailwind CSS v4, KaTeX, static export
backend/ Python 3.11 on AWS Lambda (SAM), OpenAI + Gemini, DynamoDB, Manim for animations
admin-frontend/, backend-admin/ Internal admin dashboard and its API
Auth Firebase Authentication

Run it locally

You'll need your own API keys and cloud accounts. None are included in this repo.

Frontend

cd frontend
npm install
npm run dev        # http://localhost:3000

Create frontend/.env.local with your own values for NEXT_PUBLIC_API_URL and the NEXT_PUBLIC_FIREBASE_* keys.

Backend

cd backend
pip install -r requirements.txt
pytest tests/
sam build

The backend reads OPENAI_API_KEY, GEMINI_API_KEY, BRAVE_API_KEY, and FIREBASE_SERVICE_ACCOUNT_JSON from your own secrets store. Deploy it to your own AWS account with sam deploy --guided.

Contributing

Issues and pull requests are welcome. If you build something fun on top of it, tag @imjustinliao on X.


Built by Reunify Labs. We believe the future is shaped by polymaths.

About

The official page for First Principle AI web app.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages