mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-08-28 05:25:04 +00:00
refactor(vector_store): update search functionality and documentation
- Remove deprecated `add_dict_filter` method from vector store operations - Update `async_search` method to use `filter_dict` parameter for advanced filtering - Modify examples in documentation to use the new `filter_dict` format for advanced filtering - Update task memory and messages for consistency with new filtering approach
This commit is contained in:
parent
948cddf423
commit
a9f061b92d
5 changed files with 101 additions and 89 deletions
|
|
@ -1,25 +1,27 @@
|
|||
[
|
||||
{
|
||||
"workspace_id": "test_workspace",
|
||||
"memory_id": "a410858f28e740e0b51a561302d95549",
|
||||
"memory_id": "e1103be06ec24ffebf441257d385211b",
|
||||
"memory_type": "task",
|
||||
"when_to_use": "When analyzing a complex, multi-faceted company with public data available across financial, historical, technological, and strategic dimensions—especially in fast-evolving industries like EVs or tech.",
|
||||
"content": "The agent successfully decomposed the open-ended query 'Analyze the company Tesla' into three targeted web searches: (1) company overview/history/business model, (2) financial performance (2024), and (3) recent innovations. This structured breakdown ensured comprehensive coverage of key domains without redundancy. Each search used precise, domain-specific keywords that yielded high-quality, actionable results. The agent then synthesized these into a coherent, layered analysis by prioritizing factual accuracy, chronological flow, and thematic grouping (e.g., separating history from business model). This pattern enabled deep insight generation while avoiding hallucination or omission.",
|
||||
"when_to_use": "When analyzing a complex, multi-faceted company with historical, financial, operational, and competitive dimensions—especially in dynamic industries like tech or EVs.",
|
||||
"content": "The agent successfully decomposed the broad query 'Analyze the company Tesla' into four distinct subtasks: (1) historical context, (2) business model and revenue streams, (3) financial performance, and (4) innovation and market position. Each subtask was addressed via targeted web searches using specific, focused queries that extracted precise, high-value information. The use of multiple search iterations with varying angles (e.g., 'Tesla innovation technology advancements 2024' vs. 'market position competitors electric vehicles 2024') ensured comprehensive coverage across different domains. This structured, layered approach prevented information overload while ensuring depth in each critical area.",
|
||||
"score": 0.92,
|
||||
"time_created": "2025-09-06 23:47:57",
|
||||
"time_modified": "2025-09-06 23:47:57",
|
||||
"time_created": "2025-09-07 15:57:06",
|
||||
"time_modified": "2025-09-07 15:57:06",
|
||||
"author": "qwen3-30b-a3b-instruct-2507",
|
||||
"metadata": {
|
||||
"when_to_use": "When analyzing a complex, multi-faceted company with public data available across financial, historical, technological, and strategic dimensions—especially in fast-evolving industries like EVs or tech.",
|
||||
"experience": "The agent successfully decomposed the open-ended query 'Analyze the company Tesla' into three targeted web searches: (1) company overview/history/business model, (2) financial performance (2024), and (3) recent innovations. This structured breakdown ensured comprehensive coverage of key domains without redundancy. Each search used precise, domain-specific keywords that yielded high-quality, actionable results. The agent then synthesized these into a coherent, layered analysis by prioritizing factual accuracy, chronological flow, and thematic grouping (e.g., separating history from business model). This pattern enabled deep insight generation while avoiding hallucination or omission.",
|
||||
"when_to_use": "When analyzing a complex, multi-faceted company with historical, financial, operational, and competitive dimensions—especially in dynamic industries like tech or EVs.",
|
||||
"experience": "The agent successfully decomposed the broad query 'Analyze the company Tesla' into four distinct subtasks: (1) historical context, (2) business model and revenue streams, (3) financial performance, and (4) innovation and market position. Each subtask was addressed via targeted web searches using specific, focused queries that extracted precise, high-value information. The use of multiple search iterations with varying angles (e.g., 'Tesla innovation technology advancements 2024' vs. 'market position competitors electric vehicles 2024') ensured comprehensive coverage across different domains. This structured, layered approach prevented information overload while ensuring depth in each critical area.",
|
||||
"tags": [
|
||||
"decomposition",
|
||||
"multi-domain analysis",
|
||||
"web_search strategy",
|
||||
"structured inquiry",
|
||||
"synthesis"
|
||||
"multi-dimensional analysis",
|
||||
"targeted search",
|
||||
"information layering",
|
||||
"business model",
|
||||
"financials",
|
||||
"competitive landscape"
|
||||
],
|
||||
"confidence": 0.95,
|
||||
"confidence": 0.9,
|
||||
"step_type": "reasoning",
|
||||
"tools_used": [
|
||||
"web_search"
|
||||
|
|
@ -28,25 +30,26 @@
|
|||
},
|
||||
{
|
||||
"workspace_id": "test_workspace",
|
||||
"memory_id": "778c5cf1e3574ce4ad55654186358011",
|
||||
"memory_id": "989fceaa659548d6b85740de02a3ea83",
|
||||
"memory_type": "task",
|
||||
"when_to_use": "When initial information retrieval is incomplete or lacks depth on specific subtopics such as financials, innovation timelines, or strategic direction.",
|
||||
"content": "After retrieving general background on Tesla, the agent proactively performed additional targeted web searches using distinct, focused queries for financials and innovations. This iterative approach allowed it to gather granular, up-to-date data (e.g., 2024 revenue, FSD V12 rollout, 16B km driving data) that would have been missed with a single broad query. By calling the same tool (web_search) multiple times with different parameters, the agent achieved triangulation across perspectives—ensuring completeness and reducing bias. This demonstrates the power of sequential, purpose-driven tool use over monolithic queries.",
|
||||
"score": 0.92,
|
||||
"time_created": "2025-09-06 23:47:57",
|
||||
"time_modified": "2025-09-06 23:47:57",
|
||||
"when_to_use": "When initial search results are insufficient or fragmented, especially for time-sensitive or evolving topics like AI advancements or quarterly financials.",
|
||||
"content": "After receiving partial results from the first three searches, the agent proactively initiated two additional web searches to fill critical knowledge gaps: one on recent technological innovations (2024) and another on current market competition. These follow-up queries were highly specific and timed to capture up-to-date developments (e.g., FSD V12.5, Optimus robot production plans). This iterative search strategy allowed the agent to identify real-time trends and emerging strategic moves, which were essential for a forward-looking analysis. The ability to dynamically adjust the research plan based on incomplete early data is a key indicator of adaptive intelligence.",
|
||||
"score": 0.85,
|
||||
"time_created": "2025-09-07 15:57:06",
|
||||
"time_modified": "2025-09-07 15:57:06",
|
||||
"author": "qwen3-30b-a3b-instruct-2507",
|
||||
"metadata": {
|
||||
"when_to_use": "When initial information retrieval is incomplete or lacks depth on specific subtopics such as financials, innovation timelines, or strategic direction.",
|
||||
"experience": "After retrieving general background on Tesla, the agent proactively performed additional targeted web searches using distinct, focused queries for financials and innovations. This iterative approach allowed it to gather granular, up-to-date data (e.g., 2024 revenue, FSD V12 rollout, 16B km driving data) that would have been missed with a single broad query. By calling the same tool (web_search) multiple times with different parameters, the agent achieved triangulation across perspectives—ensuring completeness and reducing bias. This demonstrates the power of sequential, purpose-driven tool use over monolithic queries.",
|
||||
"when_to_use": "When initial search results are insufficient or fragmented, especially for time-sensitive or evolving topics like AI advancements or quarterly financials.",
|
||||
"experience": "After receiving partial results from the first three searches, the agent proactively initiated two additional web searches to fill critical knowledge gaps: one on recent technological innovations (2024) and another on current market competition. These follow-up queries were highly specific and timed to capture up-to-date developments (e.g., FSD V12.5, Optimus robot production plans). This iterative search strategy allowed the agent to identify real-time trends and emerging strategic moves, which were essential for a forward-looking analysis. The ability to dynamically adjust the research plan based on incomplete early data is a key indicator of adaptive intelligence.",
|
||||
"tags": [
|
||||
"iterative research",
|
||||
"query refinement",
|
||||
"information triangulation",
|
||||
"depth enhancement",
|
||||
"tool reuse"
|
||||
"dynamic query refinement",
|
||||
"real-time updates",
|
||||
"gap detection",
|
||||
"adaptive planning",
|
||||
"AI innovation"
|
||||
],
|
||||
"confidence": 0.9,
|
||||
"confidence": 0.85,
|
||||
"step_type": "action",
|
||||
"tools_used": [
|
||||
"web_search"
|
||||
|
|
@ -55,27 +58,30 @@
|
|||
},
|
||||
{
|
||||
"workspace_id": "test_workspace",
|
||||
"memory_id": "2584c54b40ca4f65922aa231c32fd98b",
|
||||
"memory_id": "1aa50187c2da41a483256a55aae8e260",
|
||||
"memory_type": "task",
|
||||
"when_to_use": "When synthesizing information from multiple sources into a structured, insightful output suitable for executive-level understanding or decision-making.",
|
||||
"content": "The agent did not simply concatenate results but reorganized them into a logical framework: Overview → History → Business Model → Financials → Innovations → Challenges → Conclusion. It highlighted critical trends (e.g., declining profit despite stable revenue), contextualized technical advances (e.g., 4680 battery + SiC = efficiency gains), and connected innovations to long-term vision (Master Plan 4.0). This synthesis transformed raw facts into narrative insights—making the output not just informative but strategically valuable. The inclusion of both achievements and challenges added balance and credibility.",
|
||||
"score": 0.92,
|
||||
"time_created": "2025-09-06 23:47:57",
|
||||
"time_modified": "2025-09-06 23:47:57",
|
||||
"when_to_use": "When synthesizing diverse data sources into a coherent, structured narrative for executive-level understanding.",
|
||||
"content": "The agent did not merely aggregate raw facts but synthesized findings into a well-organized, thematic report that connected history, business model, financials, innovation, and competition. It highlighted critical contradictions (e.g., declining profits despite strong Q4 growth) and strategic shifts (e.g., move toward software/services). By identifying key metrics (like carbon credit income and FSD safety record) as differentiators, it transformed data into insight. This demonstrates the importance of post-data synthesis reasoning—turning fragmented inputs into actionable, narrative-driven conclusions that reflect both factual accuracy and strategic interpretation.",
|
||||
"score": 0.85,
|
||||
"time_created": "2025-09-07 15:57:06",
|
||||
"time_modified": "2025-09-07 15:57:06",
|
||||
"author": "qwen3-30b-a3b-instruct-2507",
|
||||
"metadata": {
|
||||
"when_to_use": "When synthesizing information from multiple sources into a structured, insightful output suitable for executive-level understanding or decision-making.",
|
||||
"experience": "The agent did not simply concatenate results but reorganized them into a logical framework: Overview → History → Business Model → Financials → Innovations → Challenges → Conclusion. It highlighted critical trends (e.g., declining profit despite stable revenue), contextualized technical advances (e.g., 4680 battery + SiC = efficiency gains), and connected innovations to long-term vision (Master Plan 4.0). This synthesis transformed raw facts into narrative insights—making the output not just informative but strategically valuable. The inclusion of both achievements and challenges added balance and credibility.",
|
||||
"when_to_use": "When synthesizing diverse data sources into a coherent, structured narrative for executive-level understanding.",
|
||||
"experience": "The agent did not merely aggregate raw facts but synthesized findings into a well-organized, thematic report that connected history, business model, financials, innovation, and competition. It highlighted critical contradictions (e.g., declining profits despite strong Q4 growth) and strategic shifts (e.g., move toward software/services). By identifying key metrics (like carbon credit income and FSD safety record) as differentiators, it transformed data into insight. This demonstrates the importance of post-data synthesis reasoning—turning fragmented inputs into actionable, narrative-driven conclusions that reflect both factual accuracy and strategic interpretation.",
|
||||
"tags": [
|
||||
"narrative synthesis",
|
||||
"strategic framing",
|
||||
"insight extraction",
|
||||
"balanced reporting",
|
||||
"structured storytelling"
|
||||
"synthesis",
|
||||
"narrative structuring",
|
||||
"insight generation",
|
||||
"strategic interpretation",
|
||||
"data integration",
|
||||
"executive summary"
|
||||
],
|
||||
"confidence": 0.9,
|
||||
"step_type": "observation",
|
||||
"tools_used": []
|
||||
"step_type": "reasoning",
|
||||
"tools_used": [
|
||||
"web_search"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
[
|
||||
{
|
||||
"role": "user",
|
||||
"content": "You are a helpful assistant.\nThe current time is 2025-09-06 23:46:35.\nPlease proactively choose the most suitable tool or combination of tools based on the user's question, including web_search etc.\nPlease first think about how to break down the problem into subtasks, what tools and parameters should be used for each subtask, and finally provide the tool call name and parameters.\nTry calling the same tool multiple times with different parameters to obtain information from various perspectives.\nPlease determine the response language based on the language of the user's question.\n\nAnalyze Xiaomi Corporation\n",
|
||||
"content": "You are a helpful assistant.\nThe current time is 2025-09-07 15:55:08.\nPlease proactively choose the most suitable tool or combination of tools based on the user's question, including web_search etc.\nPlease first think about how to break down the problem into subtasks, what tools and parameters should be used for each subtask, and finally provide the tool call name and parameters.\nTry calling the same tool multiple times with different parameters to obtain information from various perspectives.\nPlease determine the response language based on the language of the user's question.\n\nAnalyze Xiaomi Corporation\n",
|
||||
"reasoning_content": "",
|
||||
"tool_calls": [],
|
||||
"tool_call_id": "",
|
||||
"time_created": "2025-09-06 23:46:35",
|
||||
"time_created": "2025-09-07 15:55:08",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
"tool_calls": [
|
||||
{
|
||||
"index": 0,
|
||||
"id": "call_11acd91586814b969e9298",
|
||||
"id": "call_cf6bfde51c5f4980bc6d68",
|
||||
"type": "function",
|
||||
"name": "web_search",
|
||||
"arguments": "{\"query\": \"Xiaomi Corporation company overview\"}",
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
},
|
||||
{
|
||||
"index": 1,
|
||||
"id": "call_2cbc0d463fe44742b66fe0",
|
||||
"id": "call_d537006a5856429db13013",
|
||||
"type": "function",
|
||||
"name": "web_search",
|
||||
"arguments": "{\"query\": \"Xiaomi Corporation financial performance 2024\"}",
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
},
|
||||
{
|
||||
"index": 2,
|
||||
"id": "call_0b98fa8656d04565867f2f",
|
||||
"id": "call_a23e2b5e71ed4afd91bfb9",
|
||||
"type": "function",
|
||||
"name": "web_search",
|
||||
"arguments": "{\"query\": \"Xiaomi Corporation product portfolio and innovations\"}",
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
},
|
||||
{
|
||||
"index": 3,
|
||||
"id": "call_64f841c67a99493f9e5c62",
|
||||
"id": "call_adec4f13bc4c4b859d2b08",
|
||||
"type": "function",
|
||||
"name": "web_search",
|
||||
"arguments": "{\"query\": \"Xiaomi Corporation market position in smartphones and IoT devices\"}",
|
||||
|
|
@ -55,52 +55,52 @@
|
|||
}
|
||||
],
|
||||
"tool_call_id": "",
|
||||
"time_created": "2025-09-06 23:46:37",
|
||||
"time_created": "2025-09-07 15:55:27",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "Xiaomi Corporation was founded in April 2010 and listed on the Main Board of the Hong Kong Stock Exchange on July 9, 2018 (1810.HK). Xiaomi is a consumer electronics and smart manufacturing company with smartphones and smart hardware connected by an IoT platform at its core. With an equal emphasis on innovation and quality, Xiaomi continuously pursues high-quality user experience and operational efficiency. The company relentlessly builds amazing products with honest prices to let everyone in the world enjoy a better life through innovative technology. Xiaomi is one of the world's leading smartphone companies. As of 2024, Xiaomi ranked among the top 3 in the global smartphone market, in terms of smartphone shipments, according to Canalys. The company has also established the world’s leading consumer AIoT (AI+IoT) platform, with 904.6 million smart devices connected to its platform, excluding smartphones, tablets and laptops, as of December 31, 2024. Xiaomi products are present in more than 100 countries and regions around the world. In August 2024, the company listed as Fortune Global 500 for the 6th consecutive year. Xiaomi is a constituent of the Hang Seng Index, Hang Seng China Enterprises Index, Hang Seng TECH Index and Hang Seng China 50 Index.",
|
||||
"content": "小米公司正式成立於2010年4月, 並於2018年7月9日在香港聯交所主板上市。小米公司是一家以智能手機、智能硬件和 IoT 平台為核心的消費電子及智能製造公司。 創新與品質並重,小米不斷追求極致的用戶體驗和運營效率。小米的使命是,始終堅持做\"感動人心、價格厚道\"的好產品,讓全球每個人都能享受科技帶來的美好生活。 小米是全球領先的智能手機公司之一。\n\nXiaomi Corporation was founded in April 2010 and listed on the Main Board of the Hong Kong Stock Exchange on July 9, 2018 (1810.HK). Xiaomi is a consumer electronics and smart manufacturing company with smartphones and smart hardware connected by an IoT platform at its core. With an equal emphasis on innovation and quality, Xiaomi continuously pursues high-quality user experience and operational efficiency. The company relentlessly builds amazing products with honest prices to let everyone in the world enjoy a better life through innovative technology. Xiaomi is one of the world's leading smartphone companies. As of 2024, Xiaomi ranked among the top 3 in the global smartphone market, in terms of smartphone shipments, according to Canalys. The company has also established the world’s leading consumer AIoT (AI+IoT) platform, with 904.6 million smart devices connected to its platform, excluding smartphones, tablets and laptops, as of December 31, 2024. Xiaomi products are present in more than 100 countries and regions around the world. In August 2024, the company listed as Fortune Global 500 for the 6th consecutive year. Xiaomi is a constituent of the Hang Seng Index, Hang Seng China Enterprises Index, Hang Seng TECH Index and Hang Seng China 50 Index.",
|
||||
"reasoning_content": "",
|
||||
"tool_calls": [],
|
||||
"tool_call_id": "call_11acd91586814b969e9298",
|
||||
"time_created": "2025-09-06 23:46:53",
|
||||
"tool_call_id": "call_cf6bfde51c5f4980bc6d68",
|
||||
"time_created": "2025-09-07 15:55:46",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "Xiaomi Corporation's financial performance for 2024 includes the following key points:\n\n- Xiaomi posted robust financial results in the first quarter of 2025, with revenue surging 47.4 percent year-on-year to 111.3 billion yuan ($15.5 billion) [Note: This is for Q1 2025, not 2024] (2025年5月27日).\n\n- Xiaomi reported record-breaking financial results for 2024, with smartphone revenue reaching CNY 191.8 billion ($26.5 billion), accounting for 52% of overall sales. Xiaomi sold 169 million units in 2024 (2025年3月19日).\n\n- Xiaomi Corporation planned to announce its 2024 Annual Results on 18 March 2025, with an investor conference call/audio webcast scheduled for 18 March 2025 (Tuesday) at 08:30pm (Beijing Time) (2025年3月18日).\n\n- In Q2 2024, Xiaomi's ASP (Average Selling Price) was around 1,102 yuan, slightly down year-over-year but still above the 1,100 yuan median (消息于2025年8月19日发布).\n\n- Xiaomi Corporation planned to announce its 2024 Third Quarter Results on 18 November 2024 (Monday), with an investor conference call/audio webcast scheduled for 18 November 2024 (Monday) at 08:30pm (Beijing Time) (2024年11月18日).\n\n- Xiaomi Corporation announced its 2024 Interim Results on 21 August 2024 (Wednesday), with an investor conference call/audio webcast scheduled for 21 August 2024 (Wednesday) at 07:30pm (Beijing Time) (搜索结果收录于2024年8月21日).",
|
||||
"content": "- Xiaomi Corporation reported a historical high in annual revenue for 2024 with JPY365.9 billion, marking a 35% year-on-year increase.\n- The smartphone revenue reached CNY 191.8 billion ($26.5 billion), accounting for 52% of overall sales. Xiaomi sold 169 million units in 2024.\n- In Q2 2024, Xiaomi's ASP (Average Selling Price) was around 1,102 yuan, slightly down year-over-year but still above the 1,100 yuan median.\n- Xiaomi announced its 2024 Annual Results on 18 March 2025, and hosted an investor conference call/audio webcast on the same day at 08:30 pm (Beijing Time).",
|
||||
"reasoning_content": "",
|
||||
"tool_calls": [],
|
||||
"tool_call_id": "call_2cbc0d463fe44742b66fe0",
|
||||
"time_created": "2025-09-06 23:46:53",
|
||||
"tool_call_id": "call_d537006a5856429db13013",
|
||||
"time_created": "2025-09-07 15:55:46",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "- Xiaomi expands its product portfolio with new smart products such as Smart TVs, Air Purifier, Vacuum Cleaner, Trimmer, and more. (Date: 2023年4月14日)\n\n- From immersive entertainment to fitness, fashion, and smart mobility, Xiaomi has enriched its AIoT portfolio, reinforcing its commitment to innovation. (Date: 2025年3月2日)\n\n- Xiaomi Corporation is an Internet company producing smartphones and AIoT (Artificial Intelligence of Things) devices. (Date: 2021年10月18日)\n\n- Xiaomi rebounds on ecosystem; product portfolio expands through branding of hardware made by partner companies. (Date: 2016年10月24日)\n\n- Xiaomi Youpin (小米有品) includes product categories such as footwear and bags, sports and outdoors, pet supplies, tablets, cameras, washing machines, and personal care items. (Date: 2025年6月30日)",
|
||||
"content": "Xiaomi expands its product portfolio with new smart products such as Smart TVs, Air Purifier, Vacuum Cleaner, Trimmer and more. \nFrom immersive entertainment to fitness, fashion, and smart mobility, Xiaomi has enriched its AIoT portfolio, reinforcing its commitment to innovation. \nProduct portfolio expands through branding of hardware made by partner companies. \nXiaomi Corporation is an Internet company producing smartphones and AIoT (Artificial Intelligence of Things) devices.",
|
||||
"reasoning_content": "",
|
||||
"tool_calls": [],
|
||||
"tool_call_id": "call_0b98fa8656d04565867f2f",
|
||||
"time_created": "2025-09-06 23:46:53",
|
||||
"tool_call_id": "call_a23e2b5e71ed4afd91bfb9",
|
||||
"time_created": "2025-09-07 15:55:46",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"content": "Xiaomi's global market share by smartphone shipments was 14.7% in Q2 2025, ranking it in the top three globally. In smartphones priced at RMB4,000 and above, Xiaomi's market share in units sold was 9.6%, an increase of 2.9 percentage points year-over-year.\n\nXiaomi has also established a leading consumer-level AIoT (AI+IoT) platform. As of December 31, 2024, the number of IoT devices connected to Xiaomi's AIoT platform (excluding smartphones, tablets, and notebook computers) reached 905 million. In 2023, nearly ** percent of Xiaomi's revenue was generated from IoT and consumer products.",
|
||||
"content": "小米公司是全球领先的智能手机公司之一。根据Canalys数据,2024年在全球范围内手机出货量排名第三。For smartphones priced at RMB4,000 and above, Xiaomi's smartphone units sold garnered a market share of 9.6%, up 2.9 percentage points YoY. In the 5000 - 6000 yuan price segment, Xiaomi's market share was 15.4%, a year - on - year increase of 6.5 percentage points.\n\n小米还建立了世界领先的消费级AIoT (AI+IoT)平台,截至2024年12月31日,AIoT平台已连接的IoT设备数(不包括智能手机、平板及笔记本电脑)已达到9.05亿。",
|
||||
"reasoning_content": "",
|
||||
"tool_calls": [],
|
||||
"tool_call_id": "call_64f841c67a99493f9e5c62",
|
||||
"time_created": "2025-09-06 23:46:53",
|
||||
"tool_call_id": "call_adec4f13bc4c4b859d2b08",
|
||||
"time_created": "2025-09-07 15:55:46",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "Based on the provided information, here is a comprehensive analysis of Xiaomi Corporation:\n\n### **Company Overview**\n- **Founded**: April 2010\n- **Listing**: Main Board of the Hong Kong Stock Exchange (1810.HK) on July 9, 2018\n- **Core Business**: Consumer electronics and smart manufacturing, with smartphones and AIoT (Artificial Intelligence of Things) devices at its core.\n- **Mission**: To deliver high-quality products at honest prices, enhancing global lifestyles through innovative technology.\n\n### **Market Position & Global Reach**\n- **Smartphones**: Ranked among the top 3 globally in smartphone shipments as of Q2 2025, with a market share of 14.7%. In the premium segment (RMB 4,000+), Xiaomi’s market share reached 9.6%, up 2.9 percentage points year-over-year.\n- **AIoT Platform**: Holds the world’s leading consumer AIoT platform. As of December 31, 2024, over **905 million** smart devices were connected to its platform (excluding smartphones, tablets, and laptops).\n- **Global Presence**: Products are available in more than 100 countries and regions.\n\n### **Financial Performance (2024 Highlights)**\n- **Revenue**: Achieved record-breaking results in 2024, with smartphone revenue reaching **CNY 191.8 billion ($26.5 billion)**, accounting for **52%** of total sales.\n- **Unit Sales**: Sold **169 million smartphones** in 2024.\n- **Average Selling Price (ASP)**: Approximately **1,102 yuan** in Q2 2024, maintaining strong pricing power despite slight year-on-year decline.\n- **Recent Results**: \n - Q1 2025 revenue surged **47.4% year-on-year** to **CNY 111.3 billion ($15.5 billion)**.\n - Interim results for 2024 were announced on August 21, 2024, with an investor call held on the same day.\n\n### **Product Portfolio & Innovation**\n- **Smart Devices**: Expands continuously with Smart TVs, Air Purifiers, Vacuum Cleaners, Trimmers, and more.\n- **Ecosystem Expansion**: Through Xiaomi Youpin (小米有品), the company offers diverse categories including footwear, bags, sports gear, pet supplies, washing machines, personal care items, and cameras.\n- **Innovation Focus**: Emphasis on immersive entertainment, fitness, fashion, and smart mobility, reinforcing its commitment to innovation and user experience.\n\n### **Recognition & Index Inclusion**\n- **Fortune Global 500**: Listed for the **6th consecutive year** (as of August 2024).\n- **Index Constituent**: Part of major indices including:\n - Hang Seng Index\n - Hang Seng China Enterprises Index\n - Hang Seng TECH Index\n - Hang Seng China 50 Index\n\n### **Conclusion**\nXiaomi Corporation has solidified its position as a global leader in both smartphones and AIoT ecosystems. With strong financial performance, expanding product portfolios, and a growing international footprint, Xiaomi continues to innovate and deliver value to consumers worldwide. Its strategic focus on quality, affordability, and ecosystem integration positions it well for sustained growth in the coming years.",
|
||||
"content": "Based on the provided information, here is a comprehensive analysis of Xiaomi Corporation:\n\n### **Company Overview**\n- **Founded**: April 2010\n- **Listing**: Hong Kong Stock Exchange (1810.HK) on July 9, 2018\n- **Core Business**: Smartphones, smart hardware, and IoT platforms.\n- **Mission**: To create \"emotionally touching, reasonably priced\" products that enhance global lifestyles through technology.\n\n### **Market Position & Performance (2024)**\n- **Global Smartphone Market**: Ranked among the top 3 in smartphone shipments globally, according to Canalys.\n - Sold **169 million units** in 2024.\n - Achieved significant market share growth in premium segments:\n - **RMB 4,000+ segment**: 9.6% market share (+2.9 pp YoY).\n - **5,000–6,000 yuan segment**: 15.4% market share (+6.5 pp YoY).\n- **Financial Highlights (2024)**:\n - Record annual revenue: **JPY 365.9 billion** (+35% YoY).\n - Smartphone revenue: **CNY 191.8 billion ($26.5 billion)**, accounting for **52%** of total sales.\n - Q2 2024 Average Selling Price (ASP): ~**1,102 yuan**, maintaining strong pricing power above the 1,100 yuan median.\n\n### **AIoT Ecosystem & Innovation**\n- **World-Leading Consumer AIoT Platform**:\n - As of December 31, 2024, **904.6 million IoT devices** were connected to Xiaomi’s platform (excluding smartphones, tablets, and laptops).\n- **Product Portfolio Expansion**:\n - Diversified into smart home appliances (Smart TVs, Air Purifiers, Vacuum Cleaners, Trimmers), fitness, fashion, and smart mobility.\n - Enhanced product offerings through partnerships and branded hardware from third-party manufacturers.\n\n### **Global Reach & Recognition**\n- Products available in **over 100 countries and regions**.\n- Recognized as a **Fortune Global 500 company** for the **6th consecutive year** (August 2024).\n- Constituent of major indices: Hang Seng Index, Hang Seng China Enterprises Index, Hang Seng TECH Index, and Hang Seng China 50 Index.\n\n### **Conclusion**\nXiaomi Corporation has solidified its position as a global leader in both smartphones and consumer AIoT ecosystems. With record-breaking financial performance in 2024, strong growth in premium smartphone segments, and an expanding portfolio of innovative smart devices, Xiaomi continues to deliver value through innovation and operational efficiency. Its mission-driven approach—combining high-quality products with affordable pricing—resonates across markets worldwide.",
|
||||
"reasoning_content": "",
|
||||
"tool_calls": [],
|
||||
"tool_call_id": "",
|
||||
"time_created": "2025-09-06 23:47:03",
|
||||
"time_created": "2025-09-07 15:55:55",
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
|
|
@ -111,7 +111,7 @@ from flowllm.utils.common_utils import load_env
|
|||
load_env()
|
||||
|
||||
# Initialize embedding model
|
||||
embedding_model = OpenAICompatibleEmbeddingModel(dimensions=1024, model_name="text-embedding-v4")
|
||||
embedding_model = OpenAICompatibleEmbeddingModel(dimensions=64, model_name="text-embedding-v4")
|
||||
|
||||
# Initialize vector store
|
||||
vector_store = LocalVectorStore(
|
||||
|
|
@ -177,7 +177,7 @@ from flowllm.utils.common_utils import load_env
|
|||
load_env()
|
||||
|
||||
# Initialize embedding model
|
||||
embedding_model = OpenAICompatibleEmbeddingModel(dimensions=1024, model_name="text-embedding-v4")
|
||||
embedding_model = OpenAICompatibleEmbeddingModel(dimensions=64, model_name="text-embedding-v4")
|
||||
|
||||
# Initialize vector store
|
||||
vector_store = ChromaVectorStore(
|
||||
|
|
@ -276,7 +276,7 @@ import os
|
|||
load_env()
|
||||
|
||||
# Initialize embedding model
|
||||
embedding_model = OpenAICompatibleEmbeddingModel(dimensions=1024, model_name="text-embedding-v4")
|
||||
embedding_model = OpenAICompatibleEmbeddingModel(dimensions=64, model_name="text-embedding-v4")
|
||||
|
||||
# Initialize vector store
|
||||
vector_store = EsVectorStore(
|
||||
|
|
@ -289,28 +289,30 @@ vector_store = EsVectorStore(
|
|||
|
||||
#### 🎯 Advanced Filtering
|
||||
|
||||
EsVectorStore supports advanced filtering capabilities:
|
||||
EsVectorStore supports advanced filtering capabilities through the `filter_dict` parameter:
|
||||
|
||||
```python
|
||||
# Add term filters (exact match)
|
||||
vector_store.add_term_filter("metadata.category", "technology")
|
||||
vector_store.add_term_filter("metadata.author", "research_team")
|
||||
# Term filters (exact match)
|
||||
term_filter = {
|
||||
"category": "technology",
|
||||
"author": "research_team"
|
||||
}
|
||||
|
||||
# Add range filters (numeric and date ranges)
|
||||
vector_store.add_range_filter("metadata.score", gte=0.8) # Score >= 0.8
|
||||
vector_store.add_range_filter("metadata.confidence", gte=0.5, lte=0.9) # Between 0.5 and 0.9
|
||||
vector_store.add_range_filter("metadata.timestamp", gte="2024-01-01", lte="2024-12-31")
|
||||
# Range filters (numeric and date ranges)
|
||||
range_filter = {
|
||||
"score": {"gte": 0.8}, # Score >= 0.8
|
||||
"confidence": {"gte": 0.5, "lte": 0.9}, # Between 0.5 and 0.9
|
||||
"timestamp": {"gte": "2024-01-01", "lte": "2024-12-31"}
|
||||
}
|
||||
|
||||
# Search with filters applied (filters are combined with AND logic)
|
||||
results = vector_store.search("machine learning", workspace_id, top_k=10)
|
||||
# Combined filters (filters are combined with AND logic)
|
||||
combined_filter = {
|
||||
"category": "AI",
|
||||
"confidence": {"gte": 0.9}
|
||||
}
|
||||
|
||||
# Clear filters for next search
|
||||
vector_store.clear_filter()
|
||||
|
||||
# Method chaining is supported
|
||||
results = vector_store.add_term_filter("metadata.category", "AI") \
|
||||
.add_range_filter("metadata.confidence", gte=0.9) \
|
||||
.search("deep learning", workspace_id, top_k=5)
|
||||
# Search with filters applied
|
||||
results = vector_store.search("machine learning", workspace_id, top_k=10, filter_dict=combined_filter)
|
||||
```
|
||||
|
||||
#### ⚡ Performance Optimization
|
||||
|
|
@ -358,10 +360,12 @@ nodes = [
|
|||
vector_store.insert(nodes, workspace_id, refresh=True)
|
||||
|
||||
# Advanced search with filters
|
||||
vector_store.add_term_filter("metadata.category", "AI")
|
||||
vector_store.add_range_filter("metadata.confidence", gte=0.9)
|
||||
filter_dict = {
|
||||
"category": "AI",
|
||||
"confidence": {"gte": 0.9}
|
||||
}
|
||||
|
||||
results = vector_store.search("transformer models", workspace_id, top_k=5)
|
||||
results = vector_store.search("transformer models", workspace_id, top_k=5, filter_dict=filter_dict)
|
||||
|
||||
for result in results:
|
||||
print(f"Score: {result.metadata.get('score', 'N/A')}")
|
||||
|
|
@ -390,7 +394,7 @@ from flowllm.utils.common_utils import load_env
|
|||
load_env()
|
||||
|
||||
# Initialize embedding model
|
||||
embedding_model = OpenAICompatibleEmbeddingModel(dimensions=1024, model_name="text-embedding-v4")
|
||||
embedding_model = OpenAICompatibleEmbeddingModel(dimensions=64, model_name="text-embedding-v4")
|
||||
|
||||
# Initialize vector store
|
||||
vector_store = MemoryVectorStore(
|
||||
|
|
@ -518,7 +522,7 @@ from flowllm.embedding_model import OpenAICompatibleEmbeddingModel
|
|||
|
||||
# Initialize embedding model
|
||||
embedding_model = OpenAICompatibleEmbeddingModel(
|
||||
dimensions=1024, # Embedding dimensions
|
||||
dimensions=64, # Embedding dimensions
|
||||
model_name="text-embedding-v4", # Model name
|
||||
batch_size=32 # Batch size for embedding generation
|
||||
)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ class RetrieveMemoryOp(BaseLLMOp):
|
|||
assert query, "query should be not empty!"
|
||||
|
||||
workspace_id: str = self.context.workspace_id
|
||||
nodes: List[VectorNode] = await self.vector_store.async_search(query=query, workspace_id=workspace_id, top_k=top_k)
|
||||
nodes: List[VectorNode] = await self.vector_store.async_search(query=query,
|
||||
workspace_id=workspace_id,
|
||||
top_k=top_k)
|
||||
memory_list: List[BaseMemory] = []
|
||||
memory_content_list: List[str] = []
|
||||
for node in nodes:
|
||||
|
|
|
|||
|
|
@ -74,11 +74,11 @@ class LoadTodayMemoryOp(BaseLLMOp):
|
|||
}
|
||||
|
||||
# Search vector store with date filter
|
||||
nodes: List[VectorNode] = await self.vector_store.add_dict_filter(**filter_dict).async_search(
|
||||
nodes: List[VectorNode] = await self.vector_store.async_search(
|
||||
query=" ",
|
||||
workspace_id=workspace_id,
|
||||
top_k=top_k,
|
||||
)
|
||||
filter_dict=filter_dict)
|
||||
|
||||
logger.info(f"Vector store returned {len(nodes)} nodes for today")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue