> ## Documentation Index
> Fetch the complete documentation index at: https://prompt-lockbox.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Features

> Learn about the intelligent features built into this toolkit. 

<Note>
  LLM configuration is required before using any AI feature. Check the guide at [Configure LLMs](/configure_llms).
</Note>

<Tip>
  You can suggest us more AI features at [feature request](/how_to_contribute). We would love to get feedbacks !
</Tip>

Prompt Lockbox isn't just a management tool; **it's an intelligent toolkit** designed to accelerate your workflow. By **integrating powerful language models** with the toolkit, it automates the most tedious parts of prompt engineering, allowing you to focus on creating brilliant prompts.

The toolkit supports LLMs from various providers like `OpenAI`, `Anthropic`, `Mistral` etc. It also support `local models` that runs completely offline or you can just [use your own custom llm model](/configure_llms#advanced%3A-using-a-custom-or-self-hosted-model).

**Supported LLMs**

<Info>
  The app uses LiteLLM for LLM integration. You can check the complete list of models at [litellm models](https://docs.litellm.ai/docs/providers).
</Info>

Let's explore some intelligent features the toolkit provides !

## Features

<Tip>
  Prompt Lockbox is fully open-source — you're welcome to suggest features or contribute directly at [Prompt Lockbox Repo](https://github.com/ananya868/prompt-lockbox/). Get started in just 5 minutes by checking out the [Contribution guide](/how_to_contribute)!
</Tip>

Here are the key AI features that makes this toolkit awesome.

<Card title="Automatic Documentation">
  Reads your prompt's template, understands its purpose, and automatically writes a concise description and a list of relevant search tags directly into your .yml file—all while preserving your file's original comments and layout.

  <br />

  <Accordion title="See in action" icon="stars">
    Lets say you have a prompt 'sql-generator' with your prompt template written.

    ```yaml theme={null}
    ...
    # Description and tags are empty
    description: ""
    tags: []
    ...
    ```

    The feature automatically reads the prompt and writes the description and tags for you.

    ```yaml theme={null}
    ...
    description: "Generates a SQL query from a database schema and a natural language question."
    tags: [sql, database, query-generation, text-to-sql]
    ...
    ```
  </Accordion>

  <Accordion title="Usage">
    <Tabs>
      <Tab title="CLI">
        You can use `plb prompt document` command. Lets say we have a prompt template named 'email-agent':

        ```bash theme={null}
        # Apply to a single prompt 
        plb prompt document email-agent 

        # or document all prompts in the project at once
        plb prompt document --all
        ```
      </Tab>

      <Tab title="Python">
        Python code to document the prompts:

        ```python theme={null}
        from prompt_lockbox import Project
        # Load the project
        project = Project()

        # Get the specific prompt you want to document
        prompt = project.get_prompt("email-agent")

        # Document Method will analyze the prompt and save the changes to its file.
        prompt.document()

        # You can also document multiple prompts programmatically
        prompts_to_doc = [
            project.get_prompt("sql-generator"),
            project.get_prompt("email-summarizer")
        ]
        project.document_all(prompts_to_document=prompts_to_doc)
        ```
      </Tab>
    </Tabs>
  </Accordion>
</Card>

<Card title="Prompt Enhancer">
  Acts as an AI expert, providing a critique and a rewritten, more robust version of your prompt to enhance clarity, specificity, and security.

  <br />

  <Accordion title="See in action" icon="stars">
    Lets say you have a prompt 'sql-injection'. We'll use `plb prompt improve` to strengthen the prompt. We'll give it the **note**, "Make it more robust against SQL injection."

    ```yaml theme={null}
    ...
    template: |
        Given the following database schema, write a SQL query that answers the user's question.
        Schema: {{schema_definition}}
        Question: {{user_question}}
    ...
    ```

    It will reads the prompt, enhances its clarity and specificity.

    ```yaml theme={null}
    ...
    template: |
        You are a secure database assistant. Your task is to convert a natural language question into a safe, efficient SQL query for the given schema.
      
        IMPORTANT: Always use parameterized queries or escape inputs to prevent SQL injection.
      
        Schema: {{schema_definition}}
        Question: {{user_question}}
    ...
    ```
  </Accordion>

  <Accordion title="Usage">
    <Tabs>
      <Tab title="CLI">
        You can use `plb prompt improve` command on a prompt. Lets say we have a prompt template named 'sql-injection':

        ```bash theme={null}
        # This will show the diff and ask for confirmation
        plb prompt improve sql-injection  

        # You can pass a note as well 
        plb prompt improve sql-injection --note "Make it more robust"
        ```
      </Tab>

      <Tab title="Python">
        Python code to improve the prompts:

        ```python theme={null}
        from prompt_lockbox import Project

        project = Project()
        prompt = project.get_prompt("sql-generator")

        # 1. Get the AI's suggestions (doesn't change the file)
        critique = prompt.get_critique(note="Make it more robust.")

        # 2. Programmatically review and then apply the changes
        improved_template = critique["improved_template"]
        prompt.improve(improved_template) # Saves changes
        ```
      </Tab>
    </Tabs>
  </Accordion>
</Card>

## Next Steps

Now, you can start the basics guide!

<CardGroup>
  <Card title="Basics" icon="code" href="/guide/first">
    Learn the essentials of this toolkit.
  </Card>
</CardGroup>
