Skip to main content

Overview

Basic Memory provides powerful search capabilities that help you find information quickly. You can search by:
  • Full-text content
  • Note titles
  • Permalinks and paths
  • Tags and metadata
  • Date ranges
  • Entity types
The simplest way to search is with a text query:
search_notes("coffee brewing")
This searches across all content in your knowledge base, including:
  • Note titles
  • Observation content
  • Relation context
  • Frontmatter fields

Search Types

Basic Memory supports several search modes:
Full-text search using SQLite’s FTS5 engine:
search_notes("project planning", search_type="text")
Features:
  • Fast searching across large knowledge bases
  • Boolean operators (AND, OR, NOT)
  • Phrase search with quotes
  • Prefix matching
Best for:
  • General content search
  • Boolean queries
  • Performance-critical searches
Use boolean operators for precise queries:

AND Operator

Find notes containing all terms:
search_notes("coffee AND brewing")
search_notes("authentication AND security AND jwt")

OR Operator

Find notes containing any term:
search_notes("meeting OR discussion")
search_notes("redis OR memcached OR cache")

NOT Operator

Exclude terms from results:
search_notes("project NOT archived")
search_notes("database NOT mongodb")

Grouping

Combine operators with parentheses:
search_notes("(coffee OR tea) AND brewing")
search_notes("(bug OR issue) AND NOT resolved")
search_notes("(api OR endpoint) AND (auth OR authentication)")
Use quotes for exact phrase matching:
search_notes('"weekly standup meeting"')
search_notes('"pour over coffee"')
search_notes('"technical debt"')

Advanced Filters

Filter by Tags

Search within specific tags:
search_notes("architecture", tags=["security"])
search_notes("design", tags=["api", "rest"])

Filter by Note Type

Search specific note types:
search_notes("meeting", note_types=["meeting"])
search_notes("paul", note_types=["person"])
search_notes("project", note_types=["note", "project"])

Filter by Entity Type

Search specific entity types:
search_notes("performance", entity_types=["observation"])
search_notes("related", entity_types=["relation"])

Filter by Date

Find recent or date-range content:
search_notes("bug", after_date="1 week")
search_notes("meeting", after_date="3 days")
search_notes("decision", after_date="1 month")

Filter by Status

Filter by frontmatter status field:
search_notes("task", status="in-progress")
search_notes("project", status="active")

Custom Metadata Filters

Filter using custom frontmatter fields:
search_notes(
    "api",
    metadata_filters={"priority": "high"}
)

Combining Filters

Combine multiple filters for precise results:
search_notes(
    "authentication",
    note_types=["note", "technical"],
    tags=["security"],
    after_date="1 month",
    metadata_filters={"status": "active"}
)
You can search using only filters without a text query:
# All notes with specific tag
search_notes(tags=["security"])

# All notes with specific status
search_notes(status="in-progress")

# All recent notes of specific type
search_notes(
    note_types=["meeting"],
    after_date="1 week"
)

# Complex filter-only query
search_notes(
    metadata_filters={"priority": "high"},
    tags=["urgent"],
    after_date="3 days"
)

Pagination

Control result pagination:
# First page (default)
search_notes("coffee", page=1, page_size=10)

# Next page
search_notes("coffee", page=2, page_size=10)

# Larger page size
search_notes("coffee", page=1, page_size=50)

Pattern Matching

Use wildcards in permalink search:
# All notes in a directory
search_notes("docs/*", search_type="permalink")

# Nested pattern
search_notes("projects/*/requirements", search_type="permalink")

# Prefix match
search_notes("auth*", search_type="permalink")

# Suffix match
search_notes("*/2024", search_type="permalink")

Content Patterns

Use special patterns in text search:
# Tag search (FTS mode)
search_notes("tag:security", search_type="text")

# Category search
search_notes("category:decision", search_type="text")

Discovery Tools

Recent Activity

Find recently updated content:
# Last week's updates
recent_activity(timeframe="7d")

# Last 24 hours
recent_activity(timeframe="24h")

# Natural language
recent_activity(timeframe="last week")
recent_activity(timeframe="3 days ago")

Browse Directories

Explore content by location:
# List root directory
list_directory("/")

# List specific folder
list_directory("/docs")

# With depth
list_directory("/projects", depth=2)

# Filter by pattern
list_directory("/notes", file_name_glob="*.md")

Build Context

Navigate the knowledge graph:
# Get context for a topic
build_context("memory://specs/search")

# With depth (follow more relations)
build_context("memory://architecture/auth", depth=2)

# Recent context only
build_context(
    "memory://project/planning",
    timeframe="1 week"
)

Example Workflows

Finding Meeting Notes

1

Search by Type

search_notes(note_types=["meeting"])
2

Filter by Date

search_notes(
    note_types=["meeting"],
    after_date="1 week"
)
3

Add Text Filter

search_notes(
    "authentication",
    note_types=["meeting"],
    after_date="1 week"
)

Finding Technical Decisions

1

Search by Category

search_notes("category:decision")
2

Add Topic

search_notes("database category:decision")
3

Filter by Tag

search_notes(
    "database category:decision",
    tags=["architecture"]
)
1

Start with Build Context

build_context("memory://authentication-system")
2

Search Related Topics

search_notes("jwt OR token OR auth")
3

Check Recent Changes

search_notes(
    "authentication",
    after_date="1 week"
)

Search Tips

Begin with a general query, then add filters:
# Start broad
search_notes("performance")

# Add filters
search_notes("performance", tags=["optimization"])

# Narrow further
search_notes(
    "performance",
    tags=["optimization"],
    after_date="1 month"
)
Use search to find starting points, then build context:
# Find starting point
results = search_notes("authentication")

# Build context from result
context = build_context(f"memory://{results[0].permalink}")
When you don’t know what to search for:
# See what's been updated
recent_activity(timeframe="7d")

# Then search based on what you find
search_notes("specific topic from recent activity")
Organize notes hierarchically and search within folders:
# Search specific area
search_notes("docs/architecture/*", search_type="permalink")

# Then search content within
search_notes(
    "authentication",
    note_types=["note"],
    # Use metadata filter for path if available
)

Troubleshooting

Try these strategies:
  1. Broaden your search
    # Instead of
    search_notes("specific long phrase")
    # Try
    search_notes("specific OR phrase")
    
  2. Check spelling
    # Try variations
    search_notes("authentication OR authentification")
    
  3. Use different search type
    # Try semantic instead of text
    search_notes("concept", search_type="semantic")
    
  4. Remove filters
    # Temporarily remove date/type filters
    search_notes("query")  # without filters
    
Narrow results with filters:
# Add date filter
search_notes("query", after_date="1 month")

# Add type filter
search_notes("query", note_types=["note"])

# Use AND instead of OR
search_notes("term1 AND term2")  # more restrictive
Common issues:
  1. Unmatched quotes
    # Wrong
    search_notes('"incomplete quote')
    # Right
    search_notes('"complete quote"')
    
  2. Invalid operators
    # Wrong
    search_notes("term1 & term2")
    # Right
    search_notes("term1 AND term2")
    
  3. Special characters
    # Avoid
    search_notes("term+with*specials")
    # Use simple terms
    search_notes("term with specials")
    

Next Steps

Writing Notes

Learn how to write searchable notes

Managing Projects

Organize search across multiple projects

Building Context

Navigate your knowledge graph

Search API Reference

Complete search API documentation

Build docs developers (and LLMs) love