An AI-powered assistant for manufacturing floor workers, built with NestJS, LangChain.js, and Groq.
- Natural language chat with a factory-domain system prompt
- Conversation history support
- Input validation with class-validator
- Clean modular NestJS architecture (ready for LangGraph agents in Phase 2)
- NestJS (TypeScript)
- LangChain.js
- Groq llama-3.3-70b-versatile
- class-validator / class-transformer
- Clone the repo
- Install dependencies:
npm install - Copy
.env.exampleto.envand add your Groq API key - Run:
npm run start:dev
Send a message to factoryiq-agent.
Body:
{
"message": "Machine CNC-04 is showing error E-201",
"history": [
{ "role": "human", "content": "Which line is CNC-04 on?" },
{ "role": "ai", "content": "CNC-04 is on production line 3." }
]
}curl -X POST http://localhost:3000/chat \
-H "Content-Type: application/json" \
-d '{"message": "Machine CNC-04 is showing error E-201, what does that mean?"}'
Response:
{
"reply": "Error E-201 typically indicates a spindle overload...",
"timestamp": "2025-01-01T10:00:00.000Z"
}Returns agent status.