-
-
Notifications
You must be signed in to change notification settings - Fork 959
Add smart spreadsheet docs #2877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+101
−0
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| title: "Smart Spreadsheet" | ||
| sidebarTitle: "Smart Spreadsheet" | ||
| description: "An AI-powered company enrichment tool that uses Exa search and Claude to extract verified company data with source attribution." | ||
| --- | ||
|
|
||
| import RealtimeLearnMore from "/snippets/realtime-learn-more.mdx"; | ||
|
|
||
| ## Overview | ||
|
|
||
| Smart Spreadsheet is an AI-powered tool that enriches company data on demand. Input a company name or website URL and get verified information including industry, headcount, and funding details; each with source attribution. Results stream to the frontend in real-time as they're processed. | ||
|
|
||
| - A [Next.js](https://nextjs.org/) app with [Trigger.dev](https://trigger.dev/) for background tasks | ||
| - [Exa](https://exa.ai/) – an AI-native search engine that returns clean, structured content ready for LLM extraction | ||
| - [Claude](https://anthropic.com/) via the [Vercel AI SDK](https://sdk.vercel.ai/) for data extraction | ||
| - [Supabase](https://supabase.com/) PostgreSQL database for persistence | ||
| - Trigger.dev [Realtime](/realtime/overview) to stream updates to the frontend | ||
|
|
||
| ## Video | ||
|
|
||
| <video | ||
| controls | ||
| className="w-full aspect-video" | ||
| src="https://content.trigger.dev/smart-spreadsheet.mp4" | ||
| ></video> | ||
|
|
||
| ## GitHub repo | ||
|
|
||
| <Card | ||
| title="View the Smart Spreadsheet repo" | ||
| icon="GitHub" | ||
| href="https://github.com/triggerdotdev/examples/tree/main/smart-spreadsheet" | ||
| > | ||
| Click here to view the full code for this project in our examples repository on GitHub. You can | ||
| fork it and use it as a starting point for your own project. | ||
| </Card> | ||
|
|
||
| ## How it works | ||
|
|
||
| The enrichment workflow: | ||
|
|
||
| 1. **Trigger enrichment** – User enters a company name or URL in the spreadsheet UI | ||
| 2. **Parallel data gathering** – Four subtasks run concurrently to fetch basic info, industry, employee count, and funding details | ||
| 3. **AI extraction** – Each subtask uses Exa search + Claude to extract structured data with source URLs | ||
| 4. **Real-time updates** – Results stream back to the frontend as each subtask completes | ||
| 5. **Persist results** – Enriched data is saved to Supabase with source attribution | ||
|
|
||
| ## Features | ||
|
|
||
| - **Parallel processing** – All four enrichment categories run simultaneously using [batch.triggerByTaskAndWait](/triggering#batch-trigger-by-task-and-wait) | ||
| - **Source attribution** – Every data point includes the URL it was extracted from | ||
| - **Real-time streaming** – Results appear in the UI as they're processed using [Realtime](/realtime/overview) | ||
| - **Structured extraction** – Zod schemas ensure consistent data output from Claude | ||
|
|
||
| ## Relevant code | ||
|
|
||
| | File | Description | | ||
| | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | | ||
| | [`src/trigger/enrich-company.ts`](https://github.com/triggerdotdev/examples/blob/main/smart-spreadsheet/src/trigger/enrich-company.ts) | Main orchestrator that triggers parallel subtasks and persists results | | ||
| | [`src/trigger/get-basic-info.ts`](https://github.com/triggerdotdev/examples/blob/main/smart-spreadsheet/src/trigger/get-basic-info.ts) | Extracts company website and description | | ||
| | [`src/trigger/get-industry.ts`](https://github.com/triggerdotdev/examples/blob/main/smart-spreadsheet/src/trigger/get-industry.ts) | Classifies company industry | | ||
| | [`src/trigger/get-employee-count.ts`](https://github.com/triggerdotdev/examples/blob/main/smart-spreadsheet/src/trigger/get-employee-count.ts) | Finds employee headcount | | ||
| | [`src/trigger/get-funding-round.ts`](https://github.com/triggerdotdev/examples/blob/main/smart-spreadsheet/src/trigger/get-funding-round.ts) | Discovers latest funding information | | ||
|
|
||
| <RealtimeLearnMore /> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.