This repository contains the full-stack AI agent project for Devscale AI Product Engineering Batch 1. It is organized as a pnpm monorepo with a React chat interface, a Hono API, a reusable agent package, and PostgreSQL-backed conversation memory.
- Platform: React 19, Vite, TanStack Router, Tailwind CSS
- API: Hono and Node.js
- Agent: Anvia, an OpenAI-compatible model provider, and Tavily web search
- Database: PostgreSQL 16 and Prisma
- Observability: Langfuse
- Workspace: pnpm
.
├── apps
│ ├── api # Hono API and Prisma schema
│ └── platform # React chat application
├── packages
│ └── agent # Agent, model, tools, prompts, and tracing
├── docker-compose.yml
└── pnpm-workspace.yaml
Install the following before getting started:
- Node.js 22 or newer
- pnpm 11.9 or newer
- Docker with Docker Compose
- An API key for an OpenAI-compatible model provider
- A Tavily API key
- Langfuse credentials if tracing is enabled
-
Install the dependencies:
pnpm install
-
Create your local environment file:
cp .env.example .env
Update
.envwith your model provider and tool credentials. The configured model is currentlydeepseek-v4-flash; make sure the value ofOPENAI_BASE_URLpoints to a compatible provider that offers this model, or update the model inpackages/agent/src/providers/openai.ts. -
Start PostgreSQL:
docker compose up -d db
-
Generate the Prisma client and apply the database migrations:
pnpm --filter api db:generate pnpm --filter api db:migrate
-
Start the development servers:
pnpm dev
The platform is available at http://localhost:3000, and the API runs at http://localhost:8000.
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string used by Prisma and the API |
OPENAI_API_KEY |
Yes | API key for the configured OpenAI-compatible model provider |
OPENAI_BASE_URL |
Provider-dependent | Base URL for the OpenAI-compatible API |
TAVILY_API_KEY |
Yes | API key used by the agent's web search and extraction tools |
LANGFUSE_BASE_URL |
For tracing | Langfuse server or cloud URL |
LANGFUSE_PUBLIC_KEY |
For tracing | Langfuse project public key |
LANGFUSE_SECRET_KEY |
For tracing | Langfuse project secret key |
NODE_ENV |
No | Runtime environment, such as development |
Never commit .env or real credentials. Use .env.example only as a reference.
# Run the platform and API in development mode
pnpm dev
# Run the agent directly with its development prompt
pnpm --filter @devscale/agent runner:dev
# Build the API and platform
pnpm --filter api build
pnpm --filter platform build
# Open Prisma Studio
pnpm --filter api db:studio
# Apply existing migrations in a deployment environment
pnpm --filter api db:deployThe chat API is exposed at /api/chat:
GET /api/chatloads messages from the current development session.POST /api/chatsends the latest user message to the agent and streams a JSONL response.
This project demonstrates how to build an AI product end to end: connecting a model to tools, streaming responses to a frontend, persisting agent memory, and tracing model activity for debugging and evaluation.