Full Stack Agent with Python Backend
- Web chat
- Postgres
- Vercel
A Next.js web chat with a Python FastAPI backend, where an eve agent manages a shared task list and runs Python tools for statistics and text analysis.
- Web chat
- Postgres
- Vercel
agent/agent.tstypescripteve Agent with Python Template
Web chat built on eve, Next.js, and a Python FastAPI backend, where the agent manages a shared task list and runs Python tools. Ask "Add a task to renew the domain" and the agent creates it through the FastAPI backend, then it appears on the app's Tasks page.
Getting started
Vercel's project setup flow will create a repository in your Git account and a Vercel project. You'll then be prompted to add the following environment variable and database:
When the deploy finishes, open the deployment URL and enter the password. Then ask the agent to add a task, such as "Add a task to renew the domain", and open Tasks to see it.
Tech stack
How the chat works
The agent lives in agent/, the chat and the other pages live in apps/web/, and the FastAPI backend lives in apps/api/. They deploy together with Vercel Services in one project. vercel.ts adds the agent with withEve and gives the agent and the web app the backend's URL in the BACKEND_URL environment variable. The backend has no public route, so browsers reach it only through the web app.
Ask the agent to add, complete, or delete tasks and it calls the same FastAPI endpoints that the Tasks page uses. Changes made in the chat or on the page show up in both. For statistics or text analysis it runs Python code in the backend instead of doing the math itself. You can reload the page to return to the conversation later, or share its link with anyone who has the password.
The Backend page shows which Python and FastAPI versions the backend runs and has a form that computes statistics with the same Python endpoint as compute_stats. The API page lists every endpoint the backend describes in its OpenAPI document.
Access control
Visitors who haven't signed in are sent to a sign-in page to enter the password set in the EVE_CHAT_PASSWORD environment variable. Choose a long random password, such as the output of openssl rand -base64 32. Everyone with the password is trusted equally and shares one task list, so share it only with people who may see each other's chats and tasks.
Until you set EVE_CHAT_PASSWORD, the sign-in page asks you to set it. To replace the password with Clerk, Better Auth, or another auth provider, see Change who can use the app in the customization guide.
Local development
Use Node.js 24, pnpm, and uv, which installs the backend's Python packages. Install the Vercel CLI, then clone your repository and run:
Choose your deployed project when vercel link prompts you. vercel env pull .env.local saves your project's development environment variables to .env.local, including the token that lets the agent call models through Vercel AI Gateway.
pnpm dev:all starts the web app, agent, and backend together with vercel dev, and routes requests to them the same way a deployment does. Open the URL it prints and send a message. When EVE_CHAT_PASSWORD is unset, the app opens without a password. When DATABASE_URL is unset, the backend stores tasks in a SQLite file at apps/api/.data/dev.sqlite3.
To chat with the agent in your terminal instead, run pnpm dev:api and pnpm dev:eve in two terminals.
Before deploying, check your changes and confirm the agent and the web app build:
pnpm test runs the backend's tests with pytest, and pnpm lint:api checks its Python code with Ruff. When the checks pass, deploy with:
Customization
For more ways to customize the template, including adding backend endpoints and Python tools, using your own authentication provider, and connecting another eve agent such as the eve Data Analyst Template, see the customization guide.