AI-powered procurement document processing system using LangGraph.js and Document Engine MCP Server.
This system automatically processes procurement documents and performs 3-way matching between:
- Purchase Orders (PO)
- Invoices
- Payments
It uses AI agents to classify documents, extract data, find matches, and generate comprehensive reports.
- Node.js 18+
- Document Engine running locally
- MCP server running (default: http://localhost:5100/mcp)
- OpenAI API key set in the environment
-
Install dependencies:
pnpm install
-
Environment setup: Create a
.envfile in this directory with:OPENAI_API_KEY=your_openai_api_key_here MCP_SERVER_URL=http://localhost:5100/mcp
-
Start Document Engine MCP Server: From the main project directory:
pnpm build && MCP_TRANSPORT=http pnpm start -
Run the example:
pnpm start
The system will automatically:
- Load all PDFs from
../../langgraphjs/assets/procurement/pdfs/ - Upload them to Document Engine
- Classify each document using AI
- Extract structured data (PO numbers, invoice numbers, amounts, etc.)
- Perform 3-way matching to find related documents
- Generate a comprehensive report with insights