Commit Graph

1221 Commits

Author SHA1 Message Date
Mao Meng a54822d402 fix/air-toml-cgo-ldflags 2026-04-21 23:27:33 +08:00
draix 5591c84e7f fix: remove limit/offset from required in list_knowledge_chunks JSON Schema
limit and offset are optional parameters with default values (limit=20,
offset=0). Marking them as required in the JSON Schema forces LLM clients
to always supply them, breaking calls that rely on the defaults.

Fixes #1003
2026-04-21 23:27:14 +08:00
moineye 4ca0c7a644 fix: ReadEvent incompatible sse data format 2026-04-20 22:29:38 +08:00
jw_mac 09e1642335 fix(storage): auto-detect content-type to resolve image rendering issues
Fixes #995. Added mime type detection in SaveBytes for MinIO, OSS, S3, and TOS to prevent images from being incorrectly saved as text/csv.
2026-04-20 21:59:54 +08:00
bingxiang.cheng ede7dd08a2 fix: 修正 mcp-api-requester 为 mcp_api_requester 的引用 2026-04-20 19:54:54 +08:00
bingxiang.cheng 8f671817a3 refactor(openmaic-classroom): 规范文档并强化mcp-api-requester调用要求
- 重新排版和规范技能说明文档,提升可读性
- 明确强调必须使用WeKnora的mcp-api-requester MCP工具调用OpenMAIC API
- 取消curl命令降级方案,改为引导用户部署mcp-api-requester服务
- 增强本地模式Base URL处理,替换localhost和127.0.0.1为host.docker.internal
- 完善错误处理和任务状态查询流程说明
- 更新API参考文档,统一接口描述和响应格式
- 细化多文档生成课程集的调用和错误引导逻辑
- 提示单次生成任务时间及托管模式配额限制
2026-04-20 19:54:54 +08:00
bingxiang.cheng fff89d3abb feat(openmaic-classroom): 添加OpenMAIC互动课堂技能支持
- 新建openmaic-classroom技能文档,描述技能功能和使用流程
- 实现基于RAG检索结果和PDF生成互动课件的核心能力
- 支持托管模式和本地部署两种API调用方式
- 设计生成请求构建流程及任务状态轮询机制
- 实现多文档合成课程集的处理方案及错误处理说明
- 提供完整API接口参考,包括健康检查、生成任务、PDF解析等
- 添加需求构建指南,指导如何将检索结果转为课程需求
- 新增rag-to-requirement.py脚本,实现RAG结果向需求结构化转换
- 规范请求参数和返回格式,兼容多语言和教学深度设定
- 明确MCP调用工具的识别与降级策略,提升接口调用体验
2026-04-20 19:54:54 +08:00
ochan.kwon 127654ee78 feat: add vector_store_id column to knowledge_bases for per-KB vector store binding 2026-04-20 19:53:44 +08:00
Mao Meng e3b493e316 fix: use constant-time comparison for API key validation 2026-04-19 21:41:22 +08:00
ochan.kwon 8fd1d61333 feat: add VectorStore management UI settings page 2026-04-17 21:51:25 +08:00
ochan.kwon 927d3debff feat: pass IndexConfig to repositories with scalability options 2026-04-17 16:52:24 +08:00
hjz 7bd36bf954 feat: search engine adds proxy addresses and adds SSRF verification. 2026-04-17 16:38:02 +08:00
wizardchen 092044b68f refactor(postgres): optimize vector retrieval and HNSW settings
- Adjusted the expanded TopK limit to a maximum of 200 candidates to enhance HNSW efficiency.
- Updated the vector retrieval query to ensure the ORDER BY expression matches the indexed expression, improving index usage.
- Implemented local settings for HNSW's ef_search and iterative_scan within a transaction to optimize candidate retrieval.
- Added fallback logic to handle unsupported GUCs gracefully, ensuring query execution continues even with older pgvector versions.

