Webapp to help workers debug machine alarms. Key features include:
- Agentic RAG chatbot with:
- Tool to answer machine alarm questions from the internal knowledge base
- Tool to find information from manuals
- Built-in support via agent's pre-trained knowledge for language translation for non-English-speaking worker
- Dashboard for viewing machine alarm statuses, managing knowledge base of machine alarms, and analytics (machine error trends, frequent questions asked, error counts etc)
This project was developed under the course IS483 IS Project Experience.
1-min video demo of key features
Team.28.-.Manual.Whisperer.-.1.Minute.Video.mp4
- SolidJS Tutorial - learn the basics
- SolidJS Docs - official docs
- File-Based Routing - routing docs
- Solid Primitives - helpers
- Solid Query - data fetching and async state management
- Kobalte (Headless UI) - UI components
- Tailwindcss - styling
- Icones - icons, copied to
src/components/icons/*Icon.tsx
- SolidUI - reference reusable components built with Kobalte and Tailwind
- Node.js v20 (use fnm)
- pnpm v9
- VSCode with Prettier, ESLint, and Tailwind CSS IntelliSense extensions
- Docker (for pgvector)
- Copy
.env.example
to.env
and supply the missing values
Once you've created a project and installed dependencies with pnpm install
, start a development server:
pnpm dev
# or start the server and open the app in a new browser tab
pnpm dev -- --open
Run ESLint and Prettier to check and fix.
pnpm lint
Solid apps are built with presets, which optimise your project for deployment to different environments. You specify this in app.config.js
.
We will use the default node
preset.
pnpm build
(Only needs to be done once)
Most manuals are already indexed, so we can use the existing data store in the volume_data.tar
file to transfer into the docker volume. To transfer the existing data store into the docker volume, do the following:
-
Download the
volume_data.tar
file from this dropbox volume_data.tar -
Move the
volume_data.tar
file to the root of this project folder -
Create a new volume called
db_data
docker volume create db_data
- In the project root, run the following to copy the existing data store into the new volume
docker run --rm -v db_data:/volume_data -v $(pwd):/backup busybox sh -c "cd /volume_data && tar xvf /backup/volume_data.tar --strip 1"
- First complete the build step above. It will create a
.output
directory with the compiled files. - (Linux) Copy the
sqlite-vec-linux-x64
folder fromnode_modules
to.output/server/
- (Mac) Copy the
sqlite-vec-darwin-x64
folder fromnode_modules
to.output/server/
- Start the data base container
docker-compose -f docker-compose-db.yml up -d
- Start the production server
pnpm start
# or directly
node .output/server/index.mjs
Migrations are stored in src/db/migrations
.
To create a new migration, run pnpm drizzle-kit generate
.
To apply migrations, run pnpm drizzle-kit migrate
.
To drop migrations, run pnpm drizzle-kit drop
; documentation recommends not deleting files in migrations folder manually, might break drizzle-kit.
Do the following to start off with a new database:
- Run
pnpm drizzle-kit generate
to generate SQL migration script - Run
pnpm drizzle-kit migrate
to apply the migration to create the database tables - Run
npx tsx src/db/scripts/setup.ts
to create the virtual tables and triggers - If alarm embeddings (
data/alarm_embeddings.json
not present) are not created or to be recreated, runnpx tsx src/db/scripts/embed_alarms.ts
to create the embeddings for the alarms - Run
npx tsx src/db/scripts/seed.ts
to seed the database with the initial data
Follow the instructions in src/rag/README.md
.