Commit graph

30 commits

Author SHA1 Message Date
Max
00f9d86788 Enhance Search Result Storage and Intermediate Data Handling
- Introduced a new `Search` type to store intermediate processing results, including extracted keywords, entities, relations, and generated QueryDSL for improved debugging and citation support.
- Updated the `executeAutoSearch` method to populate the new `Search` structure, ensuring all relevant data is captured during search execution.
- Implemented methods for saving and retrieving search records in MongoDB and Redis, enhancing data persistence across sessions.
- Revised localization files to include new keys for search-related messages, improving user experience.
- Updated DESIGN.md to reflect changes in the search result structure and data flow, ensuring comprehensive documentation of the new features.
2025-12-15 16:06:11 +08:00
Max
42bb27a8dd Enhance Search Functionality with Loading and Result Messaging
- Implemented loading and result messaging in the executeAutoSearch method to improve user experience during search operations.
- Added methods to send loading, result, and completion messages, providing real-time feedback to users.
- Integrated trace node creation and completion for search operations, enhancing transparency and debugging capabilities.
- Updated localization files to include new messages for search status updates in both English and Chinese.
- Revised DESIGN.md to document the new output flow and trace integration for search operations.
2025-12-15 14:52:20 +08:00
Max
4dbce2f92e Enhance Auto Search Functionality with Keyword Extraction
- Updated the executeAutoSearch method to include an optional parameter for Skip.Keyword, allowing for conditional keyword extraction during web searches.
- Implemented logic to extract keywords only when configured and not skipped, improving search query optimization.
- Modified the Assistant's Stream method to pass options to executeAutoSearch, ensuring seamless integration of the new functionality.
- Updated DESIGN.md to document the changes in keyword extraction logic and its impact on the search process.
2025-12-13 16:57:00 +08:00
Max
e38f6ecc96 Implement Auto Search Feature in Assistant Stream Method
- Added functionality to the Assistant's Stream method to execute auto search if enabled, enhancing the search capabilities based on user configuration.
- Introduced helper methods for determining auto search eligibility, executing the search, and injecting search context into messages.
- Updated DESIGN.md to reflect the new auto search logic, including detailed descriptions of the new methods and their integration points within the search process.
2025-12-13 16:42:54 +08:00
Max
7768ca73b3 Enhance Search API with New V8 Binding Methods
- Introduced a new search object in the context to expose search methods (Web, KB, DB, All, Any, Race) for JavaScript integration.
- Implemented individual search methods with argument validation and error handling, improving the robustness of the API.
- Updated the JSAPI implementation to utilize the new search object, ensuring seamless interaction with the search functionalities.
- Enhanced documentation in DESIGN.md to reflect the new V8 binding methods and their usage, providing clear guidance for developers.
2025-12-13 16:11:30 +08:00
Max
fc9e00c917 Enhance Search API with Parallel Search Methods
- Refactored the SearchAPI interface to replace the Parallel method with All, Any, and Race methods, inspired by JavaScript Promise patterns.
- Updated the Searcher struct to implement these new parallel search methods, improving flexibility and performance in executing multiple searches.
- Revised the JSAPI implementation to support the new parallel search methods, ensuring consistency across the API.
- Enhanced documentation in DESIGN.md to detail the new parallel search functionalities and provide usage examples, clarifying their behavior and expected outcomes.
2025-12-13 15:35:52 +08:00
Max
534f4d6ed5 Refactor Search Module and Update Documentation
- Introduced a new TODO.md file to outline the implementation plan and progress for the search module.
- Updated DESIGN.md to reflect changes in the directory structure and clarify the roles of various components, including the new Handler + Registry pattern for reranking and keyword extraction.
- Refactored the Searcher struct to utilize a direct reference to the rerank package, enhancing modularity and clarity in the search process.
- Modified the Search and SearchMultiple methods to include context parameters, improving flexibility for agent mode operations.
- Revised the Reranker interface to require context for Agent and MCP modes, ensuring compatibility with different reranking strategies.
- Enhanced documentation to provide comprehensive guidance on the updated search architecture and its components.
2025-12-13 15:01:53 +08:00
Max
d3865d782b Initialize Search JSAPI Factory and Update Documentation
- Added initialization for the Search JSAPI factory in the Assistant module to streamline search operations.
- Updated the DESIGN.md to reflect the new architecture of the search module, including detailed descriptions of the keyword extraction and QueryDSL generation processes.
- Enhanced the interfaces for keyword extraction to require context, improving flexibility for different extraction modes.
- Revised directory structures in the documentation to clarify the organization of search-related components, ensuring comprehensive guidance for developers.
2025-12-13 14:41:03 +08:00
Max
b3cf5a09d9 Enhance Assistant and Search Modules with Contextual Logging and Refactorings
- Added logging for hook start and completion in the Assistant's Stream method to improve traceability during execution.
- Refactored the AgentGetterFunc to utilize the caller package, enhancing modularity and reducing circular dependencies.
- Updated the CallAgent function to check for the initialized AgentGetterFunc from the caller package, ensuring proper agent loading.
- Enhanced the Search handler to support an optional context parameter, improving flexibility for agent mode operations.
- Refined the agentSearch function to delegate search requests to a new AgentProvider, streamlining the search process.
- Updated DESIGN.md to reflect changes in search modes and the integration of the caller package, ensuring comprehensive documentation.
2025-12-13 14:05:26 +08:00
Max
e4d1701dab Add Search API configuration and enhance documentation
- Introduced new environment variables for TAVILY_API_KEY, SERPAPI_API_KEY, and SERPER_API_KEY in both `pr-test.yml` and `unit-test.yml` workflows to support additional search providers.
- Updated `DESIGN.md` to reflect the inclusion of SerpAPI as a search provider, detailing its usage and configuration options, including support for multiple search engines.
- Enhanced the `builtinSearch` function in `handler.go` to accommodate the new SerpAPI provider, ensuring proper handling of search requests.
- Revised the `WebConfig` struct in `config.go` to include an `Engine` field for specifying the search engine when using SerpAPI, improving flexibility in search configurations.
- Updated documentation to clarify the roles of new search providers and their integration within the search module, ensuring comprehensive guidance for developers.
2025-12-13 12:37:07 +08:00
Max
f8ba875cd3 Refactor QueryDSL and search types to utilize GOU types directly
- Updated the `QueryDSLGenerator` interface to use `gou.QueryDSL` and `model.Model` types for improved compatibility with Yao's query system.
- Revised the `Request` struct to incorporate GOU types for `Wheres` and `Orders`, enhancing the integration with the GOU QueryDSL format.
- Removed deprecated `QueryWhere` and `QueryOrder` types, streamlining the codebase and reducing redundancy.
- Enhanced documentation in `DESIGN.md` to reflect these changes and provide guidance on using GOU types directly.
2025-12-13 11:56:31 +08:00
Max
d264c7a784 Implement search configuration management and testing enhancements
- Introduced a new search configuration structure, allowing for detailed settings for web, knowledge base, database, citation, and weights.
- Updated the `Assistant` model to include a `Search` field, enabling assistant-specific search configurations.
- Enhanced the loading and merging logic for search configurations, ensuring global defaults can be overridden by assistant-specific settings.
- Added comprehensive tests for loading, saving, and updating assistants with search configurations, verifying the integrity of search settings.
- Updated documentation in DESIGN.md to reflect the new search configuration hierarchy and usage, clarifying the interaction between global and assistant-level settings.
2025-12-13 11:19:20 +08:00
Max
f7af652aab Refine flowchart in DESIGN.md for improved clarity on search decision-making
- Updated the flowchart to enhance the representation of the search process, clarifying the conditions under which search is skipped or auto-triggered.
- Revised labels in the flowchart for better readability and understanding of the search control logic, ensuring consistency with recent documentation updates.
2025-12-12 19:47:55 +08:00
Max
9451829755 Update DESIGN.md to implement and document the new search control mechanism
- Introduced a `uses` field in the return structure of the `Create` function to manage auto search behavior, setting it to "disabled" when handled by hooks.
- Revised flowchart and sequence diagrams to reflect the new `Uses.Search` control logic, enhancing clarity on search decision-making processes.
- Updated the `SearchUses` struct to encapsulate search-specific configurations, improving documentation on search mode options.
- Enhanced the documentation to detail the hierarchy of search configuration, clarifying how global, assistant, and hook-level settings interact.
- Added examples demonstrating the new search control values and their implications for auto search behavior.
2025-12-12 19:43:50 +08:00
Max
26d2f7f7ed Update DESIGN.md to clarify MCP tool configuration and usage
- Revised the `Uses` struct documentation to reflect the new format for MCP tool references, changing from `mcp:<server-id>` to `mcp:<server>.<tool>`.
- Enhanced examples and descriptions throughout the document to illustrate the updated MCP tool usage in various search modes.
- Improved clarity on the configuration options for keyword extraction, QueryDSL generation, and reranking, ensuring consistency with the new MCP format.
- Updated error handling documentation to address the new MCP tool parsing logic, enhancing developer understanding of potential issues.
2025-12-12 19:20:33 +08:00
Max
73e48ce6d6 Enhance DESIGN.md to document new search modes and configuration options
- Introduced a new `Uses` struct to encapsulate configuration for search modes, including `builtin`, `agent`, and `mcp`.
- Updated the `Searcher` initialization to utilize the new `Uses` struct for improved clarity and flexibility in search handling.
- Expanded documentation to detail the three web search modes, their functionalities, and the corresponding configuration options.
- Added examples illustrating the AI-powered search flow when using the agent mode, enhancing understanding of intent-aware search capabilities.
- Clarified the roles of built-in providers and the MCP server in the search process, ensuring comprehensive guidance for developers.
2025-12-12 19:09:32 +08:00
Max
6ae0a7a12d Refactor DESIGN.md to improve configuration structure and clarity
- Renamed the `config/` directory to `defaults/` to better reflect its purpose for default configuration values.
- Updated references throughout the documentation to align with the new directory structure.
- Clarified the configuration loading process, detailing how global and assistant-level configurations are merged.
- Enhanced the explanation of the `Searcher` struct and its initialization, emphasizing the use of merged configuration.
- Added new sections to document the configuration merging process for both global and assistant-specific settings, improving overall understanding of the search module's architecture.
2025-12-12 18:57:08 +08:00
Max
f0965e0781 Update agent_next_test.go and DESIGN.md for improved test reliability and documentation clarity
- Modified the test case in agent_next_test.go to use a deterministic sub-scenario, reducing flakiness in tests caused by unpredictable LLM responses.
- Enhanced DESIGN.md to clarify the structure and organization of the search module, including detailed descriptions of new types, interfaces, and configuration options.
- Updated the documentation to reflect changes in the citation system, source weighting, and the overall architecture of the search module, ensuring consistency and better understanding for developers.
2025-12-12 18:35:56 +08:00
Max
8cd71f9946 Enhance DESIGN.md to clarify citation formatting and output structure
- Added detailed guidelines for citation output format, including HTML link attributes for reference integration.
- Introduced examples demonstrating the correct usage of citation links in LLM outputs, improving clarity for developers.
- Updated documentation to ensure consistency in citation practices across the search module, aiding in the integration of references.
2025-12-12 10:41:46 +08:00
Max
155782bd7b Refactor DESIGN.md to enhance data flow visualization and clarity
- Replaced the previous text-based data flow representation with a flowchart using Mermaid syntax for improved readability and understanding.
- Streamlined the depiction of data sources and their relationships, clarifying the flow from content module to LLM input.
- Updated the documentation to ensure consistency with the new visual format, aiding in the comprehension of the search module's architecture.
2025-12-12 10:34:57 +08:00
Max
1d605b05af Enhance DESIGN.md to introduce source weighting and unified context protocol
- Added new fields to the ResultItem struct for source type, weight, and relevance score to improve context building for LLM.
- Updated the documentation to clarify the source weighting system, detailing how user, hook, and auto sources are prioritized.
- Introduced a unified context protocol for handling references across different data sources, ensuring consistent formatting and processing flow.
- Enhanced examples and behavior rules to reflect the new structure and clarify the integration of source weighting in search results.
2025-12-12 10:30:32 +08:00
Max
2d917d6cd8 Update DESIGN.md to clarify configuration hierarchy and usage of processing tools
- Refined the description of Global Configuration to specify the roles of `agent/agent.yml` and `agent/search.yao` in search options.
- Added detailed information on the `uses` configuration, including keyword extraction, QueryDSL generation, and reranking methods.
- Enhanced documentation to improve understanding of how configuration layers interact and override each other, aiding in the customization of the search module.
2025-12-12 10:15:47 +08:00
Max
f54be0d909 Update DESIGN.md to refine reranking options and clarify configuration details
- Modified the reranking section to specify "builtin" as the default score-based reranking method, replacing previous terminology.
- Updated the RerankOptions structure to reflect changes in parameter names and types, including the transition from `topK` to `topN`.
- Enhanced documentation to clarify how reranker types are determined in the configuration file, improving overall understanding of the search module's reranking capabilities.
2025-12-12 10:12:22 +08:00
Max
7106b01f90 Refactor DESIGN.md to clarify configuration options for search processing tools
- Updated comments and structure in the configuration section to better distinguish between keyword extraction, QueryDSL generation, and rerank options.
- Removed redundant comments and streamlined the configuration keys for improved clarity and consistency.
- Enhanced documentation to reflect the new organization of configuration settings, aiding in understanding the search module's functionality.
2025-12-12 10:06:27 +08:00
Max
cf6f342e42 Update DESIGN.md to reflect changes in processing tool configurations
- Changed the configuration key from `uses.dsl` to `uses.query` for clarity in the search processing tools section.
- Updated documentation to ensure consistency in the description of query processing methods and their corresponding configurations.
- Enhanced examples to align with the new configuration terminology, improving understanding of the search module's functionality.
2025-12-12 10:03:45 +08:00
Max
0996a49617 Update DESIGN.md to clarify processing tool configurations and usage
- Revised the configuration details for keyword extraction, QueryDSL generation, and reranking tools, specifying the roles of built-in, agent, and MCP server options.
- Enhanced the formatting section to improve clarity on tool usage and examples, ensuring better understanding of the search module's capabilities.
- Updated examples to reflect the new configurations, providing clearer guidance on how to utilize the search processing tools effectively.
2025-12-12 10:01:19 +08:00
Max
b5f0791f58 Revise DESIGN.md to clarify configuration hierarchy and processing tools
- Updated the configuration section to outline a three-layer hierarchy for settings: System Built-in Defaults, Global Configuration, and Assistant Configuration.
- Expanded the uses configuration details in `agent/agent.yml`, specifying processing tools for keyword extraction, QueryDSL generation, and reranking.
- Enhanced the explanation of system defaults and their role in the configuration process, providing clearer guidance on how to override settings at different levels.
- Added detailed examples for each configuration layer, improving understanding of the search module's behavior and customization options.
2025-12-12 09:57:49 +08:00
Max
53bc662f3e Enhance DESIGN.md with user data source handling details
- Updated the section on user message processing to clarify that users only specify data source IDs, with filters generated by the Search module from natural language input.
- Added a detailed example illustrating the extraction of queries and the generation of QueryDSL for data sources, improving understanding of the Search module's functionality.
2025-12-12 09:30:19 +08:00
Max
3a181354ff Add content module integration for data source processing
- Introduced a new section in DESIGN.md detailing the integration of the content module for handling user messages with data source references.
- Defined various DataSource types including model, KB collection, KB document, table, API, and MCP resource.
- Provided an example of a user message containing data references and outlined the processing flow in the content.Vision() function.
- Specified the implementation details for the processDataContent() function in content/content.go, enhancing the search module's reusability for auto search and explicit data content references.
2025-12-12 09:25:54 +08:00
Max
63c91d7f28 Refactor TestSubscribeFrom for improved timing accuracy and reliability
- Adjusted sleep durations to 1100ms to enhance test stability in CI environments.
- Modified timestamp calculations to ensure millisecond precision, improving event timing accuracy in tests.
2025-12-12 09:04:35 +08:00