Files
XianBW dc7b732b2c feat: add a rag mcp in proposal (#1267)
* add simple rag mcp

* add rag_agent in expGen v2

* add conf config for research rag

* fix CI

* refactor: move context7 and rag config files to new conf modules

* make rag agent general

* fix CI

---------

Co-authored-by: Young <afe.young@gmail.com>
2025-10-20 16:46:25 +08:00

18 lines
685 B
Python

from pydantic_ai.mcp import MCPServerStreamableHTTP
from rdagent.components.agent.base import PAIAgent
from rdagent.components.agent.rag.conf import SETTINGS
from rdagent.utils.agent.tpl import T
class Agent(PAIAgent):
"""
A specific agent for RAG
"""
def __init__(self, system_prompt: str | None = None):
toolsets = [MCPServerStreamableHTTP(SETTINGS.url, timeout=SETTINGS.timeout)]
if system_prompt is None:
system_prompt = "You are a Retrieval-Augmented Generation (RAG) agent. Use the retrieved documents to answer the user's queries accurately and concisely."
super().__init__(system_prompt=system_prompt, toolsets=toolsets)