Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more details on how to use on-prem knowledge base #154

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

NickBusey
Copy link
Contributor

No description provided.

Copy link
Contributor

coderabbitai bot commented Nov 26, 2024

Walkthrough

The pull request includes updates to two documentation files: knowledge-base.md and github.md. The knowledge-base.md file has been restructured with a new section titled "Walkthrough" that provides detailed steps for setting up a self-hosted knowledge base, including configuring environment variables and interacting with the CodeRabbit bot. The github.md file has been updated to reference the new "Self-hosted knowledge base" section, enhancing the integration instructions with GitHub.

Changes

File Path Change Summary
docs/integrations/knowledge-base.md - Renamed section header from "On-premises" to "Self-hosted knowledge base" with an anchor link.
- Added a new "Walkthrough" section detailing setup steps for a self-hosted knowledge base.
- Minor text adjustments for consistency, including formatting of environment variable names.
docs/self-hosted/github.md - Added a note referencing the "Self-hosted knowledge base" for the ON_PREM_KNOWLEDGE_BASE configuration option.

Possibly related PRs

  • Add onprem learning config #148: Adds new environment variables related to self-hosting CodeRabbit, aligning with the updates on configuring environment variables for a self-hosted knowledge base.
  • Flesh out knowledgebase docs a bit #150: Enhances the knowledge base documentation, directly related to the focus on improving the knowledge-base.md document.
  • Add chroma db docs #153: Adds documentation for ChromaDB integration, relevant to the updates on setting up a self-hosted knowledge base.

Suggested reviewers

  • aravindputrevu

🐰 In the garden where knowledge grows,
A self-hosted base now brightly glows.
With steps laid clear, and links to find,
The CodeRabbit hops, leaving doubts behind.
So gather 'round, and take a look,
For wisdom blooms in every nook! 📚✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 81c61e9 and bf47d6e.

📒 Files selected for processing (1)
  • docs/integrations/knowledge-base.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/integrations/knowledge-base.md

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

[dependabot skip]
Copy link

cloudflare-workers-and-pages bot commented Nov 26, 2024

Deploying coderabbit-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: bf47d6e
Status: ✅  Deploy successful!
Preview URL: https://d857e7e9.coderabbit-docs.pages.dev
Branch Preview URL: https://nick-kb-walkthrough.coderabbit-docs.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
docs/integrations/knowledge-base.md (3)

50-57: Enhance environment variables documentation and security guidance.

Consider the following improvements for clarity and security:

  1. Format environment variables consistently using code blocks
  2. Add version compatibility information
  3. Include security best practices for authentication

Apply these changes:

-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.
+For self-hosted / on-premises deployments, you can enable the knowledge base features by configuring the following environment variables in your self-hosted docker image:
+
+```env
+# Required: Enable on-premises knowledge base
+ON_PREM_KNOWLEDGE_BASE=true
+
+# Required: ChromaDB connection URL
+CHROMADB_URL=http://your-chromadb-host:8000
+
+# Optional: Override default branch for storing learnings
+ON_PREM_KNOWLEDGE_BASE_BRANCH=your-branch-name
+
+# Optional: ChromaDB authentication credentials
+CHROMA_CLIENT_AUTH_CREDENTIALS=your-credentials
+```
+
+> **Security Note**: When deploying to production, always enable authentication for ChromaDB and use secure credentials.

66-69: Add language specification to code block.

The code block should specify the language for better syntax highlighting and to comply with markdown best practices.

-```
+```bash
 @coderabbitai always make sure to enforce camelCase

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint (0.35.0)</summary>

66-66: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

---

`70-72`: **Enhance the verification steps with more details.**

Consider adding:
1. Expected bot response examples
2. Common troubleshooting steps
3. Verification timeframes


Add the following content:

```diff
-CodeRabbit should respone that it has added a learning.
+CodeRabbit should respond with a confirmation message like:
+> "I've recorded this learning and will apply it in future reviews."
+
+If you don't receive a response within a few minutes:
+- Verify that CodeRabbit has the necessary repository permissions
+- Check the CodeRabbit logs for any connection errors to ChromaDB
+- Ensure the knowledge base branch exists and is writable
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d027fbf and 769f4aa.

📒 Files selected for processing (2)
  • docs/integrations/knowledge-base.md (1 hunks)
  • docs/self-hosted/github.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/self-hosted/github.md
🧰 Additional context used
🪛 Markdownlint (0.35.0)
docs/integrations/knowledge-base.md

66-66: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

@NickBusey NickBusey enabled auto-merge (squash) November 26, 2024 17:22
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (4)
docs/integrations/knowledge-base.md (4)

50-57: Fix missing comma in line 56.

The section provides clear instructions, but there's a minor grammatical issue.

-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 `ON_PREM_KNOWLEDGE_BASE_BRANCH=<branch_name>` with a value.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~56-~56: Possible missing comma found.
Context: ...ore its data in the coderabbitai/data branch unless you set `ON_PREM_KNOWLEDGE_BASE_...

(AI_HYDRA_LEO_MISSING_COMMA)


54-54: Consider adding an environment variables code block.

To improve clarity, consider adding a code block showing all the required environment variables together.

 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.
+
+Example environment variables:
+```env
+ON_PREM_KNOWLEDGE_BASE=true
+CHROMADB_URL=http://chromadb:8000
+CHROMA_CLIENT_AUTH_CREDENTIALS=your_auth_token  # Optional
+ON_PREM_KNOWLEDGE_BASE_BRANCH=custom_branch    # Optional
+```

66-69: Fix code block and grammar issues.

The walkthrough is clear, but there are a few minor improvements needed:

-```
+```markdown
 @coderabbitai always make sure to enforce camelCase

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



Also applies to: 71-72

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint (0.35.0)</summary>

66-66: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

---

`60-72`: **Consider adding verification steps.**

The walkthrough would benefit from steps to verify the ChromaDB connection before proceeding with the PR creation.

Add these steps after the ChromaDB setup:
```diff
 - 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.
+- Verify the ChromaDB connection by checking the CodeRabbit logs for successful connection messages.
+- Ensure the `coderabbit/data` branch (or your custom branch) exists and is accessible.
 - Create a new PR in your SCM platform.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~71-~71: Possible missing comma found.
Context: ... should contain a file called learnings.json with an entry containing what you told ...

(AI_HYDRA_LEO_MISSING_COMMA)

🪛 Markdownlint (0.35.0)

66-66: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 769f4aa and 81c61e9.

📒 Files selected for processing (1)
  • docs/integrations/knowledge-base.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/integrations/knowledge-base.md

[uncategorized] ~56-~56: Possible missing comma found.
Context: ...ore its data in the coderabbitai/data branch unless you set `ON_PREM_KNOWLEDGE_BASE_...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~71-~71: Possible missing comma found.
Context: ... should contain a file called learnings.json with an entry containing what you told ...

(AI_HYDRA_LEO_MISSING_COMMA)

🪛 Markdownlint (0.35.0)
docs/integrations/knowledge-base.md

66-66: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant