agentscope-ai / agentscope-ai/QwenPaw
[Feature]: Support importing current chat attachments into knowledge base in Console
- Dominant language
- Python
- Stars
- 34.9k
- Forks
- 3.1k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 225
Description
## Summary
Implement an end-to-end Knowledge Base (KB) workflow in CoPaw, including attachment import, persistent indexing/chunking, retrieval APIs, and agent-side KB search tool integration. This enables
users to build and query personal KB content directly from chat channels.
## Component(s) Affected
- [x] Core / Backend (app, agents, config, providers, utils, local_models)
- [x] Console (frontend web UI)
- [ ] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [x] Skills
- [ ] CLI
- [x] Documentation (website)
- [x] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy
## Problem / Motivation
Before this work, users could upload files but did not have a complete built-in KB pipeline for import + persistence + retrieval + tool-assisted answer grounding. This limited reuse of user-
provided documents across conversations and channels.
## Proposed Solution
Add a complete KB subsystem and integrate it into command and agent flows:
- KB module:
- import service, repository persistence, chunker, normalizer, search service
- parser dispatch with multi-format support (`.md`, `.txt`, `.pdf`, `.docx`, `.doc`, `.xlsx`, `.pptx`)
- optional Docling engine path, aligned with Docling official format coverage
- App/API:
- `/knowledge/import`
- `/knowledge/search`
- `/knowledge/documents`
- Command flow:
- support `/kb` and `/kb import` for attachment-driven import
- return import summary in command path
- Agent/tool integration:
- add `knowledge_search` tool
- update agent prompt guidance to use KB search before KB-grounded answers
- Console/docs:
- command suggestion and locale updates
- README and website docs updates for KB behavior and supported formats
- Tests:
- parser tests, dispatch tests, import pipeline tests, router tests, search tests, command dispatch tests
## Alternatives Considered
- Natural-language auto-trigger for KB import:
- rejected for now to avoid accidental import side effects across channels
- Single parser-only approach:
- rejected because parser-only changes do not solve persistence/search/tool integration
## Additional Context
Branch comparison against `upstream/main`:
- 34 commits
- 53 files changed
- +4074 / -94
This is intentionally an end-to-end feature scope rather than a parser-only patch.
## Willing to Contribute
- [x] I am willing to open a PR for this feature (after discussion).
Contributor guide
Assessment
This issue has not been assessed yet.