Fisor Builder is a research/data pipeline module.
It converts open-ended natural language questions into structured datasets by combining:
- Cohere Command R+ → reasoning and sub-query generation
- Perplexity API → real-time search
- Custom validators → structured, validated output
- Iterative query → search → parse loop
- Sub-query generation with Cohere
- Web search integration (Perplexity)
- Structured dataset extraction
- Confidence + dataset validation
- JSON/Redis caching (extensible)
- Prometheus metrics & logger
- Docker + shell deploy scripts
fisor-builder-main/
├── main.py # Entrypoint
├── requirements.txt
├── Dockerfile
├── deploy_fisor_builder.sh
├── app/
│ ├── builder.py # Core orchestration
│ ├── cache_manager.py # Cache (JSON/Redis)
│ ├── cohere_query_gen.py # Generate sub-queries
│ ├── cohere_extractor.py # Extract structured rows
│ ├── confidence_validator.py# Fact-checking / confidence
│ ├── dataset_validator.py # Dataset schema validation
│ ├── perplexity_client.py # Perplexity API client
│ ├── iterative_search.py # Iterative loop logic
│ ├── schemas.py # Pydantic models
│ ├── logger.py # Unified logging
│ ├── metrics.py # Metrics helpers
│ └── metrics_server.py # Prometheus endpoint
The repo includes fisor_cache.example.json as a sample of what the cache output looks like.
The real fisor_cache.json is generated at runtime and should not be committed.
Fisor Builder assumes a default location when none is provided:
# app/config.py
DEFAULT_LOCATION = {
"city": "Toronto",
"country": "CA"
}You can override this default by passing a different location in your query, or by modifying the configuration in config.py
You can change this default location in several ways:
1. Environment variables
Set before running:
export FISOR_DEFAULT_CITY="Ottawa"
export FISOR_DEFAULT_COUNTRY="CA"
python main.py2. CLI flags (if using the Typer CLI)
fisor-builder run "Analyze housing affordability" --city "Ottawa" --country "CA"3. Code
Edit app/config.py or pass a custom location dictionary directly:
custom_location = {"city": "Vancouver", "country": "CA"}
plan = build_search_plan("Housing affordability trends", location=custom_location)MIT – see LICENSE