memory-metadata-search by basicmachines-co/basic-memory-skills
npx skills add https://github.com/basicmachines-co/basic-memory-skills --skill memory-metadata-search通过笔记的结构化 frontmatter 字段(而非或同时结合自由文本内容)查找笔记。笔记 frontmatter 中超出标准集合(title、type、tags、permalink、schema)的任何自定义 YAML 键都会自动索引为 entity_metadata 并变得可查询。
status: draft 或 priority: high 的笔记confidence > 0.7 或 的笔记广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
score between 0.3 and 0.8所有元数据搜索都使用 search_notes。通过 metadata_filters 传递筛选器,或使用 tags 和 status 便捷快捷方式。对于仅筛选搜索,请省略 query(或传递 None)。
筛选器是一个 JSON 字典。每个键对应一个 frontmatter 字段;值指定匹配条件。多个键使用 AND 逻辑组合。
{"status": "active"}
{"tags": ["security", "oauth"]}
$in(匹配列表中的任意值){"priority": {"$in": ["high", "critical"]}}
$gt、$gte、$lt、$lte){"confidence": {"$gt": 0.7}}
数值使用数值比较;字符串使用字典序比较。
$between(包含性范围){"score": {"$between": [0.3, 0.8]}}
{"schema.version": "2"}
| 运算符 | 语法 | 示例 |
|---|---|---|
| 相等性 | {"field": "value"} | {"status": "active"} |
| 数组包含 | {"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]}} |
| 嵌套 | {"a.b": "value"} | {"schema.version": "2"} |
规则:
[A-Za-z0-9_-]+(点号分隔嵌套层级)$in 和数组包含要求非空列表$between 要求恰好是 [min, max]警告: 运算符 必须 包含
$前缀 — 写$gte,而不是gte。没有前缀时,筛选器将被视为精确匹配键,并会静默返回无结果。正确示例:{"confidence": {"$gte": 0.7}}。错误示例:{"confidence": {"gte": 0.7}}。
search_notes将 metadata_filters、tags 或 status 传递给 search_notes。对于仅筛选搜索,请省略 query,或者将文本和筛选器结合使用。
# 仅筛选 — 查找具有给定状态的所有笔记
search_notes(metadata_filters={"status": "in-progress"})
# 仅筛选 — 特定项目中的高优先级规范
search_notes(
metadata_filters={"type": "spec", "priority": {"$in": ["high", "critical"]}},
project="research",
page_size=10,
)
# 仅筛选 — 置信度高于阈值的笔记
search_notes(metadata_filters={"confidence": {"$gt": 0.7}})
# 标签和状态的便捷快捷方式
search_notes(status="active")
search_notes(tags=["security", "oauth"])
# 通过元数据缩小的文本搜索
search_notes("authentication", metadata_filters={"status": "draft"})
# 混合文本、标签快捷方式和高级筛选器
search_notes(
"oauth flow",
tags=["security"],
metadata_filters={"confidence": {"$gt": 0.7}},
)
合并规则: tags 和 status 是通过 setdefault 合并到 metadata_filters 中的便捷快捷方式。如果 metadata_filters 中存在相同的键,则显式筛选器优先。
查询中的 tag: 前缀会自动转换为标签筛选器:
# 这些是等价的:
search_notes("tag:tier1")
search_notes("", tags=["tier1"])
# 多个标签(逗号或空格分隔)— 必须全部匹配:
search_notes("tag:tier1,alpha")
一个包含自定义字段的笔记:
---
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]]
查找它的查询:
# 按状态和类型
search_notes(metadata_filters={"status": "in-progress", "type": "spec"})
# 按数值阈值
search_notes(metadata_filters={"confidence": {"$gt": 0.7}})
# 按优先级集合
search_notes(metadata_filters={"priority": {"$in": ["high", "critical"]}})
# 按标签快捷方式
search_notes("tag:security")
# 结合文本 + 元数据
search_notes("OAuth", metadata_filters={"status": "in-progress"})
{"status": "active", "priority": "high"} 要求同时满足两个条件。query。 search_notes(metadata_filters={"status": "active"}) 无需文本查询即可工作。{"schema.version": "2"} 查询 schema 对象内的 version 键。tags 和 status 是常见字段的语法糖。对于其他任何内容,请直接使用 metadata_filters。每周安装次数
37
代码仓库
GitHub 星标数
7
首次出现
2026年2月23日
安全审计
安装于
codex31
claude-code30
cursor30
kimi-cli29
gemini-cli29
opencode29
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.
status: draft or priority: highconfidence > 0.7 or score between 0.3 and 0.8All metadata searching uses search_notes. Pass filters via metadata_filters, or use the tags and status convenience shortcuts. Omit query (or pass None) for filter-only searches.
Filters are a JSON dictionary. Each key targets a frontmatter field; the value specifies the match condition. Multiple keys combine with AND logic.
{"status": "active"}
{"tags": ["security", "oauth"]}
$in (match any value in list){"priority": {"$in": ["high", "critical"]}}
$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]}}
{"schema.version": "2"}
| Operator | Syntax | Example |
|---|---|---|
| Equality | {"field": "value"} | {"status": "active"} |
| Array contains | {"field": ["a", "b"]} | {"tags": ["security", "oauth"]} |
$in | {"field": {"$in": [...]}} | {"priority": {"$in": ["high", "critical"]}} |
Rules:
[A-Za-z0-9_-]+ (dots separate nesting levels)$in and array-contains require non-empty lists$between requires exactly [min, max]Warning: Operators MUST include the
$prefix — write$gte, notgte. Without the prefix the filter is treated as an exact-match key and will silently return no results. Correct:{"confidence": {"$gte": 0.7}}. Wrong:{"confidence": {"gte": 0.7}}.
search_notes with MetadataPass metadata_filters, tags, or status to search_notes. Omit query for filter-only searches, or combine text and filters together.
# Filter-only — find all notes with a given status
search_notes(metadata_filters={"status": "in-progress"})
# Filter-only — high-priority specs in a specific project
search_notes(
metadata_filters={"type": "spec", "priority": {"$in": ["high", "critical"]}},
project="research",
page_size=10,
)
# Filter-only — notes with confidence above a threshold
search_notes(metadata_filters={"confidence": {"$gt": 0.7}})
# Convenience shortcuts for tags and status
search_notes(status="active")
search_notes(tags=["security", "oauth"])
# Text search narrowed by metadata
search_notes("authentication", metadata_filters={"status": "draft"})
# 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.
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")
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_notes(metadata_filters={"status": "in-progress", "type": "spec"})
# By numeric threshold
search_notes(metadata_filters={"confidence": {"$gt": 0.7}})
# By priority set
search_notes(metadata_filters={"priority": {"$in": ["high", "critical"]}})
# By tag shorthand
search_notes("tag:security")
# Combined text + metadata
search_notes("OAuth", metadata_filters={"status": "in-progress"})
{"status": "active", "priority": "high"} requires both conditions.query for filter-only searches. search_notes(metadata_filters={"status": "active"}) works without a text query.{"schema.version": "2"} queries the version key inside a schema object.Weekly Installs
37
Repository
GitHub Stars
7
First Seen
Feb 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex31
claude-code30
cursor30
kimi-cli29
gemini-cli29
opencode29
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
46,600 周安装
Outlook自动化指南:通过Rube MCP与Composio实现邮件、日历、联系人管理
236 周安装
Neon Drizzle 集成指南:为 Neon 数据库设置 Drizzle ORM 的完整解决方案
242 周安装
Rust 心智模型指南:所有权、借用与生命周期核心概念解析
247 周安装
TanStack Query (React Query) 教程:React 异步状态管理与数据获取库
239 周安装
科学问题选择技能:基于Cell论文的科研项目决策框架,提升研究影响力
251 周安装
MongoDB与PostgreSQL数据库指南:选择、查询、优化与部署实战
236 周安装
$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"} |
tagsstatusmetadata_filters