These changes improve the performance and reliability of vector retrieval in the PostgreSQL implementation.
2026-04-17 12:11:03 +08:00
wizardchen d546406a15 feat(output): enhance output formatting to XML for various tools
- Updated the formatKnowledgeBaseList function to return knowledge base information as XML, improving data structure for integration.
- Modified the formatOutput function in GrepChunksTool to format search results as XML, enhancing readability and consistency.
- Adjusted the formatOutput method in KnowledgeSearchTool to output search results in XML format, providing a structured response.
- Refactored the buildOutput function in ListKnowledgeChunksTool to generate XML output, improving the clarity of chunk information.

These changes standardize output formats across multiple tools, facilitating better data handling and integration.
2026-04-17 12:11:03 +08:00
ochan.kwon c5fc05f3d0 feat: add registry dual-map and engine factory for VectorStore
- Extend RetrieveEngineRegistry with byStoreID map for DB store engines
- Add StoreRegistry interface and EngineFactory function type
- Create engine factory with per-driver SDK client construction
- Load VectorStore records from DB into registry at startup
- Wire Create/Delete to dynamically register/unregister engines
- Add comprehensive unit tests for registry and service
2026-04-17 00:15:37 +08:00
wizardchen 4f55994266 feat(prompt): enhance question rewriting and intent classification in prompt templates
- Updated the prompt template to clarify the task of understanding and rewriting user questions, improving the instructions for coreference resolution and ellipsis completion.
- Renamed sections for better clarity, changing "Rewriting Goals" to "Query Understanding."
- Added critical notes for intent classification regarding image and document attachments, ensuring accurate processing based on the presence of attachments.
- Improved examples to reflect the updated intent classification logic, enhancing the overall user experience in query handling.
2026-04-16 23:15:02 +08:00
wizardchen 53e8e17df4 feat(logger): implement LLM debug logging functionality
- Added a new logger for LLM calls, enabling detailed logging of model interactions, including request and response data.
- Introduced configuration options for enabling and specifying the log directory for LLM debug logs.
- Implemented cleanup for old log files to manage disk space effectively.
- Wrapped existing chat implementations to log calls when debug logging is enabled, enhancing traceability for model interactions.
2026-04-16 23:15:02 +08:00
wizardchen 6235a82183 Fix logger format string errors in system handler 2026-04-16 18:39:30 +08:00
wizardchen dcb7fd05b1 Fix compile error in weaviate repository 2026-04-16 18:37:31 +08:00
wizardchen 92b6b7507d refactor(chunk): improve parent-child chunk relationship handling in SplitTextParentChild
- Updated the SplitTextParentChild function to maintain a newParents slice, ensuring accurate parent indexing when splitting text into child chunks.
- This change enhances the integrity of parent-child relationships by correctly associating child chunks with their respective parents, improving overall chunk processing.
2026-04-16 18:29:33 +08:00
wizardchen fdbd981868 feat(i18n): update connection test messages and labels in multiple languages 2026-04-16 18:13:21 +08:00
wizardchen 491c324197 feat(system): remove MinIO list buckets API and UI dependencies 2026-04-16 18:13:21 +08:00
wizardchen 3e61b91efd fix(storage): remove ListBucket permission from MinIO bucket policy 2026-04-16 18:13:21 +08:00
wizardchen a560497ee8 feat(tenant): add storage bucket uniqueness validation for tenant creation and updates
- Implemented a new method to validate the uniqueness of storage bucket names across tenants, ensuring no two tenants can use the same bucket name.
- Integrated this validation into the CreateTenant and UpdateTenant methods, enhancing data isolation and preventing potential conflicts.
- Improved error logging for better traceability when validation fails.

This update strengthens the integrity of tenant storage configurations.
2026-04-16 18:13:20 +08:00
wizardchen af58e9cff4 fix(repository): ensure expandedTopK is at least params.TopK in VectorRetrieve
- Added a check to set expandedTopK to params.TopK if it is lower, ensuring the subquery limit is not less than the final limit.
- Removed unnecessary type casting in the SQL query for embedding distance calculations, simplifying the query structure.

