PlanOpticon

planopticon / docs / guide / export.md
1
# Export
2
3
PlanOpticon provides multiple ways to export knowledge graph data into formats suitable for documentation, note-taking, collaboration, and interchange. All export commands work offline from a `knowledge_graph.db` file -- no API key is needed for template-based exports.
4
5
## Overview of export options
6
7
| Format | Command | API Key | Description |
8
|--------|---------|---------|-------------|
9
| Markdown documents | `planopticon export markdown` | No | 7 document types: summary, meeting notes, glossary, and more |
10
| Obsidian vault | `planopticon export obsidian` | No | YAML frontmatter, `[[wiki-links]]`, tag pages, Map of Content |
11
| Notion-compatible | `planopticon export notion` | No | Callout blocks, CSV database for bulk import |
12
| PlanOpticonExchange JSON | `planopticon export exchange` | No | Canonical interchange format for merging and sharing |
13
| GitHub wiki | `planopticon wiki generate` | No | Home, Sidebar, entity pages, type indexes |
14
| GitHub wiki push | `planopticon wiki push` | Git auth | Push generated wiki to a GitHub repo |
15
16
## Markdown document generator
17
18
The markdown exporter produces structured documents from knowledge graph data using pure template-based generation. No LLM calls are made -- the output is deterministic and based entirely on the entities and relationships in the graph.
19
20
### CLI usage
21
22
```
23
planopticon export markdown DB_PATH [OPTIONS]
24
```
25
26
**Arguments:**
27
28
| Argument | Description |
29
|----------|-------------|
30
| `DB_PATH` | Path to a `knowledge_graph.db` file |
31
32
**Options:**
33
34
| Option | Short | Default | Description |
35
|--------|-------|---------|-------------|
36
| `--output` | `-o` | `./export` | Output directory |
37
| `--type` | | `all` | Document types to generate (repeatable). Choices: `summary`, `meeting-notes`, `glossary`, `relationship-map`, `status-report`, `entity-index`, `csv`, `all` |
38
39
**Examples:**
40
41
```bash
42
# Generate all document types
43
planopticon export markdown knowledge_graph.db
44
45
# Generate only summary and glossary
46
planopticon export markdown kg.db -o ./docs --type summary --type glossary
47
48
# Generate meeting notes and CSV
49
planopticon export markdown kg.db --type meeting-notes --type csv
50
```
51
52
### Document types
53
54
#### summary (Executive Summary)
55
56
A high-level overview of the knowledge graph. Contains:
57
58
- Total entity and relationship counts
59
- Entity breakdown by type (table with counts and example names)
60
- Key entities ranked by number of connections (top 10)
61
- Relationship type breakdown with counts
62
63
This is useful for getting a quick overview of what a knowledge base contains.
64
65
#### meeting-notes (Meeting Notes)
66
67
Formats knowledge graph data as structured meeting notes. Organizes entities into planning-relevant categories:
68
69
- **Discussion Topics**: Entities of type `concept`, `technology`, or `topic` with their descriptions
70
- **Participants**: Entities of type `person`
71
- **Decisions & Constraints**: Entities of type `decision` or `constraint`
72
- **Action Items**: Entities of type `goal`, `feature`, or `milestone`, shown as checkboxes. If an entity has an `assigned_to` or `owned_by` relationship, the owner is shown as `@name`
73
- **Open Questions / Loose Ends**: Entities with one or fewer relationships (excluding people), indicating topics that may need follow-up
74
75
Includes a generation timestamp.
76
77
#### glossary (Glossary)
78
79
An alphabetically sorted dictionary of all entities in the knowledge graph. Each entry shows:
80
81
- Entity name (bold)
82
- Entity type (italic, in parentheses)
83
- First description
84
85
Format:
86
87
```
88
**Entity Name** *(type)*
89
: Description text here.
90
```
91
92
#### relationship-map (Relationship Map)
93
94
A comprehensive view of all relationships in the graph, organized by relationship type. Each type gets its own section with a table of source-target pairs.
95
96
Also includes a **Mermaid diagram** of the top 20 most-connected entities, rendered as a `graph LR` flowchart with labeled edges. This diagram can be rendered natively in GitHub, GitLab, Obsidian, and many other Markdown viewers.
97
98
#### status-report (Status Report)
99
100
A project-oriented status report that highlights planning entities:
101
102
- **Overview**: Counts of entities, relationships, features, milestones, requirements, and risks/constraints
103
- **Milestones**: Entities of type `milestone` with descriptions
104
- **Features**: Table of entities of type `feature` with descriptions (truncated to 60 characters)
105
- **Risks & Constraints**: Entities of type `risk` or `constraint`
106
107
Includes a generation timestamp.
108
109
#### entity-index (Entity Index)
110
111
A master index of all entities grouped by type. Each type section lists entities alphabetically with their first description. Shows total entity count and number of types.
112
113
#### csv (CSV Export)
114
115
A CSV file suitable for spreadsheet import. Columns:
116
117
| Column | Description |
118
|--------|-------------|
119
| Name | Entity name |
120
| Type | Entity type |
121
| Description | First description |
122
| Related To | Semicolon-separated list of entities this entity has outgoing relationships to |
123
| Source | First occurrence source |
124
125
### Entity briefs
126
127
In addition to the selected document types, the `generate_all()` function automatically creates individual entity brief pages in an `entities/` subdirectory. Each brief contains:
128
129
- Entity name and type
130
- Summary (all descriptions)
131
- Outgoing relationships (table of target entities and relationship types)
132
- Incoming relationships (table of source entities and relationship types)
133
- Source occurrences with timestamps and context text
134
135
## Obsidian vault export
136
137
The Obsidian exporter creates a complete vault structure with YAML frontmatter, `[[wiki-links]]` for entity cross-references, and Obsidian-compatible metadata.
138
139
### CLI usage
140
141
```
142
planopticon export obsidian DB_PATH [OPTIONS]
143
```
144
145
**Options:**
146
147
| Option | Short | Default | Description |
148
|--------|-------|---------|-------------|
149
| `--output` | `-o` | `./obsidian-vault` | Output vault directory |
150
151
**Example:**
152
153
```bash
154
planopticon export obsidian knowledge_graph.db -o ./my-vault
155
```
156
157
### Generated structure
158
159
```
160
my-vault/
161
_Index.md # Map of Content (MOC)
162
Tag - Person.md # One tag page per entity type
163
Tag - Technology.md
164
Tag - Concept.md
165
Alice.md # Individual entity notes
166
Python.md
167
Microservices.md
168
...
169
```
170
171
### Entity notes
172
173
Each entity gets a dedicated note with:
174
175
**YAML frontmatter:**
176
177
```yaml
178
---
179
type: technology
180
tags:
181
- technology
182
aliases:
183
- Python 3
184
- CPython
185
date: 2026-03-07
186
---
187
```
188
189
The frontmatter includes:
190
191
- `type`: The entity type
192
- `tags`: Entity type as a tag (for Obsidian tag-based filtering)
193
- `aliases`: Any known aliases for the entity (if available)
194
- `date`: The export date
195
196
**Body content:**
197
198
- `# Entity Name` heading
199
- Description paragraphs
200
- `## Relationships` section with `[[wiki-links]]` to related entities:
201
```
202
- **uses**: [[FastAPI]]
203
- **depends_on**: [[PostgreSQL]]
204
```
205
- `## Referenced by` section with incoming relationships:
206
```
207
- **implements** from [[Backend Service]]
208
```
209
210
### Index note (Map of Content)
211
212
The `_Index.md` file serves as a Map of Content (MOC), listing all entities grouped by type with `[[wiki-links]]`:
213
214
```markdown
215
---
216
type: index
217
tags:
218
- MOC
219
date: 2026-03-07
220
---
221
222
# Index
223
224
**47** entities | **31** relationships
225
226
## Concept
227
228
- [[Microservices]]
229
- [[REST API]]
230
231
## Person
232
233
- [[Alice]]
234
- [[Bob]]
235
```
236
237
### Tag pages
238
239
One tag page is created per entity type (e.g., `Tag - Person.md`, `Tag - Technology.md`). Each page has frontmatter tagging it with the entity type and lists all entities of that type with descriptions.
240
241
## Notion-compatible markdown export
242
243
The Notion exporter creates Markdown files with Notion-style callout blocks and a CSV database file for bulk import into Notion.
244
245
### CLI usage
246
247
```
248
planopticon export notion DB_PATH [OPTIONS]
249
```
250
251
**Options:**
252
253
| Option | Short | Default | Description |
254
|--------|-------|---------|-------------|
255
| `--output` | `-o` | `./notion-export` | Output directory |
256
257
**Example:**
258
259
```bash
260
planopticon export notion knowledge_graph.db -o ./notion-export
261
```
262
263
### Generated structure
264
265
```
266
notion-export/
267
Overview.md # Knowledge graph overview page
268
entities_database.csv # CSV for Notion database import
269
Alice.md # Individual entity pages
270
Python.md
271
...
272
```
273
274
### Entity pages
275
276
Each entity page uses Notion-style callout syntax for metadata:
277
278
```markdown
279
# Python
280
281
> :computer: **Type:** technology
282
283
## Description
284
285
A high-level programming language...
286
287
> :memo: **Properties**
288
> - **version:** 3.11
289
> - **paradigm:** multi-paradigm
290
291
## Relationships
292
293
| Target | Relationship |
294
|--------|-------------|
295
| FastAPI | uses |
296
| Django | framework_for |
297
298
## Referenced by
299
300
| Source | Relationship |
301
|--------|-------------|
302
| Backend Service | implements |
303
```
304
305
### CSV database
306
307
The `entities_database.csv` file contains all entities in a format suitable for Notion's CSV database import:
308
309
| Column | Description |
310
|--------|-------------|
311
| Name | Entity name |
312
| Type | Entity type |
313
| Description | First two descriptions, semicolon-separated |
314
| Related To | Comma-separated list of outgoing relationship targets |
315
316
### Overview page
317
318
The `Overview.md` page provides a summary with entity counts and a grouped listing of all entities by type.
319
320
## GitHub wiki generator
321
322
The wiki generator creates a complete set of GitHub wiki pages from a knowledge graph, including navigation (Home page and Sidebar) and cross-linked entity pages.
323
324
### CLI usage
325
326
**Generate wiki pages locally:**
327
328
```
329
planopticon wiki generate DB_PATH [OPTIONS]
330
```
331
332
| Option | Short | Default | Description |
333
|--------|-------|---------|-------------|
334
| `--output` | `-o` | `./wiki` | Output directory for wiki pages |
335
| `--title` | | `Knowledge Base` | Wiki title (shown on Home page) |
336
337
**Push wiki pages to GitHub:**
338
339
```
340
planopticon wiki push WIKI_DIR REPO [OPTIONS]
341
```
342
343
| Argument | Description |
344
|----------|-------------|
345
| `WIKI_DIR` | Path to the directory containing generated wiki `.md` files |
346
| `REPO` | GitHub repository in `owner/repo` format |
347
348
| Option | Short | Default | Description |
349
|--------|-------|---------|-------------|
350
| `--message` | `-m` | `Update wiki` | Git commit message |
351
352
**Examples:**
353
354
```bash
355
# Generate wiki pages
356
planopticon wiki generate knowledge_graph.db -o ./wiki
357
358
# Generate with a custom title
359
planopticon wiki generate kg.db -o ./wiki --title "Project Wiki"
360
361
# Push to GitHub
362
planopticon wiki push ./wiki ConflictHQ/PlanOpticon
363
364
# Push with a custom commit message
365
planopticon wiki push ./wiki owner/repo -m "Add entity pages"
366
```
367
368
### Generated pages
369
370
The wiki generator creates the following pages:
371
372
| Page | Description |
373
|------|-------------|
374
| `Home.md` | Main wiki page with entity counts, type links, and artifact links |
375
| `_Sidebar.md` | Navigation sidebar with links to Home, entity type indexes, and artifacts |
376
| `{Type}.md` | One index page per entity type with a table of entities and descriptions |
377
| `{Entity}.md` | Individual entity pages with type, descriptions, relationships, and sources |
378
379
### Entity pages
380
381
Each entity page contains:
382
383
- Entity name as the top heading
384
- **Type** label
385
- **Descriptions** section (bullet list)
386
- **Relationships** table with wiki-style links to target entities
387
- **Referenced By** table with links to source entities
388
- **Sources** section listing occurrences with timestamps and context
389
390
All entity and type names are cross-linked using GitHub wiki-compatible links (`[Name](Sanitized-Name)`).
391
392
### Push behavior
393
394
The `wiki push` command:
395
396
1. Clones the existing GitHub wiki repository (`https://github.com/{repo}.wiki.git`).
397
2. If the wiki does not exist yet, initializes a new Git repository.
398
3. Copies all `.md` files from the wiki directory into the clone.
399
4. Commits the changes.
400
5. Pushes to the remote (tries `master` first, then `main`).
401
402
This requires Git authentication with push access to the repository. The wiki must be enabled in the GitHub repository settings.
403
404
## PlanOpticonExchange JSON format
405
406
The PlanOpticonExchange is the canonical interchange format for PlanOpticon data. Every command produces it, and every export adapter can consume it. It provides a structured, versioned JSON representation of a complete knowledge graph with project metadata.
407
408
### CLI usage
409
410
```
411
planopticon export exchange DB_PATH [OPTIONS]
412
```
413
414
| Option | Short | Default | Description |
415
|--------|-------|---------|-------------|
416
| `--output` | `-o` | `./exchange.json` | Output JSON file path |
417
| `--name` | | `Untitled` | Project name for the exchange payload |
418
| `--description` | | (empty) | Project description |
419
420
**Examples:**
421
422
```bash
423
# Basic export
424
planopticon export exchange knowledge_graph.db
425
426
# With project metadata
427
planopticon export exchange kg.db -o exchange.json --name "My Project" --description "Sprint 3 analysis"
428
```
429
430
### Schema
431
432
The exchange format has the following top-level structure:
433
434
```json
435
{
436
"version": "1.0",
437
"project": {
438
"name": "My Project",
439
"description": "Sprint 3 analysis",
440
"created_at": "2026-03-07T10:30:00.000000",
441
"updated_at": "2026-03-07T10:30:00.000000",
442
"tags": ["sprint-3", "backend"]
443
},
444
"entities": [
445
{
446
"name": "Python",
447
"type": "technology",
448
"descriptions": ["A high-level programming language"],
449
"source": "transcript",
450
"occurrences": [
451
{
452
"source": "meeting.mp4",
453
"timestamp": "00:05:23",
454
"text": "We should use Python for the backend"
455
}
456
]
457
}
458
],
459
"relationships": [
460
{
461
"source": "Python",
462
"target": "Backend Service",
463
"type": "used_by",
464
"content_source": "transcript:meeting.mp4",
465
"timestamp": 323.0
466
}
467
],
468
"artifacts": [
469
{
470
"name": "Project Plan",
471
"content": "# Project Plan\n\n...",
472
"artifact_type": "project_plan",
473
"format": "markdown",
474
"metadata": {}
475
}
476
],
477
"sources": [
478
{
479
"source_id": "abc123",
480
"source_type": "video",
481
"title": "Sprint Planning Meeting",
482
"path": "/recordings/meeting.mp4",
483
"url": null,
484
"mime_type": "video/mp4",
485
"ingested_at": "2026-03-07T10:00:00.000000",
486
"metadata": {}
487
}
488
]
489
}
490
```
491
492
**Top-level fields:**
493
494
| Field | Type | Description |
495
|-------|------|-------------|
496
| `version` | `str` | Schema version (currently `"1.0"`) |
497
| `project` | `ProjectMeta` | Project-level metadata |
498
| `entities` | `List[Entity]` | Knowledge graph entities |
499
| `relationships` | `List[Relationship]` | Knowledge graph relationships |
500
| `artifacts` | `List[ArtifactMeta]` | Generated artifacts (plans, PRDs, etc.) |
501
| `sources` | `List[SourceRecord]` | Content source provenance records |
502
503
### Merging exchange files
504
505
The exchange format supports merging, with automatic deduplication:
506
507
- Entities are deduplicated by name
508
- Relationships are deduplicated by the tuple `(source, target, type)`
509
- Artifacts are deduplicated by name
510
- Sources are deduplicated by `source_id`
511
512
```python
513
from video_processor.exchange import PlanOpticonExchange
514
515
# Load two exchange files
516
ex1 = PlanOpticonExchange.from_file("sprint-1.json")
517
ex2 = PlanOpticonExchange.from_file("sprint-2.json")
518
519
# Merge ex2 into ex1
520
ex1.merge(ex2)
521
522
# Save the combined result
523
ex1.to_file("combined.json")
524
```
525
526
The `project.updated_at` timestamp is updated automatically on merge.
527
528
### Python API
529
530
**Create from a knowledge graph:**
531
532
```python
533
from video_processor.exchange import PlanOpticonExchange
534
from video_processor.integrators.knowledge_graph import KnowledgeGraph
535
536
kg = KnowledgeGraph(db_path="knowledge_graph.db")
537
kg_data = kg.to_dict()
538
539
exchange = PlanOpticonExchange.from_knowledge_graph(
540
kg_data,
541
project_name="My Project",
542
project_description="Analysis of sprint planning meetings",
543
tags=["planning", "backend"],
544
)
545
```
546
547
**Save and load:**
548
549
```python
550
# Save to file
551
exchange.to_file("exchange.json")
552
553
# Load from file
554
loaded = PlanOpticonExchange.from_file("exchange.json")
555
```
556
557
**Get JSON Schema:**
558
559
```python
560
schema = PlanOpticonExchange.json_schema()
561
```
562
563
This returns the full JSON Schema for validation and documentation purposes.
564
565
## Python API for all exporters
566
567
### Markdown document generation
568
569
```python
570
from pathlib import Path
571
from video_processor.exporters.markdown import (
572
generate_all,
573
generate_executive_summary,
574
generate_meeting_notes,
575
generate_glossary,
576
generate_relationship_map,
577
generate_status_report,
578
generate_entity_index,
579
generate_csv_export,
580
generate_entity_brief,
581
DOCUMENT_TYPES,
582
)
583
from video_processor.integrators.knowledge_graph import KnowledgeGraph
584
585
kg = KnowledgeGraph(db_path=Path("knowledge_graph.db"))
586
kg_data = kg.to_dict()
587
588
# Generate all document types at once
589
created_files = generate_all(kg_data, Path("./export"))
590
591
# Generate specific document types
592
created_files = generate_all(
593
kg_data,
594
Path("./export"),
595
doc_types=["summary", "glossary", "csv"],
596
)
597
598
# Generate individual documents (returns markdown string)
599
summary = generate_executive_summary(kg_data)
600
notes = generate_meeting_notes(kg_data, title="Sprint Planning")
601
glossary = generate_glossary(kg_data)
602
rel_map = generate_relationship_map(kg_data)
603
status = generate_status_report(kg_data, title="Q1 Status")
604
index = generate_entity_index(kg_data)
605
csv_text = generate_csv_export(kg_data)
606
607
# Generate a brief for a single entity
608
entity = kg_data["nodes"][0]
609
relationships = kg_data["relationships"]
610
brief = generate_entity_brief(entity, relationships)
611
```
612
613
### Obsidian export
614
615
```python
616
from pathlib import Path
617
from video_processor.agent.skills.notes_export import export_to_obsidian
618
from video_processor.integrators.knowledge_graph import KnowledgeGraph
619
620
kg = KnowledgeGraph(db_path=Path("knowledge_graph.db"))
621
kg_data = kg.to_dict()
622
623
created_files = export_to_obsidian(kg_data, Path("./obsidian-vault"))
624
print(f"Created {len(created_files)} files")
625
```
626
627
### Notion export
628
629
```python
630
from pathlib import Path
631
from video_processor.agent.skills.notes_export import export_to_notion_md
632
from video_processor.integrators.knowledge_graph import KnowledgeGraph
633
634
kg = KnowledgeGraph(db_path=Path("knowledge_graph.db"))
635
kg_data = kg.to_dict()
636
637
created_files = export_to_notion_md(kg_data, Path("./notion-export"))
638
```
639
640
### Wiki generation
641
642
```python
643
from pathlib import Path
644
from video_processor.agent.skills.wiki_generator import (
645
generate_wiki,
646
write_wiki,
647
push_wiki,
648
)
649
from video_processor.integrators.knowledge_graph import KnowledgeGraph
650
651
kg = KnowledgeGraph(db_path=Path("knowledge_graph.db"))
652
kg_data = kg.to_dict()
653
654
# Generate pages as a dict of {filename: content}
655
pages = generate_wiki(kg_data, title="Project Wiki")
656
657
# Write to disk
658
written = write_wiki(pages, Path("./wiki"))
659
660
# Push to GitHub (requires git auth)
661
success = push_wiki(Path("./wiki"), "owner/repo", message="Update wiki")
662
```
663
664
## Companion REPL
665
666
Inside the interactive companion REPL, use the `/export` command:
667
668
```
669
> /export markdown
670
Export 'markdown' requested. Use the CLI command:
671
planopticon export markdown ./knowledge_graph.db
672
673
> /export obsidian
674
Export 'obsidian' requested. Use the CLI command:
675
planopticon export obsidian ./knowledge_graph.db
676
```
677
678
The REPL provides guidance on the CLI command to run; actual export is performed via the CLI.
679
680
## Common workflows
681
682
### Analyze videos and export to Obsidian
683
684
```bash
685
# Analyze meeting recordings
686
planopticon analyze meeting-1.mp4 -o ./results
687
planopticon analyze meeting-2.mp4 --db-path ./results/knowledge_graph.db
688
689
# Ingest supplementary docs
690
planopticon ingest ./specs/ --db-path ./results/knowledge_graph.db
691
692
# Export to Obsidian vault
693
planopticon export obsidian ./results/knowledge_graph.db -o ~/Obsidian/ProjectVault
694
695
# Open in Obsidian and explore the graph view
696
```
697
698
### Generate project documentation
699
700
```bash
701
# Generate all markdown documents
702
planopticon export markdown knowledge_graph.db -o ./docs
703
704
# The output includes:
705
# docs/summary.md - Executive summary
706
# docs/meeting-notes.md - Meeting notes format
707
# docs/glossary.md - Entity glossary
708
# docs/relationship-map.md - Relationships + Mermaid diagram
709
# docs/status-report.md - Project status report
710
# docs/entity-index.md - Master entity index
711
# docs/csv.csv - Spreadsheet-ready CSV
712
# docs/entities/ - Individual entity briefs
713
```
714
715
### Publish a GitHub wiki
716
717
```bash
718
# Generate wiki pages
719
planopticon wiki generate knowledge_graph.db -o ./wiki --title "Project Knowledge Base"
720
721
# Review locally, then push
722
planopticon wiki push ./wiki ConflictHQ/my-project -m "Initial wiki from meeting analysis"
723
```
724
725
### Share data between projects
726
727
```bash
728
# Export from project A
729
planopticon export exchange ./project-a/knowledge_graph.db \
730
-o project-a.json --name "Project A"
731
732
# Export from project B
733
planopticon export exchange ./project-b/knowledge_graph.db \
734
-o project-b.json --name "Project B"
735
736
# Merge in Python
737
python -c "
738
from video_processor.exchange import PlanOpticonExchange
739
a = PlanOpticonExchange.from_file('project-a.json')
740
b = PlanOpticonExchange.from_file('project-b.json')
741
a.merge(b)
742
a.to_file('combined.json')
743
print(f'Combined: {len(a.entities)} entities, {len(a.relationships)} relationships')
744
"
745
```
746
747
### Export for spreadsheet analysis
748
749
```bash
750
# Generate just the CSV
751
planopticon export markdown knowledge_graph.db --type csv -o ./export
752
753
# The file export/csv.csv can be opened in Excel, Google Sheets, etc.
754
```
755
756
Alternatively, the Notion export includes an `entities_database.csv` that can be imported into any spreadsheet tool or Notion database.
757

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button