diff --git a/app/pkg/config/config.go b/app/pkg/config/config.go index 1cf4a2c7..63ebee5d 100644 --- a/app/pkg/config/config.go +++ b/app/pkg/config/config.go @@ -38,6 +38,8 @@ const ( // https://github.com/stateful/vscode-runme/blob/f1cc965ab0c4cdffa9adb70922e2da792d7e23de/package.json#L849 // The value isn't 8080 because 8080 is over used and likely to conflict with other locally running services. defaultHTTPPort = 8877 + + defaultRagEnabled = true ) // Config represents the persistent configuration data for Foyle. @@ -463,6 +465,8 @@ func setServerDefaults() { func setAgentDefaults() { viper.SetDefault("agent.model", DefaultModel) + viper.SetDefault("agent.rag.enabled", defaultRagEnabled) + viper.SetDefault("agent.rag.maxResults", defaultMaxResults) } func DefaultConfigFile() string { diff --git a/docs/content/en/docs/learning/_index.md b/docs/content/en/docs/learning/_index.md index 60aabd13..1b7280c6 100644 --- a/docs/content/en/docs/learning/_index.md +++ b/docs/content/en/docs/learning/_index.md @@ -3,84 +3,3 @@ title: "Learning" description: "How to use Foyle to learn from human feedback" weight: 2 --- - -## What You'll Learn - -How to configure Foyle to continually learn from human feedback - -## Configure Foyle to use RAG - -To configure Foyle to use RAG - -``` -foyle config set agent.rag.enabled=true -foyle config set agent.rag.maxResults=3 -``` - -## Enabling Logging In RunMe - -If you are using [RunMe.dev](https://runme.dev/) as the frontend for Foyle -then you need to configure RunMe to enable the AI logging experiment - -1. Inside vscode open the settings panel -2. Enable the option `Runme › Experiments: Ai Logs` - -Now that logging is enabled. You can verify that the logs are being written and identify the location -of the logs. - -Inside VSCode open an output window and select the **RunMe** output channel. -Scroll to the top of the messages and look for a `Logger initialized` message like the one below - -``` -[2024-05-28T22:12:20.681Z] INFO Runme(RunmeServer): {"level":"info","ts":1716934340.6789708,"caller":"cmd/common.go:190","msg":"Logger initialized","devMode":false,"aiLogs":true,"aiLogFile":"/Users/jlewi/Library/Application Support/runme/logs/logs.2024-05-28T15:12:20.json"} -``` - -The field `aiLogs` will contain the file that the current instance of RunMe is using for the JSON logs. - -By default, on MacOs RunMe will use the directory - -```bash -/Users/${USER}/Library/Application Support/runme/logs/ -``` - -## Configuring Learning - -If you are using [RunMe.dev](https://runme.dev/) as the frontend for Foyle -then you need to configure Foyle with the location of the **directory** of RunMe's logs. -Refer to the previous section for instructions on how to locate the file -where `RunMe` is writing the logs. Then remove the filename to get the directory -where the logs are being written. - -Once you know the directory run the following command to configure Foyle to use that -directory - -```bash -foyle config set learner.logDirs=${RUNME_LOGS_DIR} -``` - -## Sharing Learned Examples - -In a team setting, you should build a shared AI that learns from the feedback of all team members and assists -all members. To do this you can configure Foyle to write and read examples from a shared location like GCS. -If you'd like S3 support please vote up [issue #153](https://github.com/jlewi/foyle/issues/153). - -To configure Foyle to use a shared location for learned examples - -1. Create a GCS bucket to store the learned examples - - ```bash - gsutil mb gs://my-foyle-examples - ``` - -1. Configure Foyle to use the GCS bucket - - ```bash - foyle config set learner.exampleDirs=gs://${YOUR_BUCKET} - ``` - -Optionally you can configure Foyle to use a local location as well if you want to be able to use the AI without -an internet connection. - -```bash -foyle config set learner.exampleDirs=gs://${YOUR_BUCKET},/local/training/examples -``` diff --git a/docs/content/en/docs/learning/configuring.md b/docs/content/en/docs/learning/configuring.md new file mode 100644 index 00000000..9aebd3c2 --- /dev/null +++ b/docs/content/en/docs/learning/configuring.md @@ -0,0 +1,66 @@ +--- +title: "Configuring" +description: "Configuring Learning In Foyle" +weight: 1 +--- + +## What You'll Learn + +How to configure Learning in Foyle to continually learn from human feedback + +## How It Works + +* As you use Foyle, the AI builds a dataset of examples (input, output) +* The input is a notebook at some point in time , `t` +* The output is one more or cells that were then added to the notebook at time `t+1` +* Foyle uses these examples to get better at suggesting cells to insert into the notebook + +## Configuring RAG + +Foyle uses RAG to improve its predictions using its existing dataset of examples. You can control +the number of RAG results used by Foyle by setting `agent.rag.maxResults`. + +``` +foyle config set agent.rag.maxResults=3 +``` + +## Disabling RAG + +RAG is enabled by default. To disable it run + +``` +foyle config set agent.rag.enabled=false +``` + +To check the status of RAG get the current configuration + +``` +foyle config get +``` + +## Sharing Learned Examples + +In a team setting, you should build a shared AI that learns from the feedback of all team members and assists +all members. To do this you can configure Foyle to write and read examples from a shared location like GCS. +If you'd like S3 support please vote up [issue #153](https://github.com/jlewi/foyle/issues/153). + +To configure Foyle to use a shared location for learned examples + +1. Create a GCS bucket to store the learned examples + + ```bash + gsutil mb gs://my-foyle-examples + ``` + +1. Configure Foyle to use the GCS bucket + + ```bash + foyle config set learner.exampleDirs=gs://${YOUR_BUCKET} + ``` + +Optionally you can configure Foyle to use a local location as well if you want to be able to use the AI without +an internet connection. + +```bash +foyle config set learner.exampleDirs=gs://${YOUR_BUCKET},/local/training/examples +``` diff --git a/docs/content/en/docs/learning/troubleshoot_learning.md b/docs/content/en/docs/learning/troubleshoot_learning.md index 3742197d..f6f85d51 100644 --- a/docs/content/en/docs/learning/troubleshoot_learning.md +++ b/docs/content/en/docs/learning/troubleshoot_learning.md @@ -1,7 +1,7 @@ --- title: "Troubleshoot Learning" description: "How to troubleshoot and monitor learning" -weight: 1 +weight: 2 --- ## What You'll Learn diff --git a/docs/hugo.toml b/docs/hugo.toml index b1130848..5f441495 100644 --- a/docs/hugo.toml +++ b/docs/hugo.toml @@ -146,7 +146,7 @@ navbar_logo = true # Set to true if you don't want the top navbar to be translucent when over a `block/cover`, like on the homepage. navbar_translucent_over_cover_disable = false # Enable to show the side bar menu in its compact state. -sidebar_menu_compact = false +sidebar_menu_compact = true # Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled) sidebar_search_disable = false