{"id":47281154,"url":"https://github.com/edochi/mdvs","last_synced_at":"2026-06-08T00:01:54.106Z","repository":{"id":344642634,"uuid":"1164271968","full_name":"edochi/mdvs","owner":"edochi","description":"Schema inference, frontmatter validation, and semantic search for markdown directories","archived":false,"fork":false,"pushed_at":"2026-06-02T21:35:20.000Z","size":3827,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-02T23:13:24.116Z","etag":null,"topics":["cli","embeddings","frontmatter","markdown","parquet","rust","semantic-search","validation","word2vec"],"latest_commit_sha":null,"homepage":"https://edochi.github.io/mdvs/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edochi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-22T22:04:53.000Z","updated_at":"2026-06-02T21:33:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/edochi/mdvs","commit_stats":null,"previous_names":["edochi/mdvs"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/edochi/mdvs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edochi%2Fmdvs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edochi%2Fmdvs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edochi%2Fmdvs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edochi%2Fmdvs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edochi","download_url":"https://codeload.github.com/edochi/mdvs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edochi%2Fmdvs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34042554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","embeddings","frontmatter","markdown","parquet","rust","semantic-search","validation","word2vec"],"created_at":"2026-03-16T00:29:11.482Z","updated_at":"2026-06-08T00:01:54.098Z","avatar_url":"https://github.com/edochi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mdvs — Markdown Validation \u0026 Search\n\n\u003cdiv align=\"center\"\u003e\n\n**An in-process validation \u0026 search engine for markdown documents — schema inference, frontmatter validation, and local semantic search.**\n\n[![CI status](https://github.com/edochi/mdvs/actions/workflows/ci.yml/badge.svg)](https://github.com/edochi/mdvs/actions/workflows/ci.yml)\n[![Crates.io version](https://img.shields.io/crates/v/mdvs.svg?color=orange)](https://crates.io/crates/mdvs)\n[![Documentation](https://img.shields.io/badge/docs-mdBook-green.svg)](https://edochi.github.io/mdvs/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n---\n\n[Why mdvs?](#why-mdvs) • [What it does](#what-it-does) • [Installation](#install) • [Documentation](https://edochi.github.io/mdvs/) • [Example Vault](example_kb/)\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/demo.gif\" alt=\"mdvs: init, check, validate, build, search\" width=\"800\"\u003e\n\u003c/p\u003e\n\n## Why mdvs?\n\nmdvs is useful when you have a markdown corpus with structured frontmatter. Some common cases:\n\n- **Obsidian vaults** — typed-frontmatter notes you want to keep validated and searchable, all local.\n- **Knowledge bases maintained with LLM agents** — mdvs is the typed database the agent reads from (hybrid search with SQL `--where` filters) and validates against (`mdvs check` after each turn). Everything via `--output json`.\n- **Docs-as-code repos** (Hugo, MkDocs, Astro) — frontmatter consistency enforced in CI; JSON Schema export for downstream tools.\n\n## What it does\n\n- **Infers a typed schema from your existing files.** No config to write — point it at a directory and it figures out which fields belong where.\n- **Validates frontmatter.** Catches wrong types, missing required fields, and disallowed locations. Path-scoped rules: `role` can be required in `team/` but not in `blog/`.\n- **Multi-format frontmatter.** YAML (`---`), TOML (`+++`), or JSON (`{...}`), auto-detected per file. Mix freely within one vault.\n- **Hybrid search.** Vector similarity + BM25 full-text + RRF fusion. SQL `--where` filters on typed frontmatter: `--where \"status = 'published' AND date \u003e '2026-05-01'\"`.\n- **JSON Schema interop.** `mdvs export-jsonschema` emits a JSON Schema 2020-12 document; `mdvs init --from-jsonschema` imports one.\n- **Runs entirely in-process.** Local files, single binary. No API keys, no vector-DB cluster, no GPU.\n- **Incremental builds.** Only changed files are re-embedded; the Lance write itself is also incremental (delete + append + optimize, not a full overwrite). If nothing changed, the model isn't loaded and the index isn't rewritten.\n- **Auto-pipeline.** `search` auto-builds the index if needed. `build` auto-updates the schema before embedding. The whole chain is cheap on unchanged corpora — so a bare `mdvs search \"query\"` does everything in one shot.\n- **Agent-callable and CI-ready.** `--output json` on every command. Deterministic exit codes (`0` = success, `1` = violations, `2` = error).\n\n## Install\n\n### Prebuilt binary (macOS / Linux)\n\n```bash\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/edochi/mdvs/releases/latest/download/mdvs-installer.sh | sh\n```\n\n### From crates.io\n\n```bash\ncargo install mdvs\n```\n\n### From source\n\n```bash\ngit clone https://github.com/edochi/mdvs.git\ncd mdvs\ncargo install --path .\n```\n\n## How it works\n\nMarkdown files can have a block at the top called **frontmatter** — structured fields that describe the document. mdvs accepts YAML (`---`), TOML (`+++`), or JSON (`{...}`); the format is auto-detected per file, so mixed-format vaults work transparently.\n\n```markdown\n---\ntitle: Rust Tips\ntags: [rust, programming]\ndraft: false\n---\n\n# Rust Tips\n\nYour content here...\n```\n\n`title`, `tags`, and `draft` are frontmatter fields. mdvs treats them as a typed database — and your directory structure is part of the schema.\n\nConsider a simple knowledge base:\n\n```\nnotes/\n├── blog/\n│   ├── rust-tips.md        ← title, tags, draft\n│   └── half-baked-idea.md  ← title, draft\n├── team/\n│   ├── alice.md            ← title, role, email\n│   └── bob.md              ← title, role\n└── meetings/\n    └── weekly.md           ← title, date, attendees\n```\n\nDifferent directories, different fields. mdvs sees this.\n\n### Infer\n\n```bash\ncd notes/\nmdvs init\n```\n\nmdvs scans every file, extracts frontmatter, and infers which fields belong where. `draft` is a `Boolean` allowed in `blog/`. `role` is a `String` required in `team/`. `date` is a `Date` (RFC 3339) allowed in `meetings/`. The directory structure is the schema.\n\n### Validate\n\nTwo new files appear — both without `role`:\n\n```\nnotes/\n├── blog/\n│   └── new-post.md    ← title, draft  (no role)\n├── team/\n│   └── charlie.md     ← title         (no role)\n└── ...\n```\n\n```bash\nmdvs check\n```\n\n```\nChecked 7 files — 1 violation(s)\n\n┌ role ────────────────────┬─────────────────────────────────────────┐\n│ kind                     │ Missing required                        │\n│ rule                     │ required in [\"team/**\"]                 │\n│ files                    │ team/charlie.md                         │\n└──────────────────────────┴─────────────────────────────────────────┘\n```\n\n`charlie.md` is missing `role` — but `new-post.md` isn't flagged. mdvs knows `role` belongs in `team/`, not in `blog/`.\n\nThis is especially useful when an LLM agent is doing the writing. Over a long session an agent will drift — a misnamed field here, an accidentally-stringified boolean there — and running `mdvs check` after each turn catches the drift before it compounds.\n\n### Search\n\n```bash\nmdvs search \"how to get in touch\"\n```\n\n```\nSearched \"how to get in touch\" — 3 hits\n\n┌ #1 ──────────────────────┬─────────────────────────────────────────┐\n│ file                     │ team/alice.md                           │\n│ score                    │ 0.612                                   │\n│ lines                    │ 5-8                                     │\n│ text                     │ Alice leads the backend team. Reach her │\n│                          │ at alice@example.com or on Slack.       │\n└──────────────────────────┴─────────────────────────────────────────┘\n```\n\n`alice.md` doesn't contain \"get in touch\" — mdvs finds it by meaning, not keywords. Filter with SQL on frontmatter:\n\n```bash\nmdvs search \"rust\" --where \"draft = false\"\nmdvs search \"meeting notes\" --where \"date \u003e '2026-05-01'\"\n```\n\nThe typed schema is what makes `--where` work. Without it, `tags = 'rust'` would be a fuzzy guess; with it, it's an equality check on a known-typed array column.\n\n\u003e **Try it on your own files:**\n\u003e ```bash\n\u003e cargo install mdvs\n\u003e cd your-notes/\n\u003e mdvs init\n\u003e mdvs search \"your query\"\n\u003e ```\n\u003e\n\u003e Or explore the repo's [example_kb/](example_kb/) — 43 files across 8 directories with type widening, nullable fields, nested objects, and deliberate edge cases.\n\n## Calling mdvs from an agent\n\nEvery command supports `--output json` and returns deterministic exit codes (`0` = success, `1` = violations, `2` = error). No SDK or daemon to manage — a coding agent calls mdvs the way a shell script would.\n\n```bash\n# An agent checks its own writes:\nmdvs check --output json | jq '.violations[] | select(.kind == \"MissingRequired\")'\n\n# An agent queries by metadata + meaning together:\nmdvs search \"incident postmortem\" \\\n  --where \"status = 'published' AND severity = 'high'\" \\\n  --output json | jq '.hits[].filename'\n\n# An agent exports the schema to feed into a structured-output generator:\nmdvs export-jsonschema --format json\n```\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `init`  | Scan files, infer schema, write `mdvs.toml` (or import via `--from-jsonschema`) |\n| `check` | Validate frontmatter against schema (optionally `--jsonschema` to override) |\n| `update` | Re-scan and update field definitions |\n| `build` | Validate + embed + write search index |\n| `search` | Semantic search with optional SQL filtering |\n| `info`  | Show config and index status |\n| `clean` | Delete search index |\n| `export-jsonschema` | Translate `mdvs.toml` fields into a JSON Schema 2020-12 document |\n| `skill` | Print the agent skill file to stdout (for harnesses that load it as a tool description) |\n\n## Built with\n\n- **Rust** — mdvs is written in Rust; the CLI is a single static binary.\n- **[LanceDB](https://lancedb.com/)** — backs storage and search. Cosine vector search, BM25 full-text, and RRF hybrid all run natively against the Lance dataset.\n- **[Model2Vec](https://minish.ai/)** — static embedding models; the default is `potion-base-8M` (~60 MB, CPU-only, no GPU).\n- **[`jsonschema`](https://crates.io/crates/jsonschema)** — JSON Schema 2020-12 validator. mdvs translates your `mdvs.toml` into a canonical JSON Schema document and validates frontmatter values through per-field validators compiled from it.\n- **[`pulldown-cmark`](https://crates.io/crates/pulldown-cmark)** — markdown parsing; used to extract plain text from each chunk before embedding.\n- **[`text-splitter`](https://crates.io/crates/text-splitter)** — semantic-aware chunker that splits the markdown body along heading and paragraph boundaries.\n- **[`gray_matter`](https://crates.io/crates/gray_matter)** — YAML and TOML frontmatter extraction. JSON frontmatter is parsed natively via `serde_json` to handle Hugo's bare-braces convention.\n\n## Documentation\n\nFull documentation at [edochi.github.io/mdvs](https://edochi.github.io/mdvs/).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedochi%2Fmdvs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedochi%2Fmdvs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedochi%2Fmdvs/lists"}