# Dawn Dawn is a TypeScript-first meta-framework for building graph-based AI agents with the ergonomics of Next.js: file-system routing, co-located tools with inferred types, scenario testing, route-level agent features, and a local dev server with LangSmith-style endpoints. ## Install ``` pnpm create dawn-ai-app my-agent cd my-agent pnpm install ``` ## Project Shape - `dawn.config.ts` at repo root (only supported field: `appDir`, defaults to `src/app`). - `src/app/**/index.ts` — route entry; exports exactly one of default `agent(...)`, named `workflow` (async function), named `graph` (LangGraph graph), or named `chain` (LangChain LCEL Runnable). - `src/app/**/state.ts` — optional Zod route state schema. - `src/app/**/tools/*.ts` — co-located tools (default export is an async function; types inferred). - `workspace/AGENTS.md` — optional workspace memory injected into agent prompts. - `src/app/**/plan.md` — optional route-local planning seed; contributes `writeTodos`, `todos`, and `plan_update`. - `src/app/**/skills//SKILL.md` — optional route-local skills loaded through `readSkill`. - `src/app/**/subagents//index.ts` — optional child agent routes exposed through `task`. - `agent({ reasoning })` — optional OpenAI-backed reasoning-effort configuration. - `src/app/**/run.test.ts` — colocated scenario tests. - `.dawn/dawn.generated.d.ts` — auto-generated ambient types. Never edit by hand. ## Pathname Rules - Directory path becomes URL pathname. - `(public)` — route group; excluded from pathname. - `[tenant]` — dynamic segment preserved in the route id; provide the value in JSON input. - Example: `src/app/(public)/hello/[tenant]/index.ts` → `/hello/[tenant]`. ## Minimal Route ```ts import type { RuntimeContext } from "@dawn-ai/sdk" import type { RouteTools } from "dawn:routes" import type { z } from "zod" import type state from "./state.js" type HelloState = z.infer & { readonly tenant: string } export async function workflow( state: HelloState, ctx: RuntimeContext> ) { const result = await ctx.tools.greet({ tenant: state.tenant }) return { ...state, greeting: result.greeting } } ``` ## Minimal Tool ```ts // src/app/(public)/hello/[tenant]/tools/greet.ts export default async (input: { readonly tenant: string }) => { return { greeting: `Hello, ${input.tenant}!` } } ``` ## Commands - `dawn check` — validate app structure/config - `dawn routes` — list discovered routes - `dawn typegen` — regenerate `.dawn/dawn.generated.d.ts` - `echo '{"tenant":"acme"}' | dawn run '/hello/[tenant]'` — execute a route with JSON stdin/stdout - `dawn test` — run scenarios - `dawn dev` — local runtime (LangSmith-style endpoints: `/runs/wait`, `/runs/stream`, `assistant_id`) ## Packages - `@dawn-ai/sdk` — authoring contract (types, `RuntimeContext`, test helpers) - `@dawn-ai/langgraph` — LangGraph graphs/workflows adapter - `@dawn-ai/langchain` — LangChain LCEL adapter and provider-aware agent materialization - `@dawn-ai/cli` — the `dawn` CLI ## Deployment Dawn owns local development and the build step. `dawn build` writes `.dawn/build/langgraph.json` plus per-route entry files. Production runs on LangSmith or another runtime that consumes those generated LangGraph artifacts. ## Task-Specific Prompts Copy-ready prompts for common tasks: - Scaffold: https://dawnai.org/prompts/scaffold - Add a tool: https://dawnai.org/prompts/add-a-tool - Write a route: https://dawnai.org/prompts/write-a-route - Write a test: https://dawnai.org/prompts/write-a-test - Deploy: https://dawnai.org/prompts/deploy ## Agent Config Templates Drop-in agent configuration for a Dawn project: - https://dawnai.org/AGENTS.md ## Brand Assets Official Dawn AI logos, icons, favicons, and social assets: - Asset manifest: https://dawnai.org/brand/assets.json - Full brand kit ZIP: https://dawnai.org/brand/dawn-ai-brand-assets.zip ## Full Reference https://dawnai.org/llms-full.txt ## Source https://github.com/cacheplane/dawnai ## Blog - [The App Router for AI Agents](https://dawnai.org/blog/app-router-for-ai-agents): File-system routes, type-safe tools, and the capability layer Dawn adds around real LangGraph.js agent applications. - [Why we built Dawn](https://dawnai.org/blog/why-we-built-dawn): Dawn is a TypeScript-first framework for building LangGraph.js agents with file-system routes, route-local tools, generated types, and a local dev loop.