Obsidian Ontology Sync
/install obsidian-ontology-sync-cp3d
\r \r
Obsidian-Ontology Sync\r
\r Philosophy: Obsidian is PRIMARY (human writes natural notes) → Ontology is DERIVED (machine extracts structure) → Feedback loop improves both\r \r
Core Concept\r
\r
Obsidian Notes (Markdown)\r
↓ Extract (every 3 hours)\r
Ontology Graph (Structured)\r
↓ Query & Analyze\r
Insights & Suggestions\r
↓ Feedback\r
Improved Note Templates\r
```\r
\r
## When to Use\r
\r
| Situation | Action |\r
|-----------|--------|\r
| After creating/updating contacts | Run sync to extract entities |\r
| Before business queries | Sync then query ontology |\r
| Weekly review | Sync + analyze + get suggestions |\r
| New project setup | Extract entities + suggest structure |\r
| Team status tracking | Sync daily-status → ontology → analytics |\r
\r
## What Gets Extracted\r
\r
### From Contact Notes (`references/contacts/*.md`)\r
\r
**Extracts:**\r
- `Person` entity (name, email, phone)\r
- `works_at` → `Organization`\r
- `met_at` → `Event`\r
- `assigned_to` → `Project` (if mentioned)\r
- `status` → (prospect, warm_lead, client, etc.)\r
\r
**Example:**\r
```markdown\r
# Alice Johnson\r
\r
**Email:** [email protected]\r
**Company:** Acme Corp\r
**Met At:** Tech Conference 2026\r
**Projects:** Project Alpha\r
\r
## Notes\r
Great developer, responsive communication.\r
```\r
\r
**Becomes:**\r
```json\r
{\r
"entity": {\r
"id": "person_alice_johnson",\r
"type": "Person",\r
"properties": {\r
"name": "Alice Johnson",\r
"email": "[email protected]",\r
"notes": "Great developer, responsive communication"\r
}\r
},\r
"relations": [\r
{"from": "person_alice_johnson", "rel": "works_at", "to": "org_acme"},\r
{"from": "person_alice_johnson", "rel": "met_at", "to": "event_tech_conference_2026"},\r
{"from": "person_alice_johnson", "rel": "assigned_to", "to": "project_alpha"}\r
]\r
}\r
```\r
\r
### From Client Notes (`references/clients/*.md`)\r
\r
**Extracts:**\r
- `Organization` entity\r
- `has_contract_value` → number\r
- `projects` → `Project` entities\r
- `primary_contact` → `Person`\r
\r
### From Team Notes (`references/team/*.md`)\r
\r
**Extracts:**\r
- `Person` entity\r
- `works_for` → `Organization`\r
- `assigned_to` → `Project[]`\r
- `reports_to` → `Person`\r
- `response_pattern` → (proactive, reactive, non-responsive)\r
\r
### From Daily Status (`daily-status/YYYY-MM-DD/*.md`)\r
\r
**Extracts:**\r
- `response_time` property on Person\r
- `status_update` → `Event`\r
- `blockers` → `Issue` entities\r
- `behavioral_pattern` tracking\r
\r
### From Project Notes (`projects/*.md`)\r
\r
**Extracts:**\r
- `Project` entity\r
- `for_client` → `Organization`\r
- `team` → `Person[]`\r
- `status`, `value`, `deadline`\r
\r
## Sync Process\r
\r
### 1. Extract Phase (Markdown → Ontology)\r
\r
```bash\r
# Run extraction\r
python3 skills/obsidian-ontology-sync/scripts/sync.py extract\r
\r
# What it does:\r
# 1. Scan configured Obsidian directories\r
# 2. Parse markdown frontmatter + content\r
# 3. Extract entities (Person, Project, Organization, etc.)\r
# 4. Extract relationships (works_at, assigned_to, etc.)\r
# 5. Write to ontology using append-only operations\r
```\r
\r
**Detection Rules:**\r
\r
```python\r
# Contact files\r
if file.startswith("references/contacts/"):\r
entity_type = "Person"\r
extract_email_from_content()\r
extract_company_from_property("Company:")\r
extract_projects_from_links([[Project]])\r
\r
# Client files\r
if file.startswith("references/clients/"):\r
entity_type = "Organization"\r
extract_contract_value()\r
extract_projects()\r
\r
# Team files\r
if file.startswith("references/team/"):\r
entity_type = "Person"\r
role = "team_member"\r
extract_assignments()\r
extract_response_patterns()\r
```\r
\r
### 2. Analysis Phase (Ontology → Insights)\r
\r
```bash\r
# Run analytics\r
python3 skills/obsidian-ontology-sync/scripts/sync.py analyze\r
\r
# Generates insights like:\r
# - "3 team members have no assigned projects"\r
# - "Contact 'John Doe' missing email address"\r
# - "Project 'X' has 5 people but no client linked"\r
# - "10 contacts from AI Summit not linked to follow-up tasks"\r
```\r
\r
### 3. Feedback Phase (Insights → Improve PKM)\r
\r
```bash\r
# Get suggestions\r
python3 skills/obsidian-ontology-sync/scripts/sync.py feedback\r
\r
# Creates:\r
# - Missing property suggestions\r
# - Broken link reports\r
# - Relationship suggestions\r
# - Template improvements\r
```\r
\r
**Example Feedback:**\r
\r
```markdown\r
# Sync Feedback - 2026-02-27\r
\r
## Missing Information (10 items)\r
- [ ] `Alice Johnson` missing phone number\r
- [ ] `Bob` missing email in team file\r
- [ ] Project `Project Alpha` missing deadline\r
\r
## Suggested Links (5 items)\r
- [ ] Link `Jane Doe` (TechHub) to organization `TechHub`\r
- [ ] Link `Eve` to project (found in daily-status but not in team file)\r
\r
## Relationship Insights\r
- `Project Alpha` team: Alice, Carol, David (extracted from daily-status)\r
- Suggest updating project file with team assignments\r
\r
## Template Suggestions\r
- Add `Projects: [[]]` field to contact template\r
- Add `Response Pattern:` field to team template\r
```\r
\r
## Configuration\r
\r
### config.yaml\r
\r
```yaml\r
# /root/life/pkm/ontology-sync/config.yaml\r
\r
obsidian:\r
vault_path: /root/life/pkm\r
\r
# What to sync\r
sources:\r
contacts:\r
path: references/contacts\r
entity_type: Person\r
extract:\r
- email_from_content\r
- company_from_property\r
- projects_from_links\r
\r
clients:\r
path: references/clients\r
entity_type: Organization\r
extract:\r
- contract_value\r
- projects\r
- contacts\r
\r
team:\r
path: references/team\r
entity_type: Person\r
role: team_member\r
extract:\r
- assignments\r
- response_patterns\r
- reports_to\r
\r
daily_status:\r
path: daily-status\r
extract:\r
- response_times\r
- behavioral_patterns\r
- blockers\r
\r
ontology:\r
storage_path: /root/life/pkm/memory/ontology\r
format: jsonl # or sqlite for scale\r
\r
# Entity types to track\r
entities:\r
- Person\r
- Organization\r
- Project\r
- Event\r
- Task\r
\r
# Relationships to extract\r
relationships:\r
- works_at\r
- assigned_to\r
- met_at\r
- for_client\r
- reports_to\r
- has_task\r
- blocks\r
\r
feedback:\r
output_path: /root/life/pkm/ontology-sync/feedback\r
generate_reports: true\r
suggest_templates: true\r
highlight_missing: true\r
\r
schedule:\r
# Run via cron every 3 hours\r
sync_interval: "0 */3 * * *"\r
analyze_daily: "0 9 * * *" # 9 AM daily\r
feedback_weekly: "0 10 * * MON" # Monday 10 AM\r
```\r
\r
## Scheduled Sync (Cron Integration)\r
\r
### Setup Automatic Sync\r
\r
```bash\r
# Add to OpenClaw cron\r
python3 skills/obsidian-ontology-sync/scripts/setup-cron.py\r
\r
# Or manually via cron tool\r
cron add \\r
--schedule "0 */3 * * *" \\r
--task "python3 skills/obsidian-ontology-sync/scripts/sync.py extract" \\r
--label "Obsidian → Ontology Sync"\r
```\r
\r
**Cron Jobs Created:**\r
\r
1. **Every 3 hours:** Extract entities from Obsidian → Update ontology\r
2. **Daily 9 AM:** Run analytics and generate insights\r
3. **Weekly Monday 10 AM:** Generate feedback report + template suggestions\r
\r
## Queries (Using Ontology)\r
\r
Once synced, you can query:\r
\r
```bash\r
# All team members on high-value projects\r
python3 skills/ontology/scripts/ontology.py query \\r
--type Person \\r
--where '{"role":"team_member"}' \\r
--related assigned_to \\r
--filter '{"type":"Project","value__gt":400000}'\r
\r
# Contacts from specific event not yet followed up\r
python3 skills/ontology/scripts/ontology.py query \\r
--type Person \\r
--where '{"met_at":"event_tech_conference_2026"}' \\r
--missing has_task\r
\r
# Team response patterns\r
python3 skills/ontology/scripts/ontology.py query \\r
--type Person \\r
--where '{"role":"team_member"}' \\r
--aggregate response_pattern\r
\r
# Projects by client\r
python3 skills/ontology/scripts/ontology.py query \\r
--type Project \\r
--group-by for_client \\r
--count\r
```\r
\r
## Feedback Loop Examples\r
\r
### Example 1: Missing Email Detection\r
\r
**Ontology finds:** Person entity with no email property\r
\r
**Feedback generated:**\r
```markdown\r
## Missing Contact Information\r
\r
The following team members are missing email addresses:\r
\r
- [ ] Bob (`references/team/Bob.md`)\r
- [ ] Lucky (`references/team/Lucky.md`)\r
\r
**Suggestion:** Add email field to team member template:\r
\`\`\`markdown\r
**Email:** \r
\`\`\`\r
```\r
\r
### Example 2: Broken Project Links\r
\r
**Ontology finds:** Person assigned_to Project that doesn't exist\r
\r
**Feedback generated:**\r
```markdown\r
## Broken Project References\r
\r
Found references to projects that don't have dedicated files:\r
\r
- [ ] "Project Epsilon" mentioned in team files but no `projects/Project Epsilon.md`\r
- [ ] "Project Delta Tata DT" assigned but no project file\r
\r
**Suggestion:** Create project files with template\r
```\r
\r
### Example 3: Relationship Discovery\r
\r
**Ontology finds:** Multiple people working at same company\r
\r
**Feedback generated:**\r
```markdown\r
## Suggested Company Grouping\r
\r
Found 3 contacts at "TechHub":\r
- Jane Doe\r
- [2 others from daily-status mentions]\r
\r
**Suggestion:** Create `references/clients/TechHub.md` and link contacts\r
```\r
\r
## Integration with Daily Workflow\r
\r
### Morning Routine (9 AM)\r
\r
```bash\r
# Cron runs analysis\r
# Generates daily-insights.md with:\r
- Response rate from yesterday's status requests\r
- Projects needing attention (blockers mentioned)\r
- Contacts to follow up (met > 3 days ago, no task)\r
```\r
\r
### Weekly Review (Monday 10 AM)\r
\r
```bash\r
# Cron generates weekly feedback\r
# Creates suggestions for:\r
- Missing information to fill in\r
- Broken links to fix\r
- New templates to adopt\r
- Relationship insights\r
```\r
\r
### On-Demand Queries\r
\r
```bash\r
# Before a meeting\r
"Show me all interactions with Client X"\r
\r
# Resource planning\r
"Which team members are on \x3C3 projects?"\r
\r
# Sales pipeline\r
"Contacts met at conferences in last 30 days without follow-up"\r
```\r
\r
## Benefits\r
\r
### ✅ For You\r
\r
1. **Zero Extra Work:** Just keep writing normal Obsidian notes\r
2. **Automatic Structure:** Ontology extracted automatically\r
3. **Powerful Queries:** Find patterns across all your data\r
4. **Quality Improvement:** Feedback loop catches missing info\r
5. **No Double Entry:** Single source of truth (Obsidian)\r
\r
### ✅ For Team Management\r
\r
- Track who's on which project (auto-extracted)\r
- Monitor response patterns (from daily-status)\r
- Identify unbalanced workloads\r
- Find blockers across projects\r
\r
### ✅ For Sales/BD\r
\r
- Track contact network (who you met, where, when)\r
- Follow-up reminders (contacted >7 days ago)\r
- Relationship mapping (who knows who)\r
- Pipeline insights (prospects → warm → clients)\r
\r
### ✅ For Finance\r
\r
- Project valuations (extracted from client notes)\r
- Team cost allocation (people → projects → revenue)\r
- Revenue forecasting (active projects × value)\r
\r
## File Structure After Sync\r
\r
```\r
/root/life/pkm/\r
├── references/\r
│ ├── contacts/ # Source notes (you write these)\r
│ ├── clients/ # Source notes\r
│ └── team/ # Source notes\r
├── daily-status/ # Source notes\r
├── projects/ # Source notes\r
│\r
├── memory/ontology/ # Generated ontology\r
│ ├── graph.jsonl # Entity/relation storage\r
│ └── schema.yaml # Type definitions\r
│\r
└── ontology-sync/ # Sync outputs\r
├── config.yaml # Your config\r
├── feedback/\r
│ ├── daily-insights.md\r
│ ├── weekly-feedback.md\r
│ └── suggestions.md\r
└── logs/\r
└── sync-YYYY-MM-DD.log\r
```\r
\r
## Advanced: Bidirectional Sync\r
\r
**Future capability:**\r
\r
Update Obsidian notes FROM ontology insights:\r
\r
```bash\r
# Automatically add missing fields\r
python3 skills/obsidian-ontology-sync/scripts/sync.py apply-feedback\r
\r
# What it does:\r
# - Adds missing email field to contact notes\r
# - Creates suggested project files\r
# - Links related entities\r
# - Updates frontmatter\r
```\r
\r
**Safety:** Always creates backup before modifying files.\r
\r
## Comparison with Alternatives\r
\r
| Approach | Pros | Cons |\r
|----------|------|------|\r
| **Manual ontology** | Full control | Too much work, falls behind |\r
| **Obsidian only** | Simple | No structured queries |\r
| **Ontology only** | Powerful queries | Not human-friendly |\r
| **This skill** | Best of both | Initial setup needed |\r
\r
## Getting Started\r
\r
### 1. Install Dependencies\r
\r
```bash\r
# Already have ontology skill installed\r
clawhub install obsidian # If not already installed\r
```\r
\r
### 2. Create Config\r
\r
```bash\r
python3 skills/obsidian-ontology-sync/scripts/init.py\r
\r
# Creates:\r
# - config.yaml with your vault path\r
# - ontology directory structure\r
# - cron jobs\r
```\r
\r
### 3. Run First Sync\r
\r
```bash\r
# Manual first sync to test\r
python3 skills/obsidian-ontology-sync/scripts/sync.py extract --dry-run\r
\r
# See what would be extracted\r
# Review, then run for real:\r
python3 skills/obsidian-ontology-sync/scripts/sync.py extract\r
```\r
\r
### 4. Enable Automatic Sync\r
\r
```bash\r
python3 skills/obsidian-ontology-sync/scripts/setup-cron.py\r
\r
# Confirms cron jobs:\r
# ✓ Sync every 3 hours\r
# ✓ Daily analysis at 9 AM\r
# ✓ Weekly feedback Monday 10 AM\r
```\r
\r
### 5. Query Your Data\r
\r
```bash\r
# Try some queries\r
python3 skills/obsidian-ontology-sync/scripts/query.py "team members on high value projects"\r
```\r
\r
## Troubleshooting\r
\r
### Extraction Issues\r
\r
```bash\r
# Dry run to see what would be extracted\r
python3 skills/obsidian-ontology-sync/scripts/sync.py extract --dry-run --verbose\r
\r
# Check specific file\r
python3 skills/obsidian-ontology-sync/scripts/debug.py \\r
--file references/contacts/Alice.md\r
```\r
\r
### Query Not Finding Data\r
\r
```bash\r
# Check what's in ontology\r
python3 skills/ontology/scripts/ontology.py query --type Person\r
\r
# Verify sync ran\r
cat /root/life/pkm/ontology-sync/logs/sync-latest.log\r
```\r
\r
### Feedback Not Generated\r
\r
```bash\r
# Manually run analysis\r
python3 skills/obsidian-ontology-sync/scripts/sync.py analyze\r
python3 skills/obsidian-ontology-sync/scripts/sync.py feedback\r
```\r
\r
## Version History\r
\r
- **1.0.0** (2026-02-27) - Initial version with extraction, analysis, feedback loop\r
\r
---\r
\r
**Author:** Built for team management, contact tracking, and business intelligence at scale\r
**License:** MIT\r
**Tags:** obsidian, ontology, knowledge-graph, pkm, automation, sync\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install obsidian-ontology-sync-cp3d - After installation, invoke the skill by name or use
/obsidian-ontology-sync-cp3d - Provide required inputs per the skill's parameter spec and get structured output
What is Obsidian Ontology Sync?
Bidirectional sync between Obsidian PKM (human-friendly notes) and structured ontology (machine-queryable graph). Automatically extracts entities and relatio... It is an AI Agent Skill for Claude Code / OpenClaw, with 117 downloads so far.
How do I install Obsidian Ontology Sync?
Run "/install obsidian-ontology-sync-cp3d" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Obsidian Ontology Sync free?
Yes, Obsidian Ontology Sync is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Obsidian Ontology Sync support?
Obsidian Ontology Sync is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Obsidian Ontology Sync?
It is built and maintained by cp3d1455926-svg (@cp3d1455926-svg); the current version is v1.0.0.