Linux command
memweave 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Index
memweave index --workspace [.]
Force
memweave index --workspace [.] --force
Index
memweave add [memory/2026-04-26.md] --workspace [.]
Search
memweave search "[PostgreSQL JSONB]" --workspace [.]
Limit
memweave search "[caching layer]" --max-results [3] --min-score [0.3]
Run a keyword-only
memweave search "[Redis]" --strategy [keyword]
Show
memweave search "[topic]" --json
Display
memweave stats --workspace [.]
List
memweave files --workspace [.]
说明
memweave is a Python library and CLI that gives AI agents a persistent, searchable memory whose primary storage format is plain Markdown. Every memory file is hashed, chunked, and embedded into a single local SQLite database that combines FTS5 keyword ranking with sqlite-vec vector search, so retrieval works offline and merges keyword and semantic signals in one ranked list. Each subcommand maps directly onto a method of the underlying MemWeave Python class, which makes it natural to compose memweave with shell pipelines, editor hooks, and CI jobs without writing Python. Embeddings are cached by content hash, so re-running memweave index is cheap when most files are unchanged, and memweave search never invokes an LLM — only the embedding endpoint.
参数
- index
- Walk the workspace and embed any Markdown files whose SHA-256 has changed since the last run.
- add _file_
- Index a single Markdown file immediately.
- search _query_
- Run a hybrid (BM25 keyword + vector) search across the index.
- files
- List every tracked file with source labels and chunk counts.
- stats
- Print a summary of index state, search mode, cache usage, and staleness warnings.
- -w, --workspace _PATH_
- Workspace directory to operate on (default $PWD).
- --embedding-model _NAME_
- Override the embedding model (e.g. text-embedding-3-small).
- --force
- Skip change detection and reprocess every file.
- --max-results _N_
- Maximum number of search hits to return.
- --min-score _F_
- Drop hits below a relevance score.
- --source-filter _NAME_
- Restrict results to a labeled source (e.g. sessions).
- --strategy _NAME_
- Search strategy: hybrid (default), keyword, or semantic.
- --mmr-lambda _F_
- Maximal Marginal Relevance trade-off between relevance and diversity.
- --decay-half-life-days _N_
- Apply temporal decay so older notes rank lower over time.
- --json
- Emit JSON output suitable for piping into other tools.
FAQ
What is the memweave command used for?
memweave is a Python library and CLI that gives AI agents a persistent, searchable memory whose primary storage format is plain Markdown. Every memory file is hashed, chunked, and embedded into a single local SQLite database that combines FTS5 keyword ranking with sqlite-vec vector search, so retrieval works offline and merges keyword and semantic signals in one ranked list. Each subcommand maps directly onto a method of the underlying MemWeave Python class, which makes it natural to compose memweave with shell pipelines, editor hooks, and CI jobs without writing Python. Embeddings are cached by content hash, so re-running memweave index is cheap when most files are unchanged, and memweave search never invokes an LLM — only the embedding endpoint.
How do I run a basic memweave example?
Run `memweave index --workspace [.]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does index do in memweave?
Walk the workspace and embed any Markdown files whose SHA-256 has changed since the last run.