How sathwikgampa/smart-lab-ai- works
SmartLab AI is an offline-first laboratory knowledge and operations assistant. Researchers ask questions or upload documents and images; the interface sends requests to Flask, which retrieves cited SOP evidence or routes work to laboratory services. The product also supports inventory, experiments and review, datasets, collaboration, literature, safety, troubleshooting, simulation, and training. The graph includes documented capabilities whose implementation was not sampled; those links are dashed where source-level wiring was not shown.
Main entry points: engine.py RAG and citations · api.js REST client · services Domain services · analyzer.py Image analysis
Components 22
Researcher interface
- Application shell
frontend/src/App.jsx - Ask SmartLab
frontend/src/views/AskView.jsx - Document library
frontend/src/views/DocumentsView.jsx - Evidence panel
frontend/src/components/EvidencePanel.jsx - REST client
frontend/src/lib/api.js - Lab workspace views
frontend/src/views
Knowledge and evidence
- RAG and citations
backend/app/rag/engine.py - PDF extraction
backend/app/rag/pdf_extractor.py - Text embeddings
backend/app/rag/embeddings.py - Vector index
backend/app/rag/vector_store.py - Safety guardrails
backend/app/guardrails.py - Image analysis
backend/app/vision/analyzer.py - Optional Claude
backend/app/services/llm.py
Lab operations
- Reagent inventory
backend/app/services/inventory.py - Verified troubleshooting
backend/app/services/troubleshooting.py - Domain services
backend/app/services
API and persistence
- Chat and documents API
backend/app/api/chat.py - Document governance API
backend/app/api/documents.py - Unified search API
backend/app/api/search.py - Operations APIs
backend/app/api - SQLite records
backend/app/db.py
Other components
- Researcher
Connections 29
- Researcher → Application shell: uses
README.md - Application shell → Ask SmartLab: routes to
frontend/src/App.jsx - Ask SmartLab → REST client: requests answers
frontend/src/views/AskView.jsx - Document library → REST client: manages documents
frontend/src/views/DocumentsView.jsx - Ask SmartLab → Evidence panel: opens citations
frontend/src/App.jsx - REST client → Chat and documents API: calls chat
- REST client → Document governance API: uploads and queries
- Chat and documents API → RAG and citations: retrieves answers
- Document governance API → RAG and citations: indexes documents
- RAG and citations → PDF extraction: extracts pages
backend/app/rag/engine.py - RAG and citations → Text embeddings: embeds text
backend/app/rag/engine.py - RAG and citations → Vector index: searches index
- RAG and citations → Optional Claude: synthesizes answers
backend/app/rag/engine.py - RAG and citations → Safety guardrails: screens queries
backend/app/rag/engine.py - Image analysis → Safety guardrails: sanitizes output
backend/app/vision/analyzer.py - Image analysis → RAG and citations: retrieves SOPs
backend/app/vision/analyzer.py - Image analysis → Optional Claude: describes images
backend/app/vision/analyzer.py - Researcher → Lab workspace views: uses workspace
README.md - Lab workspace views → REST client: sends operations requests
frontend/src/views/LiteratureView.jsx - REST client → Operations APIs: calls domain APIs
- Operations APIs → Domain services: dispatches operations
backend/app/api/search.py - Unified search API → RAG and citations: retrieves documents
backend/app/api/search.py - Unified search API → Reagent inventory: searches reagents
backend/app/api/search.py - Unified search API → Verified troubleshooting: matches fixes
backend/app/api/search.py - Domain services → Reagent inventory: includes inventory
- Domain services → Verified troubleshooting: includes fixes
- RAG and citations → SQLite records: reads document chunks
- Reagent inventory → SQLite records: reads and writes stock
backend/app/services/inventory.py - Domain services → SQLite records: persists workspace data
backend/app/services/inventory.py