# LangGraph.js AI Agent Template

A production-ready Next.js template for building AI agents with LangGraph.js, featuring dynamic Model Context Protocol tool loading from a web UI, human-in-the-loop tool approval, persistent PostgreSQL-backed conversation memory, and real-time streaming responses.

This is a Next.js template for building AI agents with LangGraph.js, covering a complete workflow from user input through tool approval, execution and a streaming response. Tools can be added dynamically through the Model Context Protocol from a web UI, over stdio or HTTP MCP servers, with tool-name prefixing to avoid conflicts and no code changes required.

Every tool call can pause for interactive human approval, with approve, deny or modify options, or run in an optional auto-approval mode for trusted environments. Conversation memory persists through a LangGraph checkpointer backed by PostgreSQL, with full history preservation and thread-based organization across sessions, and file uploads support images, PDFs and text with S3-compatible storage such as MinIO for development or AWS S3 and Cloudflare R2 in production.

Responses stream over Server-Sent Events with optimistic UI updates, provider and model selection persist to local storage, and Langfuse integration adds LLM observability. The stack is TypeScript, React, Prisma and Tailwind CSS.

Website: https://github.com/agentailor/fullstack-langgraph-nextjs-agent
