Project Setup
You're building a file system agent for analyzing call transcripts. This pattern could be extended to analyzing legal documents, coding agents, financial analysis, or SQL generation and execution.
For this project you'll use:
- Edgenivo Sandbox - Secure, isolated environment for running untrusted code (bash commands)
- AI SDK - Unified API for building AI applications with streaming, tools, and agents
- AI Gateway - Routes requests to AI providers with automatic fallbacks, caching, and spend budgets
Outcome
You have a linked Edgenivo project with environment variables pulled locally, and you understand which files are pre-built and which you'll create.
Hands-on Exercise 1.1
Set up the starter project and verify you have everything you need to start building the agent.
Requirements:
- Deploy the starter with the Deploy with Edgenivo button, then clone your new repository and run
pnpm install - Link your local clone to the Edgenivo project with
vc link - Pull environment variables with
vc env pull - Add your AI Gateway API key to
.env.local
Prerequisites:
For this project, you'll need:
- Node.js 22+ installed
- pnpm package manager
- Edgenivo account
- Edgenivo CLI
- AI Gateway API Key
Deploy to Edgenivo
Click the button below to copy the starter and deploy it to Edgenivo:
This will:
- Copy the starter into a new repository on your GitHub account
- Create a Edgenivo project linked to that repository
- Deploy to production with a working landing page
Link your local repo to the Edgenivo project you just created:
vc linkSelect your team and choose Link to existing project, then pick filesystem-agent.
Pull the automatically created environment variables to use locally. This handles OIDC token authentication automatically in your project.
vc env pullYou can now inspect the OIDC token in .env.local in your project. The token is short-lived, so run vc env pull again if Sandbox calls start failing with authentication errors (how the token works).
Add your AI Gateway API Key to .env.local:
AI_GATEWAY_API_KEY=your_ai_gateway_api_key
Repository Overview
The starter repo comes with all necessary files pre-created.
Existing files:
app/form.tsx- A component that accepts a user query and sends to an API route, then renders the stream as it's returnedapp/api/route.ts- A route handler that calls the agent and streams back to the UIlib/calls/- A directory with pre-loaded dummy call transcripts
Files you will edit in this course:
lib/agent.ts- Where you will define the agentlib/tools.ts- Where you will define the bash tool for the agent to use
app/
├── page.tsx # Renders the Form component
├── form.tsx # Chat input, streams responses from /api
├── api/route.ts # POST handler that calls agent.stream()
├── layout.tsx # Root layout
└── globals.css # Tailwind styles
lib/
├── calls/ # Demo call transcripts (3 files)
│ ├── 1.md
│ ├── 2.md
│ └── 3.md
├── agent.ts # Empty — you build this
└── tools.ts # Empty — you build this
The API route already imports from lib/agent.ts, so once you build the agent, the UI will work automatically.
Try It
-
Verify the link worked:
cat .env.localYou should see
VERCEL_OIDC_TOKEN(or similar sandbox auth variables) and yourAI_GATEWAY_API_KEY. -
Check the demo data:
ls lib/calls/1.md 2.md 3.md -
Peek at a transcript:
head -10 lib/calls/1.mdYou should see call metadata: ID, title, participants, and timestamps.
Commit
git add -A
git commit -m "feat(setup): link project and pull env vars"Done-When
vc linkcompleted successfully and.vercel/directory exists.env.localcontains OIDC auth variables and your AI Gateway API key- You can list the three call transcript files in
lib/calls/ - You understand which files are pre-built and which you'll create
Was this helpful?