How dhruvisherathiya/nl-query-filter-agent works
This is a FastAPI service that turns natural-language requests into Pinecone-compatible metadata-filter JSON; it does not execute Pinecone searches. The main workflow runs from a user request through the API to the parsing agent, which builds a few-shot prompt, calls the configured OpenRouter model, and parses its JSON response. A separate evaluation workflow loads synthetic cases and invokes the same agent to score predictions; the API exposes both workflows. Relationships reflect the shown calls and README description; the model provider is documented, but no Pinecone integration is shown.
Main entry points: agent.py Query parser · main.py FastAPI endpoints · eval_pipeline.py Evaluation pipeline · prompt.py Few-shot prompt
Components 8
HTTP API
- FastAPI endpoints
app/main.py
Filter Generation
- Query parser
app/agent.py - Few-shot prompt
app/prompt.py - LLM client config
app/client.py
Evaluation
- Evaluation pipeline
app/eval_pipeline.py - Synthetic evaluation data
app/data/synthetic_eval_data.json
Other components
- User
- OpenRouter model
Connections 9
- User → FastAPI endpoints: submits query
README.md - FastAPI endpoints → Query parser: parses filter
app/main.py - Query parser → Few-shot prompt: builds prompt
app/agent.py - Query parser → LLM client config: uses client
app/agent.py - Query parser → OpenRouter model: requests JSON
app/agent.py - FastAPI endpoints → User: returns response
app/main.py - FastAPI endpoints → Evaluation pipeline: runs evaluation
app/main.py - Evaluation pipeline → Synthetic evaluation data: loads cases
app/eval_pipeline.py - Evaluation pipeline → Query parser: scores predictions
app/eval_pipeline.py