Headnote

October 10, 2026 (2w ago)

Stack: Python, FastAPI, LangGraph, ChromaDB, SQLAlchemy, PostgreSQL, React, TypeScript, Vite, Docker, Vercel, Render · Repo: Axeloooo/Headnote

Problem

Headnote lets you add documents to a library, ask a question, and read an answer whose source pills show which document and which part of it were retrieved.

With no API key, an offline echo model lets the whole app run end to end; with a key it uses Anthropic or OpenAI. It was built for free-tier hosting: Vercel for the web app, Render for the API and Neon for Postgres. The app was deployed once and is now offline because of hosting budget.

Architecture diagram

  React SPA (apps/web)
      |  /api/*   (same origin)
      v
  nginx in Docker   or   Vercel rewrite
      |
      v
  FastAPI (create_app)
      |
      +-- POST /documents --> chunk_text (~800 chars) --+
      |                                                 v
      +-- POST /chat --> LangGraph:                ChromaDB collection
      |                    retrieve (top 3 chunks) <----+
      |                    respond --> ChatAnthropic | ChatOpenAI | echo model
      |
      +-- SQLAlchemy --> SQLite (local) or Postgres (Neon)
 
  seed_library: bundled demo docs --> Chroma + SQL at start

POST /documents splits text into paragraph-packed chunks, inserts a Document row to get an id, and adds the chunks to Chroma with that id as metadata. POST /chat loads the last 20 messages, runs the two-node graph with the top three chunks in the system prompt, saves both messages, and returns the reply with sources mapped back to titles.

Key decisions

Challenges

Results

Links