askme-public/scripts/smoke_test.py
Lukasz Boryn 0e0bae4b9b feat: initial public release of askme
* 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
2026-11-03 17:50:52 +01:00

39 lines
976 B
Python

"""
Smoke test: insert one sentence, query it, verify the full pipeline works.
Run inside the askme container: uv run python scripts/smoke_test.py
"""
import asyncio
import os
from askme.rag import create_rag, make_query_param
TEXT = (
"Scanpy is a scalable toolkit for analyzing single-cell gene expression data. "
"It includes preprocessing, visualization, clustering, and trajectory inference."
)
QUERY = "What is scanpy used for?"
async def main() -> None:
os.makedirs("/usr/askme/data/rag_storage", exist_ok=True)
print("Initializing LightRAG...")
rag = create_rag()
await rag.initialize_storages()
print("Inserting test document...")
await rag.ainsert(TEXT)
print(f"\nQuerying: {QUERY!r}\n")
response = await rag.aquery(QUERY, param=make_query_param(mode="hybrid"))
print("Response:", response)
await rag.finalize_storages()
print("\nSmoke test passed.")
if __name__ == "__main__":
asyncio.run(main())