> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-devupd-1765394015-eccef47.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a prompt

Navigate to the  in the left-hand sidebar or from the application homepage.

<img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/PGZDvYAdq8T-Gs5W/langsmith/images/empty-playground.png?fit=max&auto=format&n=PGZDvYAdq8T-Gs5W&q=85&s=f550fb3a3dc2f602da4f8802aef20400" alt="" width="1747" height="1285" data-path="langsmith/images/empty-playground.png" />

## Compose your prompt

On the left is an editable view of the prompt.

The prompt is made up of messages, each of which has a "role" - including `system`, `human`, and `ai`.

### Template format

The default template format is `f-string`, but you can change the prompt template format to `mustache` by clicking on the settings icon next to the model -> prompt format -> template format. Learn more about template formats [here](/langsmith/prompt-engineering-concepts#f-string-vs-mustache).

<img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/FNADNW8xifwNBmxK/langsmith/images/template-format.png?fit=max&auto=format&n=FNADNW8xifwNBmxK&q=85&s=a45b419cee3a9ddd4474d4e837de5b13" alt="" width="938" height="352" data-path="langsmith/images/template-format.png" />

### Add a template variable

The power of prompts comes from the ability to use variables in your prompt. You can use variables to add dynamic content to your prompt. Add a template variable in one of two ways:

1. Add `{{variable_name}}` to your prompt (with one curly brace on each side for `f-string` and two for `mustache`). <img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/NrriGHochpjpI5PZ/langsmith/images/prompt-with-variable.png?fit=max&auto=format&n=NrriGHochpjpI5PZ&q=85&s=d0c935958253ab7015588685cc89b58f" alt="" width="726" height="169" data-path="langsmith/images/prompt-with-variable.png" />

2. Highlight text you want to templatize and click the tooltip button that shows up. Enter a name for your variable, and convert. <img src="https://mintlify.s3.us-west-1.amazonaws.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/langsmith/images/convert-to-variable.gif" alt="" />

When we add a variable, we see a place to enter sample inputs for our prompt variables. Fill these in with values to test the prompt. <img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/NrriGHochpjpI5PZ/langsmith/images/prompt-inputs.png?fit=max&auto=format&n=NrriGHochpjpI5PZ&q=85&s=881f1311c7ffe509ba6c96b8bcbf02f8" alt="" width="775" height="134" data-path="langsmith/images/prompt-inputs.png" />

### Structured output

Adding an output schema to your prompt will get output in a structured format. Learn more about structured output [here](/langsmith/prompt-engineering-concepts#structured-output). <img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/FNADNW8xifwNBmxK/langsmith/images/structured-output.png?fit=max&auto=format&n=FNADNW8xifwNBmxK&q=85&s=99a16f3733913057dbf50b825aee735c" alt="" width="814" height="574" data-path="langsmith/images/structured-output.png" />

### Tools

You can also add a tool by clicking the `+ Tool` button at the bottom of the prompt editor. See [here](/langsmith/use-tools) for more information on how to use tools.

## Run the prompt

Click "Start" to run the prompt.

<img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/pC7uS4KE47pwF6As/langsmith/images/create-a-prompt-run.png?fit=max&auto=format&n=pC7uS4KE47pwF6As&q=85&s=12054c5b7c001ca6dace8214abca9b28" alt="" width="1525" height="766" data-path="langsmith/images/create-a-prompt-run.png" />

## Save your prompt

To save your prompt, click the "Save" button, name your prompt, and decide if you want it to be "private" or "public". Private prompts are only visible to your workspace, while public prompts are discoverable to anyone.

The model and configuration you select in the Playground settings will be saved with the prompt. When you reopen the prompt, the model and configuration will automatically load from the saved version. <img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/NrriGHochpjpI5PZ/langsmith/images/save-prompt.png?fit=max&auto=format&n=NrriGHochpjpI5PZ&q=85&s=18113142ccb0c18996903e5cfec12059" alt="" width="465" height="306" data-path="langsmith/images/save-prompt.png" />

<Check>
  The first time you create a public prompt, you'll be asked to set a LangChain Hub handle. All your public prompts will be linked to this handle. In a shared workspace, this handle will be set for the whole workspace.
</Check>

<img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/NrriGHochpjpI5PZ/langsmith/images/public-handle.png?fit=max&auto=format&n=NrriGHochpjpI5PZ&q=85&s=f5f3c8b1599536735b3f19e59566322a" alt="" width="575" height="357" data-path="langsmith/images/public-handle.png" />

## View your prompts

You've just created your first prompt! View a table of your prompts in the prompts tab.

<img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/NrriGHochpjpI5PZ/langsmith/images/prompt-table.png?fit=max&auto=format&n=NrriGHochpjpI5PZ&q=85&s=27e17b45e671f9f5d4d281d6ce8497dc" alt="" width="1508" height="309" data-path="langsmith/images/prompt-table.png" />

## Add metadata

To add metadata to your prompt, click the prompt and then click the "Edit" pencil icon next to the name. This brings you to where you can add additional information about the prompt, including a description, a README, and use cases. For public prompts this information will be visible to anyone who views your prompt in the LangChain Hub.

<img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/EMkNhAapAzVJOXkG/langsmith/images/pencil.png?fit=max&auto=format&n=EMkNhAapAzVJOXkG&q=85&s=2514f40168f4d9ff08c07b3704b315b3" alt="" width="1167" height="1067" data-path="langsmith/images/pencil.png" />

<img src="https://mintcdn.com/langchain-5e9cc07a-preview-devupd-1765394015-eccef47/PGZDvYAdq8T-Gs5W/langsmith/images/edit-prompt.png?fit=max&auto=format&n=PGZDvYAdq8T-Gs5W&q=85&s=763b26c57f61397d4deabfdd8d618181" alt="" width="1508" height="1084" data-path="langsmith/images/edit-prompt.png" />

# Next steps

Now that you've created a prompt, you can use it in your application code. See [how to pull a prompt programmatically](/langsmith/manage-prompts-programmatically#pull-a-prompt).

***

<Callout icon="pen-to-square" iconType="regular">
  [Edit the source of this page on GitHub.](https://github.com/langchain-ai/docs/edit/main/src/langsmith/create-a-prompt.mdx)
</Callout>

<Tip icon="terminal" iconType="regular">
  [Connect these docs programmatically](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
</Tip>
