Skip to content

Commit b278276

Browse files
authored
feat: rename search tool to search_notes (#66)
Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 0743ade commit b278276

15 files changed

Lines changed: 53 additions & 52 deletions

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ See the [README.md](README.md) file for a project overview.
107107
1d", "1 week")
108108

109109
**Search & Discovery:**
110-
- `search(query, page, page_size)` - Full-text search across all content with filtering options
110+
- `search_notes(query, page, page_size)` - Full-text search across all content with filtering options
111111

112112
**Visualization:**
113113
- `canvas(nodes, edges, title, folder)` - Generate Obsidian canvas files for knowledge graph visualization
114114

115115
- MCP Prompts for better AI interaction:
116116
- `ai_assistant_guide()` - Guidance on effectively using Basic Memory tools for AI assistants
117117
- `continue_conversation(topic, timeframe)` - Continue previous conversations with relevant historical context
118-
- `search(query, after_date)` - Search with detailed, formatted results for better context understanding
118+
- `search_notes(query, after_date)` - Search with detailed, formatted results for better context understanding
119119
- `recent_activity(timeframe)` - View recently changed items with formatted output
120120
- `json_canvas_spec()` - Full JSON Canvas specification for Obsidian visualization
121121

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ for OS X):
285285
}
286286
```
287287

288-
If you want to use a specific project (see [Multiple Projects](docs/User%20Guide.md#multiple-projects)), update your Claude Desktop
288+
If you want to use a specific project (see [Multiple Projects](docs/User%20Guide.md#multiple-projects)), update your
289+
Claude Desktop
289290
config:
290291

291292
```json
@@ -320,7 +321,7 @@ basic-memory sync --watch
320321
write_note(title, content, folder, tags) - Create or update notes
321322
read_note(identifier, page, page_size) - Read notes by title or permalink
322323
build_context(url, depth, timeframe) - Navigate knowledge graph via memory:// URLs
323-
search(query, page, page_size) - Search across your knowledge base
324+
search_notes(query, page, page_size) - Search across your knowledge base
324325
recent_activity(type, depth, timeframe) - Find recently updated information
325326
canvas(nodes, edges, title, folder) - Generate knowledge visualizations
326327
```

docs/AI Assistant Guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ content = await read_note("specs/search-design") # By path
5353
content = await read_note("memory://specs/search") # By memory URL
5454

5555
# Searching for knowledge
56-
results = await search(
56+
results = await search_notes(
5757
query="authentication system", # Text to search for
5858
page=1, # Optional: Pagination
5959
page_size=10 # Optional: Results per page
@@ -154,7 +154,7 @@ Users will interact with Basic Memory in patterns like:
154154
Human: "What were our decisions about auth?"
155155
156156
You: Let me find that information for you.
157-
[Use search() to find relevant notes]
157+
[Use search_notes() to find relevant notes]
158158
[Then build_context() to understand connections]
159159
```
160160

@@ -251,7 +251,7 @@ When creating relations, you can:
251251
# Example workflow for creating notes with effective relations
252252
async def create_note_with_effective_relations():
253253
# Search for existing entities to reference
254-
search_results = await search("travel")
254+
search_results = await search_notes("travel")
255255
existing_entities = [result.title for result in search_results.primary_results]
256256

257257
# Check if specific entities exist
@@ -323,7 +323,7 @@ Common issues to watch for:
323323
content = await read_note("Document")
324324
except:
325325
# Try search instead
326-
results = await search("Document")
326+
results = await search_notes("Document")
327327
if results and results.primary_results:
328328
# Found something similar
329329
content = await read_note(results.primary_results[0].permalink)
@@ -369,7 +369,7 @@ Common issues to watch for:
369369
- **Create deliberate relations**: Connect each note to at least 2-3 related entities
370370
- **Use existing entities**: Before creating a new relation, search for existing entities
371371
- **Verify wikilinks**: When referencing `[[Entity]]`, use exact titles of existing notes
372-
- **Check accuracy**: Use `search()` or `recent_activity()` to confirm entity titles
372+
- **Check accuracy**: Use `search_notes()` or `recent_activity()` to confirm entity titles
373373
- **Use precise relation types**: Choose specific relation types that convey meaning (e.g., "implements" instead of "relates_to")
374374
- **Consider bidirectional relations**: When appropriate, create inverse relations in both entities
375375

