|
f0106a3…
|
leo
|
1 |
# Architecture Overview |
|
f0106a3…
|
leo
|
2 |
|
|
f0106a3…
|
leo
|
3 |
## System diagram |
|
f0106a3…
|
leo
|
4 |
|
|
f0106a3…
|
leo
|
5 |
```mermaid |
|
f0106a3…
|
leo
|
6 |
graph TD |
|
0981a08…
|
noreply
|
7 |
subgraph Sources |
|
0981a08…
|
noreply
|
8 |
S1[Video Files] |
|
0981a08…
|
noreply
|
9 |
S2[Google Workspace] |
|
0981a08…
|
noreply
|
10 |
S3[Microsoft 365] |
|
0981a08…
|
noreply
|
11 |
S4[Zoom / Teams / Meet] |
|
0981a08…
|
noreply
|
12 |
S5[YouTube] |
|
0981a08…
|
noreply
|
13 |
S6[Notes — Obsidian / Notion / Apple Notes] |
|
0981a08…
|
noreply
|
14 |
S7[GitHub] |
|
0981a08…
|
noreply
|
15 |
end |
|
0981a08…
|
noreply
|
16 |
|
|
0981a08…
|
noreply
|
17 |
subgraph Source Connectors |
|
0981a08…
|
noreply
|
18 |
SC[Source Connectors + OAuth] |
|
0981a08…
|
noreply
|
19 |
end |
|
0981a08…
|
noreply
|
20 |
|
|
0981a08…
|
noreply
|
21 |
S1 --> SC |
|
0981a08…
|
noreply
|
22 |
S2 --> SC |
|
0981a08…
|
noreply
|
23 |
S3 --> SC |
|
0981a08…
|
noreply
|
24 |
S4 --> SC |
|
0981a08…
|
noreply
|
25 |
S5 --> SC |
|
0981a08…
|
noreply
|
26 |
S6 --> SC |
|
0981a08…
|
noreply
|
27 |
S7 --> SC |
|
0981a08…
|
noreply
|
28 |
|
|
0981a08…
|
noreply
|
29 |
SC --> A[Ingest / Analyze Pipeline] |
|
0981a08…
|
noreply
|
30 |
|
|
0981a08…
|
noreply
|
31 |
A --> B[Frame Extractor] |
|
f0106a3…
|
leo
|
32 |
A --> C[Audio Extractor] |
|
f0106a3…
|
leo
|
33 |
B --> D[Diagram Analyzer] |
|
f0106a3…
|
leo
|
34 |
C --> E[Transcription] |
|
f0106a3…
|
leo
|
35 |
D --> F[Knowledge Graph] |
|
f0106a3…
|
leo
|
36 |
E --> F |
|
f0106a3…
|
leo
|
37 |
E --> G[Key Point Extractor] |
|
f0106a3…
|
leo
|
38 |
E --> H[Action Item Detector] |
|
f0106a3…
|
leo
|
39 |
D --> I[Content Analyzer] |
|
f0106a3…
|
leo
|
40 |
E --> I |
|
0981a08…
|
noreply
|
41 |
|
|
0981a08…
|
noreply
|
42 |
subgraph Agent & Skills |
|
0981a08…
|
noreply
|
43 |
AG[Planning Agent] |
|
0981a08…
|
noreply
|
44 |
SK[Skill Registry] |
|
0981a08…
|
noreply
|
45 |
CO[Companion REPL] |
|
0981a08…
|
noreply
|
46 |
end |
|
0981a08…
|
noreply
|
47 |
|
|
0981a08…
|
noreply
|
48 |
F --> AG |
|
0981a08…
|
noreply
|
49 |
G --> AG |
|
0981a08…
|
noreply
|
50 |
H --> AG |
|
0981a08…
|
noreply
|
51 |
I --> AG |
|
0981a08…
|
noreply
|
52 |
AG --> SK |
|
0981a08…
|
noreply
|
53 |
F --> CO |
|
0981a08…
|
noreply
|
54 |
|
|
f0106a3…
|
leo
|
55 |
F --> J[Plan Generator] |
|
f0106a3…
|
leo
|
56 |
G --> J |
|
f0106a3…
|
leo
|
57 |
H --> J |
|
f0106a3…
|
leo
|
58 |
I --> J |
|
0981a08…
|
noreply
|
59 |
|
|
0981a08…
|
noreply
|
60 |
subgraph Output & Export |
|
0981a08…
|
noreply
|
61 |
J --> K[Markdown Report] |
|
0981a08…
|
noreply
|
62 |
J --> L[HTML Report] |
|
0981a08…
|
noreply
|
63 |
J --> M[PDF Report] |
|
0981a08…
|
noreply
|
64 |
D --> N[Mermaid/SVG/PNG Export] |
|
0981a08…
|
noreply
|
65 |
EX[Exporters — Obsidian / Notion / Exchange / Wiki] |
|
0981a08…
|
noreply
|
66 |
end |
|
0981a08…
|
noreply
|
67 |
|
|
0981a08…
|
noreply
|
68 |
AG --> EX |
|
0981a08…
|
noreply
|
69 |
F --> EX |
|
f0106a3…
|
leo
|
70 |
``` |
|
f0106a3…
|
leo
|
71 |
|
|
f0106a3…
|
leo
|
72 |
## Module structure |
|
f0106a3…
|
leo
|
73 |
|
|
f0106a3…
|
leo
|
74 |
``` |
|
f0106a3…
|
leo
|
75 |
video_processor/ |
|
f0106a3…
|
leo
|
76 |
├── cli/ # CLI commands (Click) |
|
f0106a3…
|
leo
|
77 |
│ └── commands.py |
|
0981a08…
|
noreply
|
78 |
├── sources/ # Source connectors |
|
0981a08…
|
noreply
|
79 |
│ ├── gdrive.py # Google Drive |
|
0981a08…
|
noreply
|
80 |
│ ├── gws.py # Google Workspace (Docs, Sheets, Slides, Meet) |
|
0981a08…
|
noreply
|
81 |
│ ├── m365.py # Microsoft 365 (OneDrive, SharePoint, Teams) |
|
0981a08…
|
noreply
|
82 |
│ ├── dropbox.py # Dropbox |
|
0981a08…
|
noreply
|
83 |
│ ├── zoom.py # Zoom recordings |
|
0981a08…
|
noreply
|
84 |
│ ├── youtube.py # YouTube videos |
|
0981a08…
|
noreply
|
85 |
│ ├── notion.py # Notion pages |
|
0981a08…
|
noreply
|
86 |
│ ├── github.py # GitHub repos / wikis |
|
0981a08…
|
noreply
|
87 |
│ ├── obsidian.py # Obsidian vaults |
|
0981a08…
|
noreply
|
88 |
│ └── apple_notes.py # Apple Notes (macOS) |
|
f0106a3…
|
leo
|
89 |
├── extractors/ # Media extraction |
|
f0106a3…
|
leo
|
90 |
│ ├── frame_extractor.py # Video → frames |
|
f0106a3…
|
leo
|
91 |
│ └── audio_extractor.py # Video → WAV |
|
f0106a3…
|
leo
|
92 |
├── analyzers/ # AI-powered analysis |
|
f0106a3…
|
leo
|
93 |
│ ├── diagram_analyzer.py # Frame classification + extraction |
|
f0106a3…
|
leo
|
94 |
│ ├── content_analyzer.py # Cross-referencing |
|
f0106a3…
|
leo
|
95 |
│ └── action_detector.py # Action item detection |
|
f0106a3…
|
leo
|
96 |
├── integrators/ # Knowledge assembly |
|
f0106a3…
|
leo
|
97 |
│ ├── knowledge_graph.py # Entity/relationship graph |
|
0981a08…
|
noreply
|
98 |
│ ├── graph_query.py # Query engine |
|
f0106a3…
|
leo
|
99 |
│ └── plan_generator.py # Report generation |
|
0981a08…
|
noreply
|
100 |
├── agent/ # Planning agent |
|
0981a08…
|
noreply
|
101 |
│ ├── agent.py # Agent loop |
|
0981a08…
|
noreply
|
102 |
│ ├── skills.py # Skill registry |
|
0981a08…
|
noreply
|
103 |
│ └── companion.py # Companion REPL |
|
0981a08…
|
noreply
|
104 |
├── exporters/ # Export formats |
|
0981a08…
|
noreply
|
105 |
│ ├── markdown.py # Markdown export |
|
0981a08…
|
noreply
|
106 |
│ ├── obsidian.py # Obsidian vault export |
|
0981a08…
|
noreply
|
107 |
│ ├── notion.py # Notion export |
|
0981a08…
|
noreply
|
108 |
│ ├── wiki.py # Wiki generation + push |
|
0981a08…
|
noreply
|
109 |
│ └── exchange.py # PlanOpticon Exchange Format |
|
f0106a3…
|
leo
|
110 |
├── providers/ # AI provider abstraction |
|
f0106a3…
|
leo
|
111 |
│ ├── base.py # BaseProvider ABC |
|
f0106a3…
|
leo
|
112 |
│ ├── openai_provider.py |
|
f0106a3…
|
leo
|
113 |
│ ├── anthropic_provider.py |
|
f0106a3…
|
leo
|
114 |
│ ├── gemini_provider.py |
|
a0146a5…
|
noreply
|
115 |
│ ├── ollama_provider.py # Local Ollama (offline) |
|
0981a08…
|
noreply
|
116 |
│ ├── azure_provider.py # Azure OpenAI |
|
0981a08…
|
noreply
|
117 |
│ ├── together_provider.py |
|
0981a08…
|
noreply
|
118 |
│ ├── fireworks_provider.py |
|
0981a08…
|
noreply
|
119 |
│ ├── cerebras_provider.py |
|
0981a08…
|
noreply
|
120 |
│ ├── xai_provider.py # xAI / Grok |
|
f0106a3…
|
leo
|
121 |
│ ├── discovery.py # Auto-model-discovery |
|
f0106a3…
|
leo
|
122 |
│ └── manager.py # ProviderManager routing |
|
f0106a3…
|
leo
|
123 |
├── utils/ |
|
f0106a3…
|
leo
|
124 |
│ ├── json_parsing.py # Robust LLM JSON parsing |
|
f0106a3…
|
leo
|
125 |
│ ├── rendering.py # Mermaid + chart rendering |
|
f0106a3…
|
leo
|
126 |
│ ├── export.py # HTML/PDF export |
|
f0106a3…
|
leo
|
127 |
│ ├── api_cache.py # Disk-based response cache |
|
f0106a3…
|
leo
|
128 |
│ └── prompt_templates.py # LLM prompt management |
|
0981a08…
|
noreply
|
129 |
├── auth.py # OAuth flow management |
|
0981a08…
|
noreply
|
130 |
├── exchange.py # Exchange format schema |
|
f0106a3…
|
leo
|
131 |
├── models.py # Pydantic data models |
|
f0106a3…
|
leo
|
132 |
├── output_structure.py # Directory layout + manifest I/O |
|
f0106a3…
|
leo
|
133 |
└── pipeline.py # Core processing pipeline |
|
f0106a3…
|
leo
|
134 |
``` |
|
f0106a3…
|
leo
|
135 |
|
|
f0106a3…
|
leo
|
136 |
## Key design decisions |
|
f0106a3…
|
leo
|
137 |
|
|
f0106a3…
|
leo
|
138 |
- **Pydantic everywhere** — All structured data uses pydantic models for validation and serialization |
|
f0106a3…
|
leo
|
139 |
- **Manifest-driven** — Every run produces `manifest.json` as the single source of truth |
|
0981a08…
|
noreply
|
140 |
- **Provider abstraction** — Single `ProviderManager` wraps OpenAI, Anthropic, Gemini, Ollama, and additional providers behind a common interface |
|
f0106a3…
|
leo
|
141 |
- **No hardcoded models** — Model lists come from API discovery |
|
f0106a3…
|
leo
|
142 |
- **Screengrab fallback** — When extraction fails, save the frame as a captioned screenshot |
|
0981a08…
|
noreply
|
143 |
- **OAuth-first auth** — All cloud service integrations use OAuth via `planopticon auth`, with credentials stored locally. Service account keys are supported as a fallback for server-side automation |
|
0981a08…
|
noreply
|
144 |
- **Skill registry** — The planning agent discovers and invokes skills dynamically. Skills are self-describing and can be composed by the agent to accomplish complex tasks |
|
0981a08…
|
noreply
|
145 |
- **Exchange format** — A portable JSON format (`exchange.py`) for importing and exporting knowledge graphs between PlanOpticon instances and external tools |