AppMap Navie AI

Advanced Navie Commands

You can ask free-form questions, or start your question with one of these commands:

@explain

The @explain command prefix within Navie serves as a default option focused on helping you learn more about your project. Using the @explain prefix will focus the Navie AI response to be more explanatory and will dive into architectural level questions across your entire code base. You can also use this to ask for ways to improve the performance of a feature as well.

Examples

  • @explain how does user authentication work in this project?
  • @explain how is the export request for physical flows handled, and what are the tables involved?
  • @explain how does the products listing page works and how can I improve the performance?

@help

Navie will help you setup AppMap, including generating AppMap recordings and diagrams. This prefix will focus the Navie AI response to be more specific towards help with using AppMap products and features. This will leverage the AppMap documentation as part of the context related to your question and provide guidance for using AppMap features or diving into advanced AppMap topics.

Examples

  • @help how do I setup process recording for my node.js project?
  • @help how can I reduce the size of my large AppMap Data recordings?
  • @help how can i export my AppMap data to atlassian confluence?

@generate

The @generate prefix will focus the Navie AI response to optimize for new code creation. This is useful when you want the Navie AI to respond with code implementations across your entire code base. This is useful for both creation of new code as well as creation of test cases.

Examples

  • @generate Using the django-simple-captcha library add the necessary code for an offline captcha to my new user registration page.
  • @generate Update the function for the physical flow export to include data type via physical_spec_data_type and physical_specification tables without changing the existing functionality.
  • @generate Design and implement a cache key for user posts and show me how to implement it within this code base

Bring Your Own Model Examples

OpenAI

Note: We recommend configuring your OpenAI key using the code editor extension. Follow the Bring Your Own Key docs for instructions.

Only OPENAI_API_KEY needs to be set, other settings can stay default:

OPENAI_API_KEY sk-9spQsnE3X7myFHnjgNKKgIcGAdaIG78I3HZB4DFDWQGM

When using your own OpenAI API key, you can also modify the OpenAI model for Navie to use. For example if you wanted to use gpt-3.5 or use an preview model like gpt-4-vision-preview.

APPMAP_NAVIE_MODEL gpt-4-vision-preview

Azure OpenAI

Assuming you created a navie GPT-4 deployment on contoso.openai.azure.com OpenAI instance:

AZURE_OPENAI_API_KEY e50edc22e83f01802893d654c4268c4f
AZURE_OPENAI_API_VERSION 2024-02-01
AZURE_OPENAI_API_INSTANCE_NAME contoso
AZURE_OPENAI_API_DEPLOYMENT_NAME navie

AnyScale Endpoints

AnyScale Endpoints allows querying a selection of open-source LLMs. After you create an account you can use it by setting:

OPENAI_API_KEY esecret_myxfwgl1iinbz9q5hkexemk8f4xhcou8
OPENAI_BASE_URL https://api.endpoints.anyscale.com/v1
APPMAP_NAVIE_MODEL mistralai/Mixtral-8x7B-Instruct-v0.1

Consult AnyScale documentation for model names. Note we recommend using Mixtral models with Navie.

Ollama

You can use Ollama to run Navie with local models; after you’ve successfully ran a model with ollama run command, you can configure Navie to use it:

OPENAI_API_KEY dummy
OPENAI_BASE_URL http://127.0.0.1:11434/v1
APPMAP_NAVIE_MODEL mixtral

Note: Even though it’s running locally a dummy placeholder API key is still required.

LM Studio

You can use LM Studio to run Navie with local models.

After downloading a model to run, select the option to run a local server.

In the next window, select which model you want to load into the local inference server.

After loading your model, you can confirm it’s successfully running in the logs.

NOTE: Save the URL it’s running under to use for OPENAI_BASE_URL environment variable.

For example: http://localhost:1234/v1

In the Model Inspector copy the name of the model and use this for the APPMAP_NAVIE_MODEL environment variable.

For example: Meta-Llama-3-8B-Instruct-imatrix

Continue to configure your local environment with the following environment variables based on your LM Studio configuration. Refer to the documentation above for steps specific to your code editor.

