View Source Store.Prompt (fnord v0.5.0)

The ask subcommand saves useful prompts to the store. Saved prompts are accompanied by a title and a list of example questions for which the prompt is appropriate.

When a prompt is saved, an embedding is generated from it to make the prompt (and the questions to which it applies) searchable.

Whenever a prompt is modified or refined, the previous version is archived to the prompt's store dir with a version number:

<$STORE>/prompts/<$PROMPT_ID>./v<$VERSION>/

File structure:

$HOME/
  -> .fnord/
    -> prompts/
      -> <$PROMPT_ID>/
        -> v1
          -> title.md
          -> prompt.md
          -> questions.md
          -> embeddings.json
        -> v2
          -> title.md
          -> prompt.md
          -> questions.md
          -> embeddings.json

There are a number of initial prompts that are installed the first time the prompt store is searched. These prompts are defined in data/prompts.yaml. When a new version of fnord is installed, the next time the prompt store is searched, the prompts will be updated to the latest versions. "Default" prompts can be distinguished by using a title slug for its id, rather than a UUID.

Summary

Functions

exists?(prompt)

install_initial_strategies()

list_prompts()

list_versions(prompt)

new()

new(id)

read(prompt)

read(prompt, version)

read_embeddings(prompt)

read_embeddings(prompt, version)

read_prompt(prompt)

read_prompt(prompt, version)

read_questions(prompt)

read_questions(prompt, version)

read_title(prompt)

read_title(prompt, version)

search(query, max_results \\ 10)

version(prompt)

write(prompt, title, prompt_text, questions)