mirror of
https://github.com/run-llama/llamaextract-10k-demo.git
synced 2026-06-29 10:37:04 -04:00
main
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!
Setup
You'll need a few values in your .env.local file to get this working:
NEXTAUTH_URLwhich can be set tohttp://localhost:3000for testingNEXTAUTH_SECRETwhich can be any random stringGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETwhich you can get from the Google Cloud Console by creating a new OAuth client.LLAMA_CLOUD_API_KEYwhich you can get from the LlamaCloud Console for free.LLAMA_EXTRACT_AGENT_IDwhich you can get from the "Extraction" screen of your LlamaCloud project. You should use the UI to create your schema.ANTHROPIC_API_KEYwhich 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/authfor authentication (handled by NextAuth)/api/processaccepts the uploaded file and kicks off the extraction job/api/statusis a polling endpoint for the client to check on the status of the job/api/resultfetches the results of the extraction once ready/api/summarizetakes multiple years of risks and summarizes them, then returns the summary as HTML
Resources
Languages
TypeScript
80.2%
CSS
18%
JavaScript
1.8%
