Skip to content

Commit 723c1e9

Browse files
Add more details on how to use on-prem knowledge base (#154)
* Add more details on how to use on-prem knowledge base * 🎨 pnpm run lint:fix [dependabot skip] --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent d027fbf commit 723c1e9

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Diff for: docs/integrations/knowledge-base.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,24 @@ For example you can add a comment in a PR to chat directly with CodeRabbit. `@co
4747

4848
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.`
4949

50-
## On-premises
50+
## Self-hosted knowledge base {#self-hosted}
5151

5252
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.
5353

54-
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.
54+
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.
5555

56-
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.
56+
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>`.
57+
58+
### Walkthrough
59+
60+
- 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)
61+
- Configure your environment variables for your CodeRabbit self-hosted deploy to be able to access Chroma.
62+
- Restart your CodeRabbit service so it has access to the new environment variable settings.
63+
- Create a new PR in your SCM platform.
64+
- Add a comment to the PR to tell CodeRabbit to remember something.
65+
66+
`@coderabbitai always make sure to enforce camelCase`
67+
68+
- CodeRabbit should respond that it has added a learning.
69+
- 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.
70+
- Future PRs should utilize the contents of this learnings file. Congratulations! You have configured the CodeRabbit Self-hosted knowledge base.

Diff for: docs/self-hosted/github.md

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ CHROMADB_URL=[http://chromadb:8000]
123123
- For `GITHUB_APP_PEM_FILE`, flatten the PEM file by replacing newlines with `\n`.
124124
- For `GITHUB_HOSTNAME`, use GitHub Enterprise server's hostname, for example, “github.acme-inc.com”
125125
- You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys.
126+
- Refer to the [Self-hosted knowledge base](/integrations/knowledge-base#self-hosted) section for details on the `ON_PREM_KNOWLEDGE_BASE`.
126127

127128
:::
128129

0 commit comments

Comments
 (0)