POST /queries-> accepts a natural language query, uses an LLM to extract structured intelligence (domain, geography, entity types, intent, filters), persists it in memory and returns the full recordGET /queries/{id}-> retrieves a stored query record by ID- Added a minimal HTML interface to submit queries and view extracted output
I used Ollama cloud free (gemma3:27b model) via its OpenAI compatible instead of the Anthropic SDK
as currently I don't have Anthropic API key.
python -m env env-> create virtual environmentsource venv/bin/activate-> activate virtual environmentpip install -r requirements.txt-> install all the requirements- Copy
.env.exampleto.envand fill in your Ollama credentials uvicorn main:app --reload --env-file .env-> to load env and run- Open
http://localhost:8000or use the Swagger UI athttp://localhost:8000/docs
Swap the in-memory dict for SQLite so query records persist across server restarts.

