A command-line assistant to query structured data from Labguru, using a combination of LLM-based natural language parsing and structured data retrieval.
This chatbot allows users to:
- Count or list cases, specimens, organoids, xenografts, assays, and various omics data (WES, WGS, RNA-seq, ATAC, etc.)
- Use natural language queries like:
how many specimenslist organoids starting with CSChow many WESlist patients that name starts with BPTO
- Parse queries using LLaMA 3 for intent and filter extraction, then execute structured lookups via Python backend.
.
├── chatbot/
│ ├── __init__.py
│ ├── labguru_api.py # Core functions to retrieve structured Labguru data
│ ├── nlu_llm.py # LLM-based intent + filter parsing (via LLaMA3)
├── interface/
│ ├── cli.py # CLI interface for the chatbot
├── pixi.toml # Pixi environment and dependencies
├── README.md-
Install Pixi (if not already)
-
Run the chatbot
pixi run chat
- Try some example prompts:
how many specimens
list organoids name starts with CSC
list patients that name contains PHLC
- LLaMA3 — for lightweight intent parsing
- Structured retrieval — deterministic querying of structured Labguru metadata
- Pixi — reproducible Python environment
All dependencies are managed via pixi.toml. Notable one include:
- python-dotenv (database API configuration)
A typical parsed LLM response looks like:
{
"intent": "list_organoids",
"filters": {
"organoids_name_startswith": "CSC"
}
}
- ✅ Count and list commands for structured entities
- ✅ Case-insensitive and typo-tolerant alias resolution (organlids → organoids)
- ✅ Natural language understanding using LLMs
- ✅ CLI interface for offline use
- integrate Q & A base LLM agent (langchain)
- integrate Knowledge graph based LLM agent (langchain)
- Add RAG-based querying for unstructured text (path reports, notes)
- Web UI
- Authentication and multi-user support
Guanqiao Feng
MIT License