> For the complete documentation index, see [llms.txt](https://docs.predicthq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.predicthq.com/ai/build-with-ai.md).

# Build with AI

AI assistants can query PredictHQ's APIs in natural language, search the documentation while you code, and follow best practice integration patterns automatically - reducing the time from first API call to a production-ready integration.

These tools serve two distinct jobs: AI that helps you *build* your integration (coding assistants, agent skills), and AI that PredictHQ *grounds*—assistants and agents retrieving verified real-world context at inference time.

## MCP Server

Connect any MCP-compatible AI assistant to PredictHQ's live APIs. Once connected, you can search events, retrieve demand intelligence, work with Saved Locations, Beam, Features, Forecasts, and Predicted Impact Area, and search PredictHQ's technical documentation - all through natural language, without leaving your AI client or writing API calls manually.

Supported clients include Claude, ChatGPT, Claude Code, Cursor, and any other client that supports the Model Context Protocol.

[Set up the MCP Server →](/ai/mcp.md)

## Agent Skills

Agent skills give your AI coding assistant specialised knowledge about how to integrate with PredictHQ correctly - the recommended workflow, API selection guidance, Beam best practices, and common mistakes to avoid. Once installed, the skill is applied automatically when you work on PredictHQ integrations.

```bash
npx skills add predicthq/agent-skills
```

[Set up agent skills →](/ai/agent-skills.md)

## Plain Text Docs

Every page in PredictHQ's documentation is available as plain text Markdown - useful for pasting directly into an AI assistant or loading into a coding agent's context.

Add `.md` to the end of any documentation URL to get the plain text version. For example:

```
https://docs.predicthq.com/api/events/search-events.md
```

A full index of all documentation pages is available at [/llms.txt](https://docs.predicthq.com/llms.txt).

## Grounding

New to grounding? [Grounding LLMs in real-world event data (RAG)](/ai/grounding-llms-in-real-world-data.md) covers what grounding is, how it reduces AI hallucinations, and the two architectures - retrieval inside your environment or on demand via MCP.

For the assistant request flow and how the APIs map to scope, relevance, usability, and trust, see [Using PredictHQ with AI assistants](/ai/grounding-llms-in-real-world-data.md#using-predicthq-with-ai-assistants).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.predicthq.com/ai/build-with-ai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
