Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
basicmachines-co avatar

Memory Metadata Search

  • 487 installs
  • 25 repo stars
  • Updated April 20, 2026
  • basicmachines-co/basic-memory-skills

memory-metadata-search is an agent skill that queries Basic Memory notes by custom YAML frontmatter fields using equality, range, array, and nested filters for developers who need structured agent memory retrieval.

About

memory-metadata-search is an AI & Agent Building skill for Basic Memory that lets agents find notes by structured frontmatter instead of free-text search alone. Any custom YAML key beyond the five standard fields—title, type, tags, permalink, and schema—is indexed as entity_metadata and queryable through the search_notes tool. The skill documents seven filter operators including $in, $gt, $gte, $lt, $lte, and $between, plus dot notation for nested keys like schema.version. Developers combine metadata_filters with optional text queries, or use tags and status shortcuts for filter-only searches. memory-metadata-search is the right skill when an agent must recall notes by status, priority, confidence thresholds, or invented custom fields without scanning entire conversation logs.

  • Filter memories by tags, time, source, and custom fields
  • Avoids brute-force reload of full chat transcripts
  • Enables precise recall for multi-session agents
  • Complements schema and lifecycle skills in basic-memory-skills
  • Reduces token waste from irrelevant historical context

Memory Metadata Search by the numbers

  • 487 all-time installs (skills.sh)
  • Ranked #1,797 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/basicmachines-co/basic-memory-skills --skill memory-metadata-search

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs487
repo stars25
Last updatedApril 20, 2026
Repositorybasicmachines-co/basic-memory-skills

How do agents search memory by YAML metadata?

Query agent memory stores by tags, timestamps, source, and custom metadata so agents retrieve the right prior facts instead of reloading entire conversation history.

Who is it for?

Agent developers using Basic Memory who store structured frontmatter on notes and need precise metadata filtering during long-running sessions.

Skip if: Teams not using Basic Memory or developers who only need full-text search without YAML frontmatter indexing.

When should I use this skill?

User asks to find agent memory notes by status, priority, confidence, custom YAML fields, or tag metadata rather than content alone.

What you get

Filtered note results from search_notes with metadata_filters, tag shortcuts, and combined text-plus-metadata queries.

  • filtered note result sets
  • metadata query patterns

By the numbers

  • Documents 7 metadata filter operator types
  • Indexes custom YAML keys beyond 5 standard frontmatter fields

Files

SKILL.mdMarkdownGitHub ↗

Memory Metadata Search

Find notes by their structured frontmatter fields instead of (or in addition to) free-text content. Any custom YAML key in a note's frontmatter beyond the standard set (title, type, tags, permalink, schema) is automatically indexed as entity_metadata and becomes queryable.

When to Use

  • Filtering by status or priority — find all notes with status: draft or priority: high
  • Querying custom fields — any frontmatter key you invent is searchable
  • Range queries — find notes with confidence > 0.7 or score between 0.3 and 0.8
  • Combining text + metadata — narrow a text search with structured constraints
  • Tag-based filtering — find notes tagged with specific frontmatter tags
  • Schema-aware queries — filter by nested schema fields using dot notation

Two Tools, Two Patterns

ToolUse When
search_by_metadataMetadata filters only, no text query needed
search_notesCombining a text query with metadata filters

Both accept the same filter syntax.

Filter Syntax

Filters are a JSON dictionary. Each key targets a frontmatter field; the value specifies the match condition. Multiple keys combine with AND logic.

Equality

{"status": "active"}

Array Contains (all listed values must be present)

{"tags": ["security", "oauth"]}

$in (match any value in list)

{"priority": {"$in": ["high", "critical"]}}

Comparisons ($gt, $gte, $lt, $lte)

{"confidence": {"$gt": 0.7}}

Numeric values use numeric comparison; strings use lexicographic comparison.

$between (inclusive range)

{"score": {"$between": [0.3, 0.8]}}

Nested Access (dot notation)

{"schema.version": "2"}

Quick Reference

OperatorSyntaxExample
Equality{"field": "value"}{"status": "active"}
Array contains{"field": ["a", "b"]}{"tags": ["security", "oauth"]}
$in{"field": {"$in": [...]}}{"priority": {"$in": ["high", "critical"]}}
$gt / $gte{"field": {"$gt": N}}{"confidence": {"$gt": 0.7}}
$lt / $lte{"field": {"$lt": N}}{"score": {"$lt": 0.5}}
$between{"field": {"$between": [lo, hi]}}{"score": {"$between": [0.3, 0.8]}}
Nested{"a.b": "value"}{"schema.version": "2"}