OPENAI_API_KEY dummy
OPENAI_BASE_URL http://localhost:1234/v1
APPMAP_NAVIE_MODEL Meta-Llama-3-8B-Instruct-imatrix

Note: Even though it’s running locally a dummy placeholder API key is still required.

OpenAI Key Management in VS Code

Add a new OpenAI Key in VS Code

The standard way to add an OpenAI API key in VS Code is to use the gear icon in the Navie chat window, but you can alternatively set the key using the VS Code Command Palette with an AppMap command option.

In VS Code, open the Command Palette.

You can use a hotkey to open the VS Code Command Palette

  • Mac: Cmd + Shift + P
  • Windows/Linux: Ctrl + Shift + P

Or you can select View -> Command Palette

Search for AppMap Set OpenAPI Key

Paste your key into the new field and hit enter.

You’ll get a notification in VS Code that your key is set.

NOTE: You will need to reload your window for the setting to take effect. Use the Command Palette Developer: Reload Window

Delete a configured OpenAI Key

To delete your key, simply open the Command Palette

You can use a hotkey to open

  • Mac: Cmd + Shift + P
  • Windows/Linux: Ctrl + Shift + P

Or you can select View -> Command Palette

Search for AppMap Set OpenAPI Key

And simply hit enter with the field blank. VS Code will notify you that the key has been unset.

NOTE: You will need to reload your window for the setting to take effect. Use the Command Palette Developer: Reload Window

How is my API key saved securely?

For secure storage of API key secrets within AppMap, we use the default VS Code secret storage which leverages Electron’s safeStorage API to ensure the confidentiality of sensitive information. Upon encryption, secrets are stored within the user data directory in a SQLite database, alongside other VS Code state information. This encryption process involves generating a unique encryption key, which, on macOS, is securely stored within Keychain Access under “Code Safe Storage” or “Code - Insiders Safe Storage,” depending on the version. This method provides a robust layer of protection, preventing unauthorized access by other applications or users with full disk access. The safeStorage API, accessible in the main process, supports operations such as checking encryption availability, encrypting and decrypting strings, and selecting storage backends on Linux. This approach ensures that your secrets are securely encrypted and stored, safeguarding them from potential threats while maintaining application integrity.

OpenAI Key Management in JetBrains

The standard way to add an OpenAI API key in JetBrains is to use the gear icon in the Navie chat window, but you can alternatively set the key directly in the JetBrains settings.

Adding or Modifying OpenAI API Key in JetBrains

In JetBrains, open the Settings option.

Open View in VS Code

In the Settings window, search for appmap in the search bar on the side. Under the Tools -> AppMap you will see a configuration option for your OpenAI API Key in the AppMap Services section. This is the same section you are able to add/edit/modify your other environment settings for using your own custom models.

Open View in VS Code

How is my API key saved securely?

AppMap follows JetBrains best practices for the storing of sensitive data. The AppMap JetBrains plugin uses the PasswordSafe package to securely persist your OpenAI API key. The default storage format for PasswordSafe is operating system dependent. Refer to the JetBrains Developer Documents for more information.

Accessing Navie Logs

In VS Code

You can access the Navie logs in VS Code by opening the Output tab and selecting AppMap Services from the list of available output logs.

To open the Output window, on the menu bar, choose View > Output, or in Windows press Ctrl+Shift+U or in Mac use Shift+Command+U

Open View in VS Code

Click on the output log dropdown in the right corner to view a list of all the available output logs.

Open Output logs list

Select on the AppMap: Services log to view the logs from Navie.

Select AppMap Services

In JetBrains

You can enable debug logging of Navie in your JetBrains code editor by first opening Help > Diagnostic Tools > Debug Log Settings.

JetBrains Debug Log menu

In the Custom Debug Log Configuration enter appland to enable DEBUG level logging for the AppMap plugin.

JetBrains Debug Log Configuration

Next, open Help > Show Log... will open the IDE log file.

JetBrains Debug Show Log

GitHub Repository

https://github.com/getappmap/appmap


Was this page helpful? thumb_up Yes thumb_down No
Thank you for your feedback!