Laurie Voss 20766d600e JavaScript!
2025-04-17 13:59:30 -07:00
2025-04-17 13:24:58 -07:00
2025-04-17 13:24:58 -07:00
2025-04-17 13:24:58 -07:00
2025-04-17 13:24:58 -07:00
2025-04-17 13:24:58 -07:00
2025-04-17 13:59:30 -07:00
2025-04-17 13:46:21 -07:00

10K multi-year Risk Summarizer

This is a quick-and-dirty all-JavaScriptweb app that summarizes how the risks identified by a corporation in its annual 10K filings have changed over time. It use LlamaExtract, part of LlamaCloud, and of the course the LlamaIndex framework. It expects to work on 10K filings; you can find Apple's 10K filings for many years on their investor relations site.

We hope this gives you a useful jumping-off point for your own projects using LlamaExtract!

screenshot of the app

Setup

You'll need a few values in your .env.local file to get this working:

  • NEXTAUTH_URL which can be set to http://localhost:3000 for testing
  • NEXTAUTH_SECRET which can be any random string
  • GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET which you can get from the Google Cloud Console by creating a new OAuth client.
  • LLAMA_CLOUD_API_KEY which you can get from the LlamaCloud Console for free.
  • LLAMA_EXTRACT_AGENT_ID which you can get from the "Extraction" screen of your LlamaCloud project. You should use the UI to create your schema.
  • ANTHROPIC_API_KEY which you can get from the Anthropic Console.

Running

npm install
npm run dev

Under the hood

The web app has only a handful of API routes:

  • /api/auth for authentication (handled by NextAuth)
  • /api/process accepts the uploaded file and kicks off the extraction job
  • /api/status is a polling endpoint for the client to check on the status of the job
  • /api/result fetches the results of the extraction once ready
  • /api/summarize takes multiple years of risks and summarizes them, then returns the summary as HTML

Resources

S
Description
No description provided
Readme MIT 556 KiB
Languages
TypeScript 80.2%
CSS 18%
JavaScript 1.8%