* local question answering over analysis notebooks with LightRAG, Neo4j, Qdrant and Ollama * RAGAS evaluation with a generator x judge comparison matrix, fully local * docs in README and OKF
3.2 KiB
type, purpose, answers, cites
| type | purpose | answers | cites | |||
|---|---|---|---|---|---|---|
| Guide | Give the full command reference for running askme day to day. |
|
|
askme — Usage Guide
LightRAG-powered Q&A over bioinformatics notebooks (scanpy, scRNA-seq, spatial transcriptomics).
Prerequisites
- Docker + Docker Compose
just(command runner)- Sufficient disk for models (~5GB for qwen2.5:7b + nomic-embed-text)
1. Start the stack
just up
This starts Neo4j, Qdrant, Ollama, and the askme API container. Ollama models are pulled automatically on first start.
2. Ingest notebooks
Full ingest
just ingest
Walks data/notebook_archive/, extracts text from .ipynb, .Rmd, .py, and .R files, deduplicates, and inserts into LightRAG. Entity extraction via LLM runs during insert — expect several hours for 700+ files.
just ingest --dry-run # list files that would be ingested without inserting
just ingest my-folder # ingest from data/my-folder/ instead
Incremental ingest (new/changed files only)
just ingest-new
Uses data/ingest_manifest.json to track which files have been ingested. Only processes files that are new or whose content has changed since the last run.
Re-ingesting from scratch
If you need to wipe and start over:
just clean-stores # wipes Neo4j, Qdrant, and LightRAG KV store (keeps Ollama models)
just up
just ingest
3. Query
CLI
just query "What preprocessing steps are used for scRNA-seq data?"
Query modes (default: hybrid):
| Mode | Description |
|---|---|
hybrid |
Combines local and global graph traversal (recommended) |
local |
Answers from local entity neighbourhood |
global |
Answers from high-level graph summaries |
naive |
Direct vector similarity, no graph traversal |
docker compose exec askme uv run askme-query "What is UMAP?" --mode local
API
just serve # starts FastAPI on port 8000 with reload
curl -X POST http://localhost:8000/query \
-H "Content-Type: application/json" \
-d '{"question": "How is cell clustering performed?", "mode": "hybrid"}'
Response:
{
"answer": "...",
"sources": [
{"file": "notebooks/clustering.ipynb", "excerpt": "..."}
]
}
Utility endpoints
curl http://localhost:8000/health # check Neo4j, Qdrant, Ollama reachability
curl http://localhost:8000/collections # chunk, entity, relationship counts in Qdrant
4. Evaluate
just eval
just eval --testset-size 20 --output data/eval_report.json
Generates a synthetic testset from ingested content, queries LightRAG, and scores with RAGAS (faithfulness, answer relevancy, context precision). Results are printed as a table and optionally saved as JSON.
5. Run tests
uv run pytest tests/
uv run pytest tests/ --cov=askme --cov-report=term-missing
6. Teardown
just down # stop all containers (preserves volumes)
just clean-stores # stop + wipe Neo4j, Qdrant, LightRAG KV store
just clean-all # stop + wipe everything including Ollama models