agentscope-ai / agentscope-ai/agentscope-java
[Feature]: Provide built-in RAG retrieval tool for v2
- 主要語言
- Java
- 星號
- 5.6k
- 分支
- 1.3k
- 平均合併
- 4 天 12 小時
- 30 天內合併 PR
- 77
描述
**AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.**
**Is your feature request related to a problem? Please describe.**
AgentScope Java v2 deprecated the core RAG package without a built-in replacement. Developers must build their own embedding, vector storage, and retrieval pipeline from scratch. Knowledge-intensive scenarios force every v2 project to reinvent the wheel.
**Describe the solution you'd like**
A built-in `KnowledgeSearchTool` in `agentscope-core`, following the same pattern as existing
built-in tools like `reset_tools` (MetaTool) and `TodoTools`. It is opt-in — not activated by default.
```java
// Default: no RAG tool, behavior unchanged
ReActAgent agent = ReActAgent.builder().build();
// Opt in: register with a knowledge adapter
toolkit.registration()
.tool(new KnowledgeSearchTool(new BailianRagAdapter(apiKey)))
.apply();
```
The tool follows the standard ToolBase contract and works with ToolGroup, Skills,
PermissionSystem, and all other v2 building blocks out of the box.
**Describe alternatives you've considered**
1. Every developer DIY: Duplicated effort, inconsistent APIs across projects.
2. Middleware auto-injection: Automatically injects retrieved context before every
reasoning step. Useful for "must-lookup" scenarios like terminology translation,
but adds overhead when retrieval is unnecessary. Can be added later if needed.
3. Skill-based orchestration: SKILL.md orchestrates the retrieval workflow.
But Skills depend on tools existing first, so the Tool must come first.
Tool-first is the minimal, composable building block.
**Additional context**
RAG is essential for production scenarios:
- Terminology databases (100k+ entries can't fit in a prompt)
- Historical translation memory (1000+ past translations)
- Domain-specific document Q&A
This follows the same "opt-in built-in" pattern as other v2 tools (MetaTool, TodoTools).
Developers who don't need RAG see zero overhead — Agent behavior stays exactly the same.
I'm willing to implement this feature and submit a PR. If the maintainers agree with this direction, please assign the issue to me and I'll start working on it.
貢獻指南
評估
這個 Issue 還沒有評估資料。