-
-
Notifications
You must be signed in to change notification settings - Fork 691
feat: integrate Context7 MCP documentation search functionality in coder #1141
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
base: main
Are you sure you want to change the base?
Conversation
…age and mcp to be discussed; the extraction logic not done yet; the config load is ugly) init commit 2
- Refine context7.py prompt - Handle/pause on timeout - Optimize context7 logic - Pass content downstream when enabled - Add PyTorch Image Models (timm) search to index.ts
- If the code execute successfully: | ||
- Proceed to Step 2. | ||
- Proceed to Step 2 and overlook the remaining steps in Step 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step 2 and Step 1 is missing
from rdagent.oai.llm_conf import LLM_SETTINGS | ||
|
||
|
||
class MCPCache: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not reuse SQliteLazyCache and enhance it?
@@ -0,0 +1,452 @@ | |||
"""Example usage of Context7 MCP integration.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not confuse the concept of mcp and A2A
I didn't see any mcp implementation here. I only see an Agent based on context7 mcp
I think we can reorgnize the files to make it more extentable and understandable in the future.
import time | ||
from typing import Optional | ||
|
||
from llama_index.core.agent.workflow import ReActAgent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you just want to build a Agent based on MCP
Why you prefer llama_index than pydantic-ai?
https://www.reddit.com/r/PydanticAI/comments/1jcx9ij/llamaindex_vs_pydantic_ai_understanding_the/
@@ -140,6 +140,10 @@ class DataScienceBasePropSetting(KaggleBasePropSetting): | |||
"""Enable hypothesis critique and rewrite stages for improving hypothesis quality""" | |||
enable_scale_check: bool = False | |||
|
|||
#### mcp in coder | |||
enable_context7: bool = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would enable_api_doc_agent
be a more understandable and general name?
Description:
This PR introduces the Context7 MCP (Model Context Protocol) documentation search functionality to the RD-Agent project. The key improvements include comprehensive configuration management, intelligent caching mechanisms, and enhanced error handling capabilities. Below are the new feature modules and technical improvements:
New Feature Modules:
Context7 MCP Integration (
rdagent/components/mcp/
)context7.py
: Core documentation search functionality with async querying and intelligent caching.cache.py
: SQLite-based cache management system, reusing RD-Agent's existing cache architecture.util.py
: Pydantic-based configuration management supporting environment variables and config files.__init__.py
: Module export interface.Pipeline Evaluation Integration (
rdagent/components/coder/data_science/pipeline/eval.py
)enable_context7
switch andwfb.requires_documentation_search
conditional logic.Motivation and Context:
During the data science pipeline evaluation, the existing system lacked the ability to query relevant documentation when encountering complex technical errors. The Context7 MCP integration solves this problem by providing intelligent documentation search capabilities to aid in error diagnosis and solution finding, enhancing the system's autonomous problem-solving capabilities.
Types of changes:
📚 Documentation preview 📚: https://RDAgent--1141.org.readthedocs.build/en/1141/