docs/Technical Information.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ flowchart TD
196196
end
197197
198198
BMCP <-->|"write_note() read_note()"| KnowledgeFiles
199-
BMCP <-->|"search() build_context()"| KnowledgeIndex
199+
BMCP <-->|"search_notes() build_context()"| KnowledgeIndex
200200
KnowledgeFiles <-.->|Sync Process| KnowledgeIndex
201201
KnowledgeFiles <-->|Direct Editing| Editors((Text Editors & Git))
202202

src/basic_memory/cli/commands/tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from basic_memory.mcp.tools import build_context as mcp_build_context
1313
from basic_memory.mcp.tools import read_note as mcp_read_note
1414
from basic_memory.mcp.tools import recent_activity as mcp_recent_activity
15-
from basic_memory.mcp.tools import search as mcp_search
15+
from basic_memory.mcp.tools import search_notes as mcp_search
1616
from basic_memory.mcp.tools import write_note as mcp_write_note
1717

1818
# Import prompts
@@ -180,8 +180,8 @@ def recent_activity(
180180
raise
181181

182182

183-
@tool_app.command()
184-
def search(
183+
@tool_app.command("search-notes")
184+
def search_notes(
185185
query: str,
186186
permalink: Annotated[bool, typer.Option("--permalink", help="Search permalink values")] = False,
187187
title: Annotated[bool, typer.Option("--title", help="Search title values")] = False,

src/basic_memory/mcp/prompts/continue_conversation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from basic_memory.mcp.server import mcp
1515
from basic_memory.mcp.tools.build_context import build_context
1616
from basic_memory.mcp.tools.recent_activity import recent_activity
17-
from basic_memory.mcp.tools.search import search
17+
from basic_memory.mcp.tools.search import search_notes
1818
from basic_memory.schemas.base import TimeFrame
1919
from basic_memory.schemas.memory import GraphContext
2020
from basic_memory.schemas.search import SearchQuery, SearchItemType
@@ -47,7 +47,7 @@ async def continue_conversation(
4747

4848
# If topic provided, search for it
4949
if topic:
50-
search_results = await search(
50+
search_results = await search_notes(
5151
SearchQuery(text=topic, after_date=timeframe, types=[SearchItemType.ENTITY])
5252
)
5353

@@ -93,7 +93,7 @@ async def continue_conversation(
9393
## Next Steps
9494
9595
You can:
96-
- Explore more with: `search({{"text": "{topic}"}})`
96+
- Explore more with: `search_notes({{"text": "{topic}"}})`
9797
- See what's changed: `recent_activity(timeframe="{timeframe or "7d"}")`
9898
- **Record new learnings or decisions from this conversation:** `write_note(title="[Create a meaningful title]", content="[Content with observations and relations]")`
9999

src/basic_memory/mcp/prompts/search.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pydantic import Field
1111

1212
from basic_memory.mcp.server import mcp
13-
from basic_memory.mcp.tools.search import search as search_tool
13+
from basic_memory.mcp.tools.search import search_notes as search_tool
1414
from basic_memory.schemas.base import TimeFrame
1515
from basic_memory.schemas.search import SearchQuery, SearchResponse
1616

@@ -144,9 +144,9 @@ def format_search_results(
144144
## Next Steps
145145
146146
You can:
147-
- Refine your search: `search("{query} AND additional_term")`
148-
- Exclude terms: `search("{query} NOT exclude_term")`
149-
- View more results: `search("{query}", after_date=None)`
147+
- Refine your search: `search_notes("{query} AND additional_term")`
148+
- Exclude terms: `search_notes("{query} NOT exclude_term")`
149+
- View more results: `search_notes("{query}", after_date=None)`
150150
- Check recent activity: `recent_activity()`
151151
152152
## Synthesize and Capture Knowledge

src/basic_memory/mcp/resources/ai_assistant_guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ content = await read_note("specs/search-design") # By path
4949
content = await read_note("memory://specs/search") # By memory URL
5050

5151
# Searching for knowledge
52-
results = await search(
52+
results = await search_notes(
5353
query="authentication system", # Text to search for
5454
page=1, # Optional: Pagination
5555
page_size=10 # Optional: Results per page
@@ -154,7 +154,7 @@ Users will interact with Basic Memory in patterns like:
154154
Human: "What were our decisions about auth?"
155155
156156
You: Let me find that information for you.
157-
[Use search() to find relevant notes]
157+
[Use search_notes() to find relevant notes]
158158
[Then build_context() to understand connections]
159159
```
160160

@@ -263,7 +263,7 @@ When creating relations, you can:
263263
# Example workflow for creating notes with effective relations
264264
async def create_note_with_effective_relations():
265265
# Search for existing entities to reference
266-
search_results = await search("travel")
266+
search_results = await search_notes("travel")
267267
existing_entities = [result.title for result in search_results.primary_results]
268268

269269
# Check if specific entities exist
@@ -335,7 +335,7 @@ Common issues to watch for:
335335
content = await read_note("Document")
336336
except:
337337
# Try search instead
338-
results = await search("Document")
338+
results = await search_notes("Document")
339339
if results and results.primary_results:
340340
# Found something similar
341341
content = await read_note(results.primary_results[0].permalink)
@@ -381,7 +381,7 @@ Common issues to watch for:
381381
- **Create deliberate relations**: Connect each note to at least 2-3 related entities
382382
- **Use existing entities**: Before creating a new relation, search for existing entities
383383
- **Verify wikilinks**: When referencing `[[Entity]]`, use exact titles of existing notes
384-
- **Check accuracy**: Use `search()` or `recent_activity()` to confirm entity titles
384+
- **Check accuracy**: Use `search_notes()` or `recent_activity()` to confirm entity titles
385385
- **Use precise relation types**: Choose specific relation types that convey meaning (e.g., "implements" instead
386386
of "relates_to")
387387
- **Consider bidirectional relations**: When appropriate, create inverse relations in both entities

src/basic_memory/mcp/tools/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from basic_memory.mcp.tools.recent_activity import recent_activity
1313
from basic_memory.mcp.tools.read_note import read_note
1414
from basic_memory.mcp.tools.write_note import write_note
15-
from basic_memory.mcp.tools.search import search
15+
from basic_memory.mcp.tools.search import search_notes
1616
from basic_memory.mcp.tools.canvas import canvas
1717

1818
__all__ = [
@@ -22,6 +22,6 @@
2222
"read_content",
2323
"read_note",
2424
"recent_activity",
25-
"search",
25+
"search_notes",
2626
"write_note",
2727
]

src/basic_memory/mcp/tools/read_note.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from basic_memory.mcp.async_client import client
88
from basic_memory.mcp.server import mcp
9-
from basic_memory.mcp.tools.search import search
9+
from basic_memory.mcp.tools.search import search_notes
1010
from basic_memory.mcp.tools.utils import call_get
1111
from basic_memory.schemas.memory import memory_url_path
1212
from basic_memory.schemas.search import SearchQuery
@@ -63,7 +63,7 @@ async def read_note(identifier: str, page: int = 1, page_size: int = 10) -> str:
6363

6464
# Fallback 1: Try title search via API
6565
logger.info(f"Search title for: {identifier}")
66-
title_results = await search(SearchQuery(title=identifier))
66+
title_results = await search_notes(SearchQuery(title=identifier))
6767

6868
if title_results and title_results.results:
6969
result = title_results.results[0] # Get the first/best match
@@ -87,7 +87,7 @@ async def read_note(identifier: str, page: int = 1, page_size: int = 10) -> str:
8787

8888
# Fallback 2: Text search as a last resort
8989
logger.info(f"Title search failed, trying text search for: {identifier}")
90-
text_results = await search(SearchQuery(text=identifier))
90+
text_results = await search_notes(SearchQuery(text=identifier))
9191

9292
# We didn't find a direct match, construct a helpful error message
9393
if not text_results or not text_results.results:

0 commit comments

Comments
 (0)