This update improves the accuracy of vector retrieval operations in the PostgreSQL repository.
2026-04-16 18:13:20 +08:00
wizardchen 1938094dcc feat(parser): add PDFScannedParser for handling scanned PDFs
- Introduced PDFScannedParser as a fallback parser for scanned PDFs that converts pages into images for OCR processing.
- Updated PDFParser to include PDFScannedParser in the parsing chain, enhancing the document parsing capabilities for scanned content.
- Improved logging for better error tracking during PDF parsing operations.
2026-04-16 18:13:20 +08:00
wizardchen fb714ea883 feat(document-preview): enhance security by sanitizing HTML and Markdown content
- Integrated sanitizeHTML and safeMarkdownToHTML functions to ensure that rendered HTML and Markdown content is safe from XSS vulnerabilities.
- Updated the rendering logic for Excel and Markdown to sanitize the output, improving overall security in document previews.
2026-04-16 18:13:20 +08:00
wizardchen a1a07e6818 Refactor knowledge post-processing into orchestrator task
Introduce KnowledgePostProcess task to decouple image multimodal
processing from downstream operations like summary, question
generation, and knowledge graph extraction.

This allows unifying the processing logic across documents and
images and ensures all text content, including from images,
is properly extracted before post-processing.
2026-04-16 18:13:20 +08:00
wizardchen 7c40fb6ac9 feat: enhance URL validation and timeout handling in knowledge base components
- Added isValidURL function to validate URLs before rendering links in the document content component, preventing invalid links from being clickable.
- Refactored timeout handling in KnowledgeBase.vue to use setTimeout instead of setInterval, improving performance and resource management.
- Ensured that timeouts are cleared appropriately to avoid memory leaks and unnecessary polling.

This update improves the robustness of URL handling and optimizes the component's performance.
2026-04-16 18:13:19 +08:00
wizardchen a78182cfc7 feat(handler): validate bucket name format and improve MinIO error handling
- Added validation for bucket name format to ensure it meets specified criteria, returning an error message for invalid formats.
- Simplified error messages for MinIO client creation and bucket auto-creation failures, enhancing clarity for users.
- Updated success messages to reflect the correct status of bucket creation without public-read policy settings.

This update improves the robustness of the MinIO integration and enhances user feedback during storage checks.
2026-04-16 18:13:19 +08:00
sn1p4am 0785a498e9 fix: use explicit localhost for docreader health probes 2026-04-16 17:41:15 +08:00
Liwx1014 2beb64c429 docs: add wiki documentation with cross-referenced links
- Create structured wiki from docs/ directory
- Add 17 markdown pages organized in 7 categories
- Include standard Markdown relative path links for navigation
- Add Mermaid knowledge graph visualization in Home.md
2026-04-15 20:38:31 +08:00
swim2sun d2c6814f22 fix: SQLite/Lite mode compatibility for FAQ import and chunk operations
Multiple fixes for WeKnora Lite mode (SQLite, no Redis):

1. Redis nil pointer panic on FAQ import (knowledge.go)
   - Add in-memory fallback (sync.Map) for FAQ import progress tracking
   - Add nil guards for running task locks and progress queries

2. seq_id not auto-incrementing in SQLite (chunk.go, tag.go)
   - GORM autoIncrement on non-PK columns doesn't work in SQLite
   - Add AssignChunkSeqIDs() to pre-assign seq_ids before batch insert
   - Add BeforeCreate hook for KnowledgeTag
   - Use Unscoped() to include soft-deleted records in MAX(seq_id) query

3. NOW() function not available in SQLite (chunk.go)
   - Replace raw SQL NOW() with time.Now() or datetime('now')
   - Use dialector check for raw SQL that must differ between PG and SQLite

4. FAQ KB should reject file uploads (knowledge.go)
   - Add kb.Type == "faq" check in CreateKnowledgeFromFile

5. Linux/macOS build compatibility (Makefile)
   - Conditionally apply macOS-only linker flag based on uname

