AI-first maintenance management guide and training platform for industrial maintenance teams. The app uses a dark, minimal Next.js interface, Appwrite as the knowledge store, and MiniMax as the agent LLM.
- Lets users ask maintenance management questions in Turkish.
- Runs a selectable multi-agent workflow:
CORE: strategy, BCM, RCM, criticality and reliability decisionsFIELD: preventive, predictive and autonomous maintenance proceduresFLOW: work orders, scheduling, backlog and resource flowBASE: equipment hierarchy, minifiles and documentation structureKPI: OEE, MTBF, MTTR and Wrench Time analysis
- Reads reference PDF/EPUB material from Appwrite collections.
- Skips agents that are not relevant to the selected question.
- Avoids showing source/citation details in user-facing answers.
- Converts
[Diyagram Onerisi: ...]tags into diagram suggestion cards.
- Next.js App Router
- React
- Tailwind CSS
- Appwrite database
- MiniMax chat completions API
- Tavily web search fallback
- PDF/EPUB indexing scripts
app/
api/ask/route.ts API route for the agent workflow
components/
maintenance-console.tsx Main application screen
agent-node.tsx Agent status/timeline node
agent-response-card.tsx Agent answer card
lib/
agents/ Agent profiles, orchestration and MiniMax adapter
appwrite/ Appwrite server client and repositories
knowledge/ Local fallback reference corpus and retrieval
models/ Shared TypeScript domain models
scripts/
setup-appwrite.mjs Creates Appwrite database collections/attributes
index-reference-docs.mjs Indexes PDF/EPUB files into Appwrite
public/reference-docs/ Local source folder for reference files
database/
appwrite-collections.md Appwrite collection design
Create .env.local in the project root:
MINIMAX_API_KEY=
MINIMAX_API_URL=https://api.minimaxi.chat/v1/chat/completions
MINIMAX_MODEL=MiniMax-M3
TAVILY_API_KEY=
TAVILY_API_URL=https://api.tavily.com/search
APPWRITE_ENDPOINT=
APPWRITE_PROJECT_ID=
APPWRITE_API_KEY=
APPWRITE_DATABASE_ID=bakim_rehber
APPWRITE_REFERENCE_DOCUMENTS_COLLECTION_ID=reference_documents
APPWRITE_REFERENCE_CHUNKS_COLLECTION_ID=reference_chunks
APPWRITE_EQUIPMENT_NODES_COLLECTION_ID=equipment_nodes
APPWRITE_WORK_ORDER_TEMPLATES_COLLECTION_ID=work_order_templates
APPWRITE_KPI_DEFINITIONS_COLLECTION_ID=kpi_definitionsDo not commit .env.local.
npm install
npm run appwrite:setup
npm run appwrite:index
npm run devOpen:
http://localhost:3000
Place PDF/EPUB files in:
public/reference-docs/
Then run:
npm run appwrite:indexThe indexer:
- stores metadata in
reference_documents - stores text chunks in
reference_chunks - skips already indexed files by checksum
- skips unsupported files such as
.xlsand.xlsx
Run:
npm run appwrite:setupThis creates the Appwrite database and collections if they do not already exist. It is intended to be idempotent.
npm run typecheck
npm run lint
npm run build- The app is designed as an educational guide and decision-support simulator.
- It should not produce live operational decisions without reviewed source material.
- Agent answers are constrained by indexed reference documents.
- If no relevant local evidence exists and Tavily is configured, the agent can use web fallback evidence.
- Web fallback answers are marked in the UI, but source details are not shown in the answer text.