From 4822ad890d089d8d76624241fb9d1bb0e95ad12f Mon Sep 17 00:00:00 2001
From: Nick Busey <nick@coderabbit.ai>
Date: Tue, 26 Nov 2024 10:03:28 -0700
Subject: [PATCH 1/5] Add more details on how to use on-prem knowledge base

---
 docs/integrations/knowledge-base.md | 18 ++++++++++++++++--
 docs/self-hosted/github.md          |  1 +
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/docs/integrations/knowledge-base.md b/docs/integrations/knowledge-base.md
index a749bbe..7faecab 100644
--- a/docs/integrations/knowledge-base.md
+++ b/docs/integrations/knowledge-base.md
@@ -47,10 +47,24 @@ For example you can add a comment in a PR to chat directly with CodeRabbit. `@co
 
 Or you can comment directly on some lines of code in the PR. `@coderabbitai do not complain about lack of error handling here, it is handled higher up the execution stack.`
 
-## On-premises
+## Self-hosted knowledge base {#self-hosted}
 
 For self-hosted / on-premises deployments, you can enable the knowledge base features by setting `ON_PREM_KNOWLEDGE_BASE=true` in the environment variables for your self-hosted docker image.
 
-You must also be running ChromaDB. Use image `chromadb/chroma:0.5.20`. In your CodeRabbit docker image environment variables, set `CHROMADB_URL` to point to the hostname where ChromaDB can be reached. For persistance of your ChromaDB data, mount `/chroma/chroma` in the container to a volume mount. For more information on ChromaDB docker deployment, including how to set up authentication, refer to the [official documentation](https://docs.trychroma.com/deployment/docker). CodeRabbit will use CHROMA_CLIENT_AUTH_CREDENTIALS if it is set.
+You must also be running ChromaDB. Use image `chromadb/chroma:0.5.20`. In your CodeRabbit docker image environment variables, set `CHROMADB_URL` to point to the hostname where ChromaDB can be reached. For persistance of your ChromaDB data, mount `/chroma/chroma` in the container to a volume mount. For more information on ChromaDB docker deployment, including how to set up authentication, refer to the [official documentation](https://docs.trychroma.com/deployment/docker). CodeRabbit will use `CHROMA_CLIENT_AUTH_CREDENTIALS` if it is set.
 
 By default, CodeRabbit will store its data in the `coderabbitai/data` branch unless you set `ON_PREM_KNOWLEDGE_BASE_BRANCH=<branch_name>` with a value.
+
+### Walkthrough
+
+- Set up a ChromaDB service on your cloud provider of choice. There is extensive documentation for generic Docker deploys, as well as cloud native deployments, in the [official Chroma documentation](https://docs.trychroma.com/deployment)
+- Configure your environment variables for your CodeRabbit self-hosted deploy to be able to access Chroma.
+- Restart your CodeRabbit service so it has access to the new environment variable settings.
+- Create a new PR in your SCM platform.
+- Add a comment to the PR to tell CodeRabbit to remember something.
+```
+@coderabbitai always make sure to enforce camelCase
+```
+- CodeRabbit should respone that it has added a learning.
+- Check out the branch called `coderabbit/data` in the repository (or whatever branch name you have set for `ON_PREM_KNOWLEDGE_BASE_BRANCH`). It should contain a file called learnings.json with an entry containing what you told it to remember.
+- Future PRs should utilize the contents of this learnings file. Congratulations! You have configured the CodeRabbit Self-hosted knowledge base.
\ No newline at end of file
diff --git a/docs/self-hosted/github.md b/docs/self-hosted/github.md
index 45aa184..aad24ef 100644
--- a/docs/self-hosted/github.md
+++ b/docs/self-hosted/github.md
@@ -123,6 +123,7 @@ CHROMADB_URL=[http://chromadb:8000]
 - For `GITHUB_APP_PEM_FILE`, flatten the PEM file by replacing newlines with `\n`.
 - For `GITHUB_HOSTNAME`, use GitHub Enterprise server's hostname, for example, “github.acme-inc.com”
 - You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys.
+- Refer to the [Self-hosted knowledge base](/integrations/knowledge-base#self-hosted) section for details on the `ON_PREM_KNOWLEDGE_BASE`.
 
 :::
 

From 769f4aaf6caa7be72ddb7a277dbad1db35067fe1 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
 <41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 26 Nov 2024 17:04:02 +0000
Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=8E=A8=20pnpm=20run=20lint:fix?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[dependabot skip]
---
 docs/integrations/knowledge-base.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/docs/integrations/knowledge-base.md b/docs/integrations/knowledge-base.md
index 7faecab..4658c5a 100644
--- a/docs/integrations/knowledge-base.md
+++ b/docs/integrations/knowledge-base.md
@@ -62,9 +62,11 @@ By default, CodeRabbit will store its data in the `coderabbitai/data` branch unl
 - Restart your CodeRabbit service so it has access to the new environment variable settings.
 - Create a new PR in your SCM platform.
 - Add a comment to the PR to tell CodeRabbit to remember something.
+
 ```
 @coderabbitai always make sure to enforce camelCase
 ```
+
 - CodeRabbit should respone that it has added a learning.
 - Check out the branch called `coderabbit/data` in the repository (or whatever branch name you have set for `ON_PREM_KNOWLEDGE_BASE_BRANCH`). It should contain a file called learnings.json with an entry containing what you told it to remember.
-- Future PRs should utilize the contents of this learnings file. Congratulations! You have configured the CodeRabbit Self-hosted knowledge base.
\ No newline at end of file
+- Future PRs should utilize the contents of this learnings file. Congratulations! You have configured the CodeRabbit Self-hosted knowledge base.

From 81c61e97958a417028b61eaa9eb00e8045f52924 Mon Sep 17 00:00:00 2001
From: Nick Busey <nick@coderabbit.ai>
Date: Tue, 26 Nov 2024 10:24:00 -0700
Subject: [PATCH 3/5] Merge

---
 docs/integrations/knowledge-base.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/integrations/knowledge-base.md b/docs/integrations/knowledge-base.md
index 4658c5a..ab24f23 100644
--- a/docs/integrations/knowledge-base.md
+++ b/docs/integrations/knowledge-base.md
@@ -67,6 +67,6 @@ By default, CodeRabbit will store its data in the `coderabbitai/data` branch unl
 @coderabbitai always make sure to enforce camelCase
 ```
 
