agentscope-ai / agentscope-ai/agentscope-java

[Feature]: Provide built-in RAG retrieval tool for v2

Aberta
#1,955 1 comentário 0 reações 0 responsáveis Ver no GitHub
area/ext/rag enhancement
Linguagem predominante
Java
Estrelas
5.6k
Forks
1.3k
Merge médio
4d 12h
PRs com merge (30d)
77

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.