Skip to content
rgbuildsPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

AskS1

Ask questions about an IPO S-1 filing and get answers grounded in the actual document — with a citation to the exact printed page the fact came from.

Live at asks1.com. Currently covers Anthropic's and SpaceX's S-1 filings.

How it works

  1. Each filing's PDF is split per-page, preserving the printed page number (not the PDF page index), including the F- numbered financial statement pages.
  2. Pages are chunked and embedded locally, with inline [p.X] markers kept in the stored text.
  3. A question is embedded and matched against the filing's collection in Qdrant.
  4. Claude answers only from the retrieved context and cites the single page a fact appears on.
  5. Citations are verified against the answer text before being shown — only pages the answer actually cites make it into the Sources list.

Stack

  • Frontend/API: Next.js (App Router) on Railway
  • Vector search: Qdrant Cloud, one collection per filing
  • Embeddings: local, via @xenova/transformers (no embedding API calls)
  • Generation: Claude Sonnet 5.5 (@anthropic-ai/sdk)
  • Waitlist storage: Google Sheets

Running locally

cd web
npm install
cp .env.local.example .env.local   # fill in your own keys
npm run dev

Required env vars (see .env.local.example):

Var Purpose
ANTHROPIC_API_KEY Claude generation
QDRANT_URL / QDRANT_API_KEY Vector search
GOOGLE_CREDS_JSON Service-account creds for the waitlist sheet

Scripts

  • npm run dev / build / start — standard Next.js
  • scripts/ingest.ts — chunk + embed a filing PDF into Qdrant
  • scripts/verify-citations.ts — checks every retrieved chunk's page tags against the source PDF
  • scripts/eval-anthropic-rag.ts — runs the eval set, scores faithfulness/citation quality with an LLM judge
  • scripts/gen-icons.mjs — regenerates favicon/app-icon assets from app/icon.svg

Honest limitations

  • Exact-page citations currently only cover the Anthropic collection; SpaceX still cites a coarser page range through the older path.
  • Retrieval occasionally misses numeric facts buried in tables — see the eval write-up for specifics.
  • Sessions are rate-limited since this is a self-funded, non-monetized project.

Writeup

Adding Anthropic to AskS1: what changed, what broke, what's still unfinished

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages