Skip to content

Conversation

@parthshr370
Copy link
Contributor

@parthshr370 parthshr370 commented Jun 24, 2025

This cookbook demonstrates a foundational and highly practical pattern: creating a single, continuous chat agent that maintains conversation context and has access to a powerful suite of tools through ACI.dev.

Summary by CodeRabbit

  • New Features
    • Added a comprehensive cookbook guiding users to build a continuous chat agent with integrated external tools using CAMEL AI and ACI.dev.
  • Documentation
    • Updated navigation to include the new "Continuous Chat Agent with Tools" cookbook under the Cookbooks section.

@coderabbitai
Copy link

coderabbitai bot commented Jun 24, 2025

Walkthrough

A new cookbook, "Continuous Chat Agent with Tools," has been introduced, detailing the setup and implementation of a persistent chat agent using CAMEL AI integrated with external tools via ACI.dev. Supporting scripts and configuration instructions were added, and the documentation navigation was updated to include this new guide.

Changes

Files/Paths Change Summary
cookbooks/continuous-agent-with-tools.mdx Added a comprehensive cookbook for building a continuous chat agent with tool integration.
cookbooks/create_config.py, cookbooks/main.py Added scripts for generating configuration and running the continuous tool-enabled chat agent.
docs.json Updated documentation navigation to include the new cookbook page.

Poem

In the warren where code and chat entwine,
A new cookbook emerges, toolsets align.
Agents converse with context in tow,
Searching, fetching answers as they go.
With scripts and guides, the path is clear—
Rabbits rejoice, new knowledge is here! 🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

Copy link

@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: 1

🧹 Nitpick comments (4)
cookbooks/continuous-agent-with-tools.mdx (4)

118-134: Blocking input() inside an async coroutine can stall the event loop
input() is synchronous and will freeze the entire loop if you later add async work. Consider delegating to a thread:

from asyncio import to_thread
...
user_input = (await to_thread(input, "\nYou: ")).strip()

This keeps main() fully non-blocking and future-proofs the example.


189-193: Only printing the first assistant message may hide tool output
response.msgs[0] assumes a single-message reply. CAMEL can return multiple messages (e.g., tool call + final answer). Iterate instead:

-if response.msgs:
-    rprint(f"[cyan]{AGENT_NAME}:[/cyan] {response.msgs[0].content}")
+for msg in response.msgs:
+    rprint(f"[cyan]{AGENT_NAME}:[/cyan] {msg.content}")

209-214: Minor grammar fix – missing preposition

Current sentence:

Located in the "4. The Continuous Chat Loop" section of main.py

Change to:

Located in the "4. The Continuous Chat Loop" section of main.py


320-320: Nit: insert “the” for smoother reading

"Search for information about CAMEL AI framework and its applications"

→ "Search for information about the CAMEL AI framework and its applications"

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f559e4 and a7cd812.

📒 Files selected for processing (2)
  • cookbooks/continuous-agent-with-tools.mdx (1 hunks)
  • docs.json (1 hunks)
🧰 Additional context used
🪛 LanguageTool
cookbooks/continuous-agent-with-tools.mdx

[uncategorized] ~209-~209: Possible missing preposition found.
Context: ...while True Loop**: Located in the "4. The Continuous Chat Loop" section of `main....

(AI_HYDRA_LEO_MISSING_IN)


[uncategorized] ~320-~320: You might be missing the article “the” here.
Context: ...month?" - "Search for information about CAMEL AI framework and its applications" **H...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🔇 Additional comments (1)
docs.json (1)

65-68: Navigation update looks correct, but double-check build output
Adding "cookbooks/continuous-agent-with-tools" directly after "cookbooks/camel-ai" keeps alphabetical order and should render fine. Please run a quick mintlify dev (or your docs build pipeline) to ensure no broken links or missing sidebar icons surface, as a missing MDX file or wrong slug will break the navigation JSON.

Comment on lines +86 to +92
# Check if uvx is available, fallback to python -m if not
command = "uvx" if shutil.which("uvx") else "python -m"
args = (
["aci-mcp", "apps-server", "--apps=BRAVE_SEARCH,GITHUB,ARXIV", "--linked-account-owner-id", linked_account_owner_id]
if command == "uvx"
else ["-m", "aci_mcp", "apps-server", "--apps=BRAVE_SEARCH,GITHUB,ARXIV", "--linked-account-owner-id", linked_account_owner_id]
)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Possible command splitting bug when uvx is missing
command = "python -m" stores a space, which most subprocess helpers treat as a single token ("python -m" literally) and will fail. Split into executable + arg to stay portable:

-# Check if uvx is available, fallback to python -m if not
-command = "uvx" if shutil.which("uvx") else "python -m"
+# Check if uvx is available; otherwise fall back to plain python
+command = "uvx" if shutil.which("uvx") else "python"
 ...
-else ["-m", "aci_mcp", "apps-server", "--apps=BRAVE_SEARCH,GITHUB,ARXIV", "--linked-account-owner-id", linked_account_owner_id]
+else ["-m", "aci_mcp", "apps-server", "--apps=BRAVE_SEARCH,GITHUB,ARXIV", "--linked-account-owner-id", linked_account_owner_id]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Check if uvx is available, fallback to python -m if not
command = "uvx" if shutil.which("uvx") else "python -m"
args = (
["aci-mcp", "apps-server", "--apps=BRAVE_SEARCH,GITHUB,ARXIV", "--linked-account-owner-id", linked_account_owner_id]
if command == "uvx"
else ["-m", "aci_mcp", "apps-server", "--apps=BRAVE_SEARCH,GITHUB,ARXIV", "--linked-account-owner-id", linked_account_owner_id]
)
# Check if uvx is available; otherwise fall back to plain python
command = "uvx" if shutil.which("uvx") else "python"
args = (
["aci-mcp", "apps-server", "--apps=BRAVE_SEARCH,GITHUB,ARXIV", "--linked-account-owner-id", linked_account_owner_id]
if command == "uvx"
else ["-m", "aci_mcp", "apps-server", "--apps=BRAVE_SEARCH,GITHUB,ARXIV", "--linked-account-owner-id", linked_account_owner_id]
)
🤖 Prompt for AI Agents
In cookbooks/continuous-agent-with-tools.mdx around lines 86 to 92, the variable
command is assigned the string "python -m" which includes a space, causing
subprocess calls to treat it as a single token and fail. To fix this, change
command to be a list of two separate elements ["python", "-m"] instead of a
single string, and adjust the subsequent code to handle command as a list when
building the full command line arguments.

@recurseml
Copy link

recurseml bot commented Jul 14, 2025

✨ No files to analyze in this PR.

Need help? Join our Discord for support!
https://discord.gg/qEjHQk64Z9

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