Rules:

  • Keys must match [A-Za-z0-9_-]+ (dots separate nesting levels)
  • Operator dicts must contain exactly one operator
  • $in and array-contains require non-empty lists
  • $between requires exactly [min, max]

Using search_by_metadata

Metadata-only search. Results are scoped to entity-level items.

# All notes with status "in-progress"
search_by_metadata(filters={"status": "in-progress"})

# High-priority specs in a specific project
search_by_metadata(
    filters={"type": "spec", "priority": {"$in": ["high", "critical"]}},
    project="research",
    limit=10,
)

# Notes with confidence above a threshold
search_by_metadata(filters={"confidence": {"$gt": 0.7}})

# Paginate through results
search_by_metadata(filters={"type": "meeting"}, limit=10, offset=20)

Using search_notes with Metadata

Combine text search with structured filters by passing metadata_filters, tags, or status alongside the text query.

# Text search narrowed by metadata
search_notes("authentication", metadata_filters={"status": "draft"})

# Filter-only (empty query string)
search_notes("", metadata_filters={"type": "spec"})

# Convenience shortcuts for tags and status
search_notes("planning", status="active")
search_notes("", tags=["security", "oauth"])

# Mix text, tag shortcut, and advanced filter
search_notes(
    "oauth flow",
    tags=["security"],
    metadata_filters={"confidence": {"$gt": 0.7}},
)

Merging rules: tags and status are convenience shortcuts merged into metadata_filters via setdefault. If the same key exists in metadata_filters, the explicit filter wins.

Tag Search Shorthand

The tag: prefix in a query converts to a tag filter automatically:

# These are equivalent:
search_notes("tag:tier1")
search_notes("", tags=["tier1"])

# Multiple tags (comma or space separated) — all must match:
search_notes("tag:tier1,alpha")

Example: Custom Frontmatter in Practice

A note with custom fields:

---
title: Auth Design
type: spec
tags: [security, oauth]
status: in-progress
priority: high
confidence: 0.85
---

# Auth Design

## Observations
- [decision] Use OAuth 2.1 with PKCE for all client types #security
- [requirement] Token refresh must be transparent to the user

## Relations
- implements [[Security Requirements]]

Queries that find it:

# By status and type
search_by_metadata(filters={"status": "in-progress", "type": "spec"})

# By numeric threshold
search_by_metadata(filters={"confidence": {"$gt": 0.7}})

# By priority set
search_by_metadata(filters={"priority": {"$in": ["high", "critical"]}})

# By tag shorthand
search_notes("tag:security")

# Combined text + metadata
search_notes("OAuth", metadata_filters={"status": "in-progress"})

Guidelines

  • Use metadata search for structured queries. If you're looking for notes by a known field value (status, priority, type), metadata filters are more precise than text search.
  • Use text search for content queries. If you're looking for notes about something, text search is better. Combine both when you need precision.
  • Custom fields are free. Any YAML key you put in frontmatter becomes queryable — no schema or configuration required.
  • Multiple filters are AND. {"status": "active", "priority": "high"} requires both conditions.
  • Prefer `search_by_metadata` for filter-only queries. It's purpose-built and returns entity-level results. Use search_notes with empty query only when you also need text search features.
  • Dot notation for nesting. Access nested YAML structures with dots: {"schema.version": "2"} queries the version key inside a schema object.
  • Tags shortcut is convenient but limited. tags and status are sugar for common fields. For anything else, use metadata_filters directly.

Related skills

How it compares

Use memory-metadata-search over free-text memory recall when notes carry structured status, priority, or confidence fields that agents must filter precisely.

FAQ

How does memory-metadata-search filter Basic Memory notes?

memory-metadata-search passes metadata_filters to the search_notes tool with JSON conditions like equality, $in lists, numeric comparisons, and $between ranges. Multiple keys combine with AND logic, and custom YAML frontmatter fields beyond title, type, tags, permalink, and schem

Can memory-metadata-search run without a text query?

Yes. memory-metadata-search supports filter-only searches by omitting the query parameter and passing metadata_filters alone, such as search_notes(metadata_filters={"status": "in-progress"}). Tags and status parameters are convenience shortcuts merged into metadata_filters.

AI & Agent Buildingagentsresearch

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.