# Spatial AI (base model)

<figure><img src="https://915036663-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvXlc832eiw1OxKuyzy6k%2Fuploads%2FrfgtMWQpLa6Q2TN0FPtI%2FLogo%20Spatial%20AI%20(base%20model).png?alt=media&#x26;token=566ae4b2-3b08-4bd6-a09c-d8aad285543e" alt=""><figcaption></figcaption></figure>

While pre-trained agents provide quick answers to common tasks, Geolava also supports a flexible inference endpoint, allowing you to make unstructured or more advanced spatial queries. Instead of naming a specific pre-trained Agent (e.g., “valuation”), you can ask the system for certain insights or let it reason about combined data in near-real time.

### Overview

* **Prompt-Style Requests**: Submit a freeform query about properties or entire regions.
* **Contextual Awareness**: The system leverages the underlying Spatial Embedding (including multi-sensor imagery, historical data, and location data).
* **Open-Ended Output**: Get a textual or JSON response describing the system’s best inference.

Like with pre-trained Agents, you can:

* **Specify a single property** or
* **Provide city, state, bounding polygon** or
* **Upload your own data** (multiple addresses) and ask a general question covering them all.

### Endpoint

```
POST /v1/spatial-reasoning
```

*(API design still subject to change.)*

#### Example Request

```json
{
  "prompt": "Identify blighted properties in LA with boarded windows or doors but high sales potential"
}
```

#### Example Response

```json
{
  "insight": "Found 12 candidate properties in Los Angeles that match the description. Four are near downtown with boarded windows, yet valuations are trending upward in these neighborhoods.",
  "matched_properties": [
    {
      "propertyId": "67a771e11bcf52fcce866d6a",
      "attributes_detected": ["boarded windows"],
      "estimated_value": 310000,
      "confidence": 0.82
    },
    {
      "propertyId": "67a771e11bcf52fcce866d6b",
      "attributes_detected": ["boarded doors, broken fence"],
      "estimated_value": 425000,
      "confidence": 0.79
    }
  ],
  "total_matched": 12,
  "notes": "Neighborhood uptrend suggests strong resale demand despite disrepair."
}
```

### Use Cases

1. **Multi-factor Queries** – E.g., “List properties with severe roof damage but near new developments.”
2. **Regional Summaries** – Provide bounding boxes or city definitions: “In these 5 ZIP codes, show me flood-prone properties with stable valuations.”
3. **Hypothetical Questions** – “If an ADU is added, how does that affect the valuation or compliance status?”
4. **Portfolio/Custom Data** – Upload your data set of addresses, then ask: “Which properties in my dataset have known code violations and might be undervalued?”

### Limits & Best Practices

* **Clarity**: The more specific your prompt, the more targeted the analysis.
* **Rate Limits**: This flexible endpoint can be heavier in compute usage. For large data sets, consider region or file-upload strategies.
* **Confidence Scores**: Because it processes queries in a more open-ended manner, parse the included `confidence` or `confidence_score` to gauge reliability.
