You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: opencontext/tools/operation_tools/web_search_tool.py
+35-1Lines changed: 35 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,41 @@ def get_name(cls) -> str:
43
43
44
44
@classmethod
45
45
defget_description(cls) ->str:
46
-
return"Search the internet for the latest information. Supports keyword search, returns relevant webpage titles, summaries, and links. Suitable for obtaining real-time information, news, technical documentation, etc."
46
+
return"""Internet search tool for retrieving real-time information from the web. Returns relevant webpage titles, snippets, and URLs based on search queries.
47
+
48
+
**When to use this tool:**
49
+
- When you need current, real-time information not in the local knowledge base
50
+
- When looking for recent news, events, or updates
51
+
- When seeking external references, documentation, or resources
52
+
- When the user's question requires up-to-date information beyond the system's stored context
53
+
- When verifying facts or finding additional sources
54
+
55
+
**When NOT to use this tool:**
56
+
- For searching stored contexts or history → use text_search, filter_context
57
+
- For entity lookups within the system → use profile_entity instead
58
+
- When the answer can be found in local context → prioritize local tools first
59
+
- For information that doesn't require real-time data
60
+
61
+
**Key features:**
62
+
- Keyword-based web search with natural language support
63
+
- Returns webpage titles, summaries, and links
64
+
- Configurable result count (1-20, default 5)
65
+
- Language preference support (zh-cn, en, ja, etc.)
66
+
- Uses DuckDuckGo for privacy-focused search
67
+
- Automatic proxy support for restricted networks
68
+
69
+
**Best practices:**
70
+
- Use specific, focused search queries for better results
71
+
- Specify language preference when appropriate
72
+
- Combine with local search tools to provide comprehensive answers
73
+
- Use when local context is insufficient or outdated
74
+
75
+
**Use cases:**
76
+
- "What's the latest news about AI developments?" → web_search
77
+
- "Find documentation for library X version Y" → web_search
78
+
- "What happened in the world today?" → web_search
Copy file name to clipboardExpand all lines: opencontext/tools/profile_tools/profile_entity_tool.py
+43-1Lines changed: 43 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,49 @@ def get_name(cls) -> str:
45
45
46
46
@classmethod
47
47
defget_description(cls) ->str:
48
-
return"Unified entity management tool, supports exact search, similar search, relationship checking, creation and update of entities"
48
+
return"""Entity profile management tool for finding, matching, and exploring entities (people, projects, organizations, etc.) and their relationships. Provides intelligent entity resolution and relationship network analysis.
49
+
50
+
**When to use this tool:**
51
+
- When you need detailed information about a specific entity (person, project, team, organization)
52
+
- When resolving entity names to their canonical forms (e.g., "John" → "John Smith")
53
+
- When checking relationships between two entities (e.g., "Is Alice related to Project X?")
54
+
- When exploring an entity's relationship network (friends, collaborators, team members)
55
+
- When finding similar entities based on names or descriptions
56
+
57
+
**When NOT to use this tool:**
58
+
- For general content searches → use text_search instead
59
+
- For time-based filtering → use filter_context instead
60
+
- When searching for contexts mentioning entities → use text_search or filter_context with entity filter
61
+
62
+
**Supported operations:**
63
+
- **find_exact_entity**: Lookup entity by exact canonical name or alias
64
+
- **find_similar_entity**: Find entities with similar names or descriptions (fuzzy matching)
return"Document retrieval tool providing document-level and chunk-level exact and semantic search. Supports raw_id retrieval, document aggregation and context expansion"
51
+
return"""Document-level retrieval tool specialized for finding and aggregating information from structured documents. Retrieves by document identifiers or searches semantically across document chunks with intelligent aggregation.
52
+
53
+
**When to use this tool:**
54
+
- When you need to retrieve a specific document by its identifier (raw_type and raw_id)
55
+
- When searching within document collections (e.g., "find documents about project planning")
56
+
- When you want document-level aggregation rather than scattered chunks
57
+
- When exploring related document chunks with context expansion
58
+
- When retrieving from specific document types (vaults, files, etc.)
59
+
60
+
**When NOT to use this tool:**
61
+
- For general context searches across all types → use text_search or filter_context instead
62
+
- For entity-specific lookups → use profile_entity instead
63
+
- For simple time-based filtering → use filter_context instead
64
+
65
+
**Retrieval modes:**
66
+
- **document**: Retrieves and aggregates at document level (best for getting complete documents)
67
+
- **chunk**: Returns individual chunks without aggregation (best for precise chunk-level results)
68
+
- **hybrid**: Combines chunk-level precision with document-level aggregation (balanced approach)
69
+
- **context**: Expands search to include related chunks from same document (best for comprehensive context)
70
+
71
+
**Key features:**
72
+
- Document-level aggregation (groups chunks by raw_id)
73
+
- Supports both exact match (by raw_id) and semantic search
74
+
- Context expansion to find related chunks within documents
75
+
- Flexible filtering by document type (raw_type), entities, and time range
76
+
- Configurable aggregation and result count (top_k: 1-100, default 10)
77
+
- Returns document metadata including chunk count and relevance scores
78
+
79
+
**Use cases:**
80
+
- "Get document by vault ID 'abc123'"
81
+
- "Find all notes about machine learning with document aggregation"
82
+
- "Search within technical documentation with context expansion"
83
+
- "Retrieve chunks from specific file type with high relevance scores"
returnf"""Directly retrieve context records of specified types through precise filter conditions without semantic matching. Suitable for exact retrieval scenarios with clear query conditions, such as searching by time range, filtering by entities, retrieving by context type, and other structured queries. Supports multi-dimensional combination filtering and flexible sorting methods, efficiently locating target records from large amounts of data. Supports the following context types:\n{descriptions_text}"""
37
+
returnf"""Direct filter-based retrieval tool that returns records matching exact criteria without semantic analysis. Uses structured filtering for precise, deterministic results.
38
+
39
+
**When to use this tool:**
40
+
- When you need records from a specific time range (e.g., "all activities from yesterday", "contexts between 10am-2pm")
41
+
- When filtering by specific entities (e.g., "contexts mentioning person X", "all records related to project Y")
42
+
- When you need to retrieve all records of a specific context type without searching by content
returnf"""Intelligent semantic search using natural language queries, finding the most relevant content from specified types of context records based on vector similarity matching. Suitable for fuzzy queries, concept search, content understanding and other scenarios, capable of understanding query intent and returning semantically related results. Supports advanced features such as time range filtering and entity screening. Supports the following context types:\n{descriptions_text}"""
37
+
returnf"""Semantic search tool for finding contextually relevant information using natural language queries. Returns ranked results based on meaning and relevance rather than exact keyword matches.
38
+
39
+
**When to use this tool:**
40
+
- When the query involves concepts, themes, or topics (e.g., "learning activities about machine learning", "discussions about project planning")
41
+
- When looking for information semantically related to a description or question
42
+
- When exact keywords are unknown but the general topic or meaning is clear
43
+
- When exploring historical activities, knowledge, or discussions by topic
44
+
- When filtering by context type (activity, intent, semantic, procedural, state, entity)
45
+
- When time-based filtering or entity screening is needed
46
+
47
+
**When NOT to use this tool:**
48
+
- For precise entity lookups → use profile_entity instead
49
+
- For structured data filtering → use filter_context instead
50
+
51
+
**Key features:**
52
+
- Understands query intent and finds semantically similar content
53
+
- Supports time range filtering (start/end timestamps with timezone)
54
+
- Supports entity-based filtering (find contexts mentioning specific people/projects)
55
+
- Configurable result count (top_k: 1-100, default 20)
0 commit comments