Skip to content

run-llama/llamaextract-10k-demo

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published