agentscope-ai / agentscope-ai/agentscope-java

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

Offen
#1,955 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area/ext/rag enhancement
Vorherrschende Sprache
Java
Sterne
5.6k
Forks
1.3k
Ø Merge
4 T. 12 Std.
Gemergte PRs (30 T.)
77

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.