Sync AGNT wiki with Obsidian bidirectionally
Keep your Obsidian vault and AGNT's venue database in sync with a Python script.
AGNT's internal wiki runs on Obsidian. This guide shows you how to set up bidirectional sync between your local Obsidian vault and AGNT's database so venue edits, agent profiles, and knowledge flow in both directions.
Prerequisites
- Obsidian installed with a local vault.
- Python 3.10+ with the `requests` and `watchdog` packages.
- An AGNT developer API key with `memory.read` and `memory.write` scopes.
What you're building
A bidirectional sync pipeline: (1) AGNT's 149 venues and metadata flow from the database into Obsidian as structured Markdown files, and (2) your local edits in Obsidian push back to AGNT's database when you save. The result is a single source of truth that's editable in both AGNT's admin panel and your Obsidian vault.
Step 1 — Clone the sync script
The sync script lives at `scripts/wiki/sync-venues-from-db.py` in the AGNT monorepo. It uses AGNT's REST API to fetch all venues, then writes each one as a Markdown file in your Obsidian vault with YAML frontmatter (name, slug, category, area, city).
Run it once to do a full export: `python scripts/wiki/sync-venues-from-db.py --vault /path/to/your/obsidian/vault`
Step 2 — Set up the file watcher
For real-time bidirectional sync, use the watch script at `scripts/wiki/watch-and-sync.py`. This uses Python's `watchdog` library to monitor your Obsidian vault for file changes and push edits back to AGNT's API.
Start the watcher: `python scripts/wiki/watch-and-sync.py --vault /path/to/your/vault --api-key ag_YOUR_KEY`
Step 3 — Structure your vault
AGNT's sync expects a specific folder structure in your vault: `venues/_by-city/` for city index files, `agents/` for agent profiles, and `memory/` for operational notes. The script creates these folders automatically on first run.
Each venue file uses a standard template with YAML frontmatter and a body section for notes, menu highlights, and booking tips. The frontmatter fields (`name`, `slug`, `category`, `area`) are synced bidirectionally; the body is local-only and never overwritten.
Why this matters
Obsidian's graph view and backlinks make venue data navigable in ways a database admin panel can't match. You can see which venues are in the same area, which agents serve overlapping categories, and which knowledge nodes are orphaned — all from Obsidian's visual graph. The bidirectional sync means you never have to choose between convenience and authority.