Internal FastAPI service for ingesting unified event and unit data, storing
current state in SQLite and exposing sync endpoints for local instances.
Phase 3 adds:
- Scenario C demo orchestration
- GDDKiA fallback-backed road ingestion
- dispatch and coverage analysis
- AI documentation explorer that turns docs into a declarative ingest spec
- optional startup autoload so a fresh parser can expose a ready
snapshotright after boot
cp .env.example .env
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
uvicorn app.main:app --reloadcp .env.example .env
docker compose up --buildPOST /v1/ingest/eventsPOST /v1/ingest/unitsPOST /v1/ingest/mock-loadPOST /v1/ingest/jsonPOST /v1/ingest/radioPOST /v1/ingest/crawlPOST /v1/ingest/gddkiaPOST /v1/demo/bootstrapPOST /v1/demo/replay/nextPOST /v1/analysis/dispatchGET /v1/analysis/coveragePOST /v1/adapters/exploreGET /v1/adapters/explore/{exploration_id}POST /v1/adapters/explore/{exploration_id}/dry-runPOST /v1/adapters/explore/{exploration_id}/ingestGET /v1/eventsGET /v1/unitsGET /v1/snapshotGET /v1/feed/changesGET /v1/geo/eventsGET /v1/geo/unitsGET /v1/schemaGET /v1/health
ELEVENLABS_API_KEYOPENAI_API_KEYLLM_PROVIDERRADIO_DEFAULT_SOURCECRAWLER_GIOS_ENABLEDOSRM_BASE_URLEXPLORER_REQUEST_TIMEOUT_SECONDSEXPLORER_CACHED_DOCS_ENABLEDDEMO_UNITS_PATHDEMO_HOTSPOTS_PATHDEMO_GDDKIA_CACHE_PATHDEMO_DOCS_DIRAUTO_BOOTSTRAP_ON_STARTAUTO_REFRESH_GDDKIA_ON_STARTAUTO_EXPLORE_GIOS_ON_STARTSTARTUP_SKIP_IF_DATA_EXISTSGDDKIA_REFRESH_ENABLEDGDDKIA_REFRESH_INTERVAL_SECONDS
On a fresh SQLite database, the parser can now preload demo-ready data during startup:
- demo bootstrap seeds PSP/OSP units and hotspot data
- GDDKiA cache/live ingest runs once on startup
- optional recurring GDDKiA refresh can be enabled
- optional auto-explore of GIOŚ can be enabled, but is off by default
Recommended defaults for local demo are already included in .env.example.
Important:
- if the database already contains data and
STARTUP_SKIP_IF_DATA_EXISTS=true, startup autoload will not re-seed - if you want a fully fresh auto-seeded instance, point
DATABASE_PATHat a new empty file
Bootstrap + replay:
python scripts/rehearse_scenario_c.py --base-url http://127.0.0.1:8100Explorer-only flow:
python scripts/demo_explorer.py --base-url http://127.0.0.1:8100Force real LLM analysis through HTTP instead of demo heuristics:
curl -X POST http://127.0.0.1:8100/v1/adapters/explore \
-H 'Content-Type: application/json' \
-d '{
"source_name":"live ai gios",
"source_id":"live_ai_gios",
"docs_type":"url",
"docs_url":"https://powietrze.gios.gov.pl/pjp/content/api",
"api_base_url":"https://api.gios.gov.pl/pjp-api/v1/rest",
"prefer_cached_docs": false,
"force_llm": true
}'pytest -q