prompt management - MadBomber/aia GitHub Wiki
Prompt Management
File System Organization
The aia
program makes use of the Ruby gem prompt_manager
to access saved prompts. The file system storage adapter of the prompt manager is used by the 'aia' program. This means that all saved prompts reside in a single directory tree on your file system.
$HOME/.prompts
is the default location for your prompts directory.
You can change this location in two ways.
- the
--prompts_dir path/to/directory
option allows for changing the location from one invokation of AIA to the next. - using the system environment variable (envar)
$AIA_PROMPTS_DIR
When combined with the CLI utility [direnv](/MadBomber/aia/wiki/direnv)
the use of the $AIA_PROMPTS_DIR
becomes very powerful. It allows you to have multiple directories in your file system where each is tied to a different project or context.
The [direnv](/MadBomber/aia/wiki/direnv)
CLI utility allows for the dynamic setting and unsetting of envars depending within which directory tree you are currently working.
Prompt Text File
The prompt is saved within a text file that has the prompt ID as its basename and .txt
as its extensions. If you are working on a MacOS platform you may want to set your Finder
preferences som that the file extensions are visible. From the terminal they should always be visible without the need to set any additional preferences.
The text file can consist of:
- literal prompt text
- comments to document its usage, etc.
- directives to change its configuration environment
- parameters to be replaced by user supplied values
- envars to addition content from the shell
- shell commands to provide dynamic content
- embedded ruby to provide dynamic content and conditional processing
AIA takes all of these things from the prompt text file and generates a plain text prompt to be sent to the LLM for a response.
Prompt JSON File
Each prompt text file that has parameters (aka keywords) will have an associated JSON file that contains prior values entered for each of the parameters in the text file. The aia
programs saves the last 5 values you have used for a parameter with the given prompt. The last value used is considered to be the default value for that parameter.
Whe interacting with the aia
program to provide a value for the prompt's parameter, the prior values you have used are available as history which can be navigated using the up and down arrows. For example if you have a prompt that you use with a parameter of [ROLE]
and have provided several different values for the keyword in the past, those values are available to be quickly selected from the parameters history.