6. Add SQLite integration tests (chunk_sqlite_test.go)
   - TestCreateChunks_SQLite_SeqIDAutoAssigned
   - TestCreateChunks_SQLite_SeqIDContinuesFromExisting
   - TestCreateChunks_SQLite_SeqIDUniqueAcrossKBs
   - TestCreateChunks_SQLite_SeqIDAfterSoftDelete
   - TestKnowledgeTag_SQLite_SeqIDAutoAssigned
   - TestUpdateChunk_SQLite_NoNOWError

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 20:37:10 +08:00
moineye 5000e6e665 fix: missing deep copy entity 2026-04-15 20:35:48 +08:00
ugurtafrali 38077d6ccd Fix system prompt not being used when flag is false 2026-04-15 20:21:12 +08:00
wizardchen 9bb4a12562 feat(repository): update keyword retrieval logic to use ParadeDB's matching operator
- Modified the SQL clause in the KeywordsRetrieve function to utilize ParadeDB's ||| operator for improved token matching.
- Enhanced the handling of retrieval results in the fuseOrDeduplicate function to maintain original scores for keyword-only results, ensuring better performance in FAQ scenarios.

This update optimizes the keyword retrieval process and improves the accuracy of search results.
2026-04-15 20:16:02 +08:00
wizardchen 8609c09a63 feat(request): enhance token refresh handling and public auth request logic
- Introduced a function to identify public authentication requests, preventing unnecessary token refresh attempts for specific endpoints.
- Simplified the redirection logic to the login page upon 401 errors, improving code readability and maintainability.
- Updated error handling to provide clearer messages for failed authentication attempts.

This update improves the request handling process, ensuring a smoother user experience during authentication flows.
2026-04-15 15:58:01 +08:00
wizardchen b0531900e9 feat(router): implement auto-setup failure handling for Lite edition
- Added logic to track auto-setup failures using localStorage, preventing repeated attempts if the setup fails.
- Updated the router's authentication flow to conditionally attempt auto-setup based on the failure status.
- Enhanced the login component to check for auto-setup failure before attempting the setup process.

This update improves the user experience by ensuring that failed auto-setup attempts do not lead to repeated failures during login.
2026-04-15 15:58:01 +08:00
wizardchen 9ba8582f70 feat(weknoracloud): implement WeKnoraCloud VLM integration
- Added WeKnoraCloudVLM struct to handle interactions with the WeKnoraCloud API, including image and text processing capabilities.
- Enhanced model configuration to include AppID and AppSecret for secure API access.
- Updated modelService to resolve WeKnoraCloud credentials and pass them to the VLM configuration.
- Implemented Predict method for sending requests to the WeKnoraCloud API and processing responses.

This update introduces a new integration with WeKnoraCloud, expanding the application's capabilities in handling multimedia content.
2026-04-15 15:43:08 +08:00
wizardchen 3fcfa89062 docs: update README files for version 0.4.0 with feature highlights and improved links 2026-04-15 11:37:24 +08:00
wizardchen 08d695d100 chore(changelog): update version 0.4.0 highlights and improve documentation
- Revised the changelog to reflect the new features in version 0.4.0, including the introduction of the Cloud Knowledge Assistant and updates to WeKnora Cloud integration.
- Enhanced descriptions for ClawHub Skill and data source import capabilities, clarifying functionality and usage.
- Updated README files in multiple languages to ensure consistency and accuracy in feature descriptions and links.

This update improves the clarity and accessibility of the project's documentation, ensuring users are well-informed about the latest features and integrations.
2026-04-15 11:37:24 +08:00
wizardchen 3f8201cd49 refactor(weknoracloud): update credential handling and configuration
- Replaced references to Docreader credentials with WeKnoraCloud credentials across multiple services and handlers.
- Introduced a new CredentialsConfig structure to manage third-party provider credentials, specifically for WeKnoraCloud.
- Updated database schema to include a credentials column for storing WeKnoraCloud AppID and AppSecret.
- Enhanced methods for retrieving and utilizing WeKnoraCloud credentials, ensuring proper encryption and decryption during storage and retrieval.

