A chat interface for interacting with documents through the Document Engine MCP server using LangGraph and Next.js.
Document Chat is a monorepo application that provides a conversational interface for interacting with documents. It consists of two main components:
- Agents: A LangGraph-powered agent that connects to the Document Engine MCP server to provide document-related functionality
- Web: A Next.js web application that provides a user interface for chatting with the agent
- Node.js v20 or later
- pnpm v10 or later
- Document Engine MCP server running (locally or remotely)
- API keys for the required services (see Environment Variables)
Create a .env file in the root directory with the following variables:
# Required API keys
OPENAI_API_KEY="" # Required for the LLM
MCP_SERVER_URL="http://localhost:5100/mcp" # URL to your Document Engine MCP server
# Install dependencies
pnpm install# Start both the web and agents applications in development mode
pnpm dev
# Start only the web application
pnpm turbo dev --filter=web
# Start only the agents application
pnpm turbo dev --filter=agentsThe web application will be available at http://localhost:3000 and the LangGraph agent will be available at http://localhost:2024.
# Build all applications
pnpm build
# Build only the web application
pnpm turbo build --filter=web
# Build only the agents application
pnpm turbo build --filter=agentsThe agents application uses LangGraph to create a conversational agent that can interact with documents through the Document Engine MCP server. The agent uses:
- OpenAI's GPT-4.1-mini model (configurable)
- LangGraph for agent orchestration
- Document Engine MCP client for document-related tools
The web application provides a user interface for chatting with the agent. It uses:
- Next.js for the web framework
- React for the UI
- TailwindCSS for styling
- LangGraph SDK for connecting to the agent
You can customize the agent by modifying the following files:
apps/agents/src/react-agent/graph.ts: The main agent graphapps/agents/src/react-agent/configuration.ts: Agent configuration
See the LICENSE file in the root directory.