-- CodeRabbit should respone that it has added a learning.
+- CodeRabbit should respond that it has added a learning.
 - Check out the branch called `coderabbit/data` in the repository (or whatever branch name you have set for `ON_PREM_KNOWLEDGE_BASE_BRANCH`). It should contain a file called learnings.json with an entry containing what you told it to remember.
 - Future PRs should utilize the contents of this learnings file. Congratulations! You have configured the CodeRabbit Self-hosted knowledge base.

From 76bdd00532e0d0217d45d5ada24885f8f99578aa Mon Sep 17 00:00:00 2001
From: Nick Busey <nick@coderabbit.ai>
Date: Tue, 26 Nov 2024 10:25:55 -0700
Subject: [PATCH 4/5] Lint

---
 docs/integrations/knowledge-base.md | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/docs/integrations/knowledge-base.md b/docs/integrations/knowledge-base.md
index ab24f23..55c0245 100644
--- a/docs/integrations/knowledge-base.md
+++ b/docs/integrations/knowledge-base.md
@@ -63,9 +63,7 @@ By default, CodeRabbit will store its data in the `coderabbitai/data` branch unl
 - Create a new PR in your SCM platform.
 - Add a comment to the PR to tell CodeRabbit to remember something.
 
-```
-@coderabbitai always make sure to enforce camelCase
-```
+`@coderabbitai always make sure to enforce camelCase`
 
 - CodeRabbit should respond that it has added a learning.
 - Check out the branch called `coderabbit/data` in the repository (or whatever branch name you have set for `ON_PREM_KNOWLEDGE_BASE_BRANCH`). It should contain a file called learnings.json with an entry containing what you told it to remember.

From bf47d6e929ce9e550208516f4cbf09ad909a8570 Mon Sep 17 00:00:00 2001
From: Nick Busey <nick@coderabbit.ai>
Date: Tue, 26 Nov 2024 10:27:27 -0700
Subject: [PATCH 5/5] Lint

---
 docs/integrations/knowledge-base.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/integrations/knowledge-base.md b/docs/integrations/knowledge-base.md
index 55c0245..3579a81 100644
--- a/docs/integrations/knowledge-base.md
+++ b/docs/integrations/knowledge-base.md
@@ -53,7 +53,7 @@ For self-hosted / on-premises deployments, you can enable the knowledge base fea
 
 You must also be running ChromaDB. Use image `chromadb/chroma:0.5.20`. In your CodeRabbit docker image environment variables, set `CHROMADB_URL` to point to the hostname where ChromaDB can be reached. For persistance of your ChromaDB data, mount `/chroma/chroma` in the container to a volume mount. For more information on ChromaDB docker deployment, including how to set up authentication, refer to the [official documentation](https://docs.trychroma.com/deployment/docker). CodeRabbit will use `CHROMA_CLIENT_AUTH_CREDENTIALS` if it is set.
 
-By default, CodeRabbit will store its data in the `coderabbitai/data` branch unless you set `ON_PREM_KNOWLEDGE_BASE_BRANCH=<branch_name>` with a value.
+By default, CodeRabbit will store its data in the `coderabbitai/data` branch, unless you set a value for `ON_PREM_KNOWLEDGE_BASE_BRANCH=<branch_name>`.
 
 ### Walkthrough