This update improves the management of WeKnoraCloud credentials, streamlining the integration and enhancing security measures.
2026-04-15 11:37:24 +08:00
wizardchen 3b23dccd5c feat(model_service): enhance WeKnoraCloud credential management
- Added tenantService to modelService for retrieving WeKnoraCloud credentials when not provided in model parameters.
- Implemented resolveWeKnoraCloudCredentials method to automatically fetch AppID and AppSecret from tenant configuration.
- Updated GetEmbeddingModel, GetEmbeddingModelForTenant, GetRerankModel, and GetChatModel methods to utilize the new credential resolution logic.
- Modified ModelParameters to encrypt and decrypt both APIKey and AppSecret for improved security during database operations.

This update streamlines credential management for WeKnoraCloud models, enhancing security and usability.
2026-04-15 11:37:24 +08:00
wizardchen 457e739978 feat(release): update to version 0.4.0 with new features, improvements, and bug fixes 2026-04-15 11:37:24 +08:00
wizardchen 86d26fa9bf feat(video): remove video upload support and update related terminology
- Removed support for video file uploads across the application, including updates to the knowledge base and document processing services.
- Updated internationalization files to reflect the removal of video-related terminology, changing labels and descriptions to focus solely on audio processing.
- Adjusted file type handling to exclude video formats, ensuring users receive accurate feedback regarding supported file types.
- Enhanced error handling to provide clear messages when users attempt to upload unsupported video files.

This update streamlines the application by focusing on audio processing capabilities and improving user experience through clearer messaging.
2026-04-14 22:59:14 +08:00
wizardchen 0fcab3a413 feat(video): update ASR terminology and file type labels for improved clarity
- Changed 'Audio Processing' to 'Audio & Video' in English, Korean, Russian, and Chinese translations to reflect expanded functionality.
- Updated ASR configuration titles and descriptions to include video processing capabilities, enhancing user understanding of the feature.
- Renamed file type labels from 'Audio Files' to 'Audio & Video' across multiple languages for consistency and clarity.
- Enhanced document upload handling in the KnowledgeBase to filter unsupported file types, providing user feedback for filtered images, videos, and audio files.

This update improves the internationalization of the application and clarifies the capabilities of the ASR feature.
2026-04-14 22:59:14 +08:00
wizardchen cb97489787 feat(attachment_processor): enhance error handling and content formatting for attachments
- Improved error handling in the attachment processing logic by providing detailed XML-like error messages for text, audio, and document processing failures.
- Updated the audio file content format to use XML tags for better structure, replacing the previous placeholder format.

This update enhances the clarity of error reporting and improves the overall structure of attachment content.
2026-04-14 18:21:12 +08:00
wizardchen bf3e913398 feat(chat_pipeline): enhance query handling with image and attachment metadata
- Updated the query content to include metadata for uploaded images and attachments, improving the context provided to the assistant.
- Modified the attachment prompt format to use XML-like tags for better structure and readability, including metadata for file type and size.
- Enhanced error handling for unsupported file content extraction, providing clearer feedback to users.

This update improves the assistant's ability to process and respond to queries involving multimedia content.
2026-04-14 18:21:12 +08:00
wizardchen 5a2f9f6a44 feat(prompt_templates): add document analysis prompt and enhance rewrite template descriptions
- Introduced a new prompt template for document analysis, allowing the assistant to provide detailed responses based on attached documents.
- Updated the rewrite template descriptions to clarify the handling of image and document attachments, ensuring better user understanding of intent classification.
- Added a new intent type for document-only queries to improve response accuracy.

This update enhances the assistant's capabilities in processing and analyzing documents while refining the user experience in intent classification.
2026-04-14 18:21:12 +08:00
wizardchen 1fc90f5772 refactor(weknoracloud): enhance internationalization and UI feedback for credential management
- Updated the WeKnoraCloud settings and related components to utilize i18n for improved localization.
- Replaced hardcoded strings with translation keys for better maintainability and user experience.
- Enhanced user feedback messages for credential status, including configuration, expiration, and unconfiguration states.
- Improved UI elements to guide users in managing WeKnoraCloud credentials effectively.

This update streamlines the user interface and ensures consistent messaging across different languages.
2026-04-14 17:36:01 +08:00