# Advanced concepts

In this section you will find concepts that apply to advanced use cases:

### The Toolhouse Agent File (also called th file)

Learn how to use advanced configuration features with the Toolhouse Agent File.

{% content-ref url="advanced-concepts/build-agents-with-the-th-file" %}
[build-agents-with-the-th-file](https://docs.toolhouse.ai/toolhouse/advanced-concepts/build-agents-with-the-th-file)
{% endcontent-ref %}

### Agent preview and testing

Each Toolhouse agent comes with a preview environment that helps you test your changes before publishing it.

{% content-ref url="advanced-concepts/test-agents-before-publishing" %}
[test-agents-before-publishing](https://docs.toolhouse.ai/toolhouse/advanced-concepts/test-agents-before-publishing)
{% endcontent-ref %}

### Publish and run your agents

This guide shows you how to publish your agents. Each agent can be used on its own or integrated into third party platforms.

{% content-ref url="advanced-concepts/publish-and-run-your-agents" %}
[publish-and-run-your-agents](https://docs.toolhouse.ai/toolhouse/advanced-concepts/publish-and-run-your-agents)
{% endcontent-ref %}

### Build stateful agents

Each agent is aware of its past interaction with each one of your users (or with you, if you're the only user of your agent), without the need to integrate databases or memory tools. Learn how to make the most out of this functionality.

{% content-ref url="advanced-concepts/build-stateful-agents" %}
[build-stateful-agents](https://docs.toolhouse.ai/toolhouse/advanced-concepts/build-stateful-agents)
{% endcontent-ref %}

### Bring your Model

Each agent uses the default Toolhouse model. Sometimes you want to switch model, for example if you want to use your own models, or if you need a more powerful model.

{% content-ref url="advanced-concepts/bring-your-model" %}
[bring-your-model](https://docs.toolhouse.ai/toolhouse/advanced-concepts/bring-your-model)
{% endcontent-ref %}

### Managing secrets

In order to use your models, you will need to add API Keys to Toolhouse. This page illustrates how to do it.

{% content-ref url="advanced-concepts/managing-secrets" %}
[managing-secrets](https://docs.toolhouse.ai/toolhouse/advanced-concepts/managing-secrets)
{% endcontent-ref %}

### Bundle MCP servers together

Toolhouse offers a way to group MCP servers together. This is useful to restrict the type of actions your agent can take.

{% content-ref url="advanced-concepts/bundles" %}
[bundles](https://docs.toolhouse.ai/toolhouse/advanced-concepts/bundles)
{% endcontent-ref %}

### Customize agents for your end users

Your agent can understand which user it's talking to. Learn how to configure this behavior.

{% content-ref url="advanced-concepts/using-metadata" %}
[using-metadata](https://docs.toolhouse.ai/toolhouse/advanced-concepts/using-metadata)
{% endcontent-ref %}

### Generate a Vibe Coding Prompt with the Toolhouse CLI

Learn how to use the Toolhouse Command Line Interface (CLI) to create a one-shot prompt for common services like Lovable, v0, or Cursor.

{% content-ref url="advanced-concepts/generate-a-vibe-coding-prompt-with-toolhouse-cli" %}
[generate-a-vibe-coding-prompt-with-toolhouse-cli](https://docs.toolhouse.ai/toolhouse/advanced-concepts/generate-a-vibe-coding-prompt-with-toolhouse-cli)
{% endcontent-ref %}


---

# Agent Instructions: 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:

```
GET https://docs.toolhouse.ai/toolhouse/advanced-concepts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
