ugraph-kit 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ugraph/__init__.py +28 -0
- ugraph/_bundled/skills/channel-to-kb/SKILL.md +194 -0
- ugraph/_bundled/skills/channel-to-kb/references/candidate-extraction-text.md +39 -0
- ugraph/_bundled/skills/channel-to-kb/references/candidate-extraction.md +115 -0
- ugraph/_bundled/templates/SCHEMA.md +177 -0
- ugraph/_bundled/templates/taxonomy.json +44 -0
- ugraph/auth.py +194 -0
- ugraph/capture_intent.py +104 -0
- ugraph/cli.py +1465 -0
- ugraph/config.py +259 -0
- ugraph/embed.py +442 -0
- ugraph/extract.py +922 -0
- ugraph/graph.py +626 -0
- ugraph/indexes.py +329 -0
- ugraph/ingest.py +359 -0
- ugraph/ledger.py +366 -0
- ugraph/limits.py +184 -0
- ugraph/lint.py +462 -0
- ugraph/model.py +317 -0
- ugraph/person.py +221 -0
- ugraph/promote.py +150 -0
- ugraph/py.typed +0 -0
- ugraph/runs.py +191 -0
- ugraph/select.py +161 -0
- ugraph/sources/__init__.py +11 -0
- ugraph/sources/youtube.py +758 -0
- ugraph/status.py +292 -0
- ugraph/store.py +173 -0
- ugraph/templates.py +37 -0
- ugraph/verify.py +838 -0
- ugraph/wizard.py +187 -0
- ugraph_kit-0.1.0.dist-info/METADATA +248 -0
- ugraph_kit-0.1.0.dist-info/RECORD +37 -0
- ugraph_kit-0.1.0.dist-info/WHEEL +5 -0
- ugraph_kit-0.1.0.dist-info/entry_points.txt +2 -0
- ugraph_kit-0.1.0.dist-info/licenses/LICENSE +158 -0
- ugraph_kit-0.1.0.dist-info/top_level.txt +1 -0
ugraph/__init__.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ugraph-kit — build an agent-navigable knowledge base from any input you trust.
|
|
3
|
+
|
|
4
|
+
Clipboard, paste, pipe, file, or URL. Plain markdown, YAML frontmatter, relative links.
|
|
5
|
+
No database, no embeddings. An agent reads an index, follows links to the few pages it
|
|
6
|
+
needs, and cites a chunk or timestamp in an immutable raw source.
|
|
7
|
+
|
|
8
|
+
The format is the Open Knowledge Format, originated by Cole Medin
|
|
9
|
+
(github.com/coleam00/cole-medin-knowledge-base). This package is an independent
|
|
10
|
+
implementation of it as a reusable tool; divergences are marked OKF-v in SCHEMA.md.
|
|
11
|
+
|
|
12
|
+
Library entry points:
|
|
13
|
+
|
|
14
|
+
from ugraph import config, indexes, ingest, lint, status, verify
|
|
15
|
+
from ugraph.sources import youtube
|
|
16
|
+
|
|
17
|
+
cfg = config.load(kb="~/vault/knowledge")
|
|
18
|
+
ingest.capture_text(cfg, "a claim you care about") # any text
|
|
19
|
+
ingest.ingest_path(cfg, "./note.md") # any file
|
|
20
|
+
youtube.ingest(cfg, "https://youtube.com/@example", limit=25)
|
|
21
|
+
indexes.write_all(cfg)
|
|
22
|
+
findings, pages = lint.lint(cfg)
|
|
23
|
+
issues = verify.verify(cfg)
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
__version__ = "0.1.0"
|
|
27
|
+
|
|
28
|
+
__all__ = ["__version__"]
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: channel-to-kb
|
|
3
|
+
description: Extract concepts and entities from ingested YouTube transcripts into an OKF knowledge base. Use when transcripts exist in raw/ with source pages marked summary_status pending, or when the user asks to process/extract/summarize ingested talks, grow the knowledge base from a channel, or run the extraction pass.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Channel → Knowledge Base (extraction pass)
|
|
7
|
+
|
|
8
|
+
Stage 2 of the KB pipeline. Stage 1 (`ugraph ingest`) already
|
|
9
|
+
put timestamped transcripts in `raw/` and stub pages in `sources/`. This skill turns
|
|
10
|
+
them into **canonical, cross-linked concept and entity pages**.
|
|
11
|
+
|
|
12
|
+
Read `SCHEMA.md` at the KB root before writing anything. It is the contract;
|
|
13
|
+
`ugraph lint` enforces it.
|
|
14
|
+
|
|
15
|
+
## The one rule that matters
|
|
16
|
+
|
|
17
|
+
**Synthesize across sources; never create one page per video.**
|
|
18
|
+
|
|
19
|
+
A concept page is not a talk summary. It is the canonical statement of an idea,
|
|
20
|
+
assembled from every source that taught it. Ten talks mentioning context engineering
|
|
21
|
+
produce **one** `concepts/context-engineering.md` citing ten sources — not ten pages.
|
|
22
|
+
|
|
23
|
+
If you find yourself creating `concepts/mcp-apps-talk.md`, stop. That is a source, and
|
|
24
|
+
it already exists in `sources/`.
|
|
25
|
+
|
|
26
|
+
## Two modes
|
|
27
|
+
|
|
28
|
+
**Single-pass** (below) — read transcripts and write pages in one go. Correct for
|
|
29
|
+
batches of ~10 or fewer.
|
|
30
|
+
|
|
31
|
+
**Two-phase** — for a channel too large to hold in one context (100+ talks). The reason
|
|
32
|
+
it exists: canonicalization needs a global view, but 750k tokens of transcript won't fit
|
|
33
|
+
alongside page writing. Splitting lets the expensive reading go parallel while the
|
|
34
|
+
decision that needs global knowledge stays serial.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Phase A parallel, one agent per transcript → <candidates>/<slug>.json
|
|
38
|
+
spec: references/candidate-extraction.md
|
|
39
|
+
emits candidates ONLY — never pages
|
|
40
|
+
Phase B serial, one context → cluster candidates, decide
|
|
41
|
+
create / merge / embed against the existing concepts/index.md
|
|
42
|
+
Phase C parallel, ONE AGENT PER CONCEPT → write pages
|
|
43
|
+
parallelising by concept, not transcript, makes write conflicts impossible
|
|
44
|
+
Phase D serial → reciprocity, ugraph index, ugraph lint
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Never parallelise Phase C by transcript.** Twenty agents reading twenty talks will each
|
|
48
|
+
independently create `context-engineering.md`, and the merge — the entire value of the
|
|
49
|
+
KB — is lost.
|
|
50
|
+
|
|
51
|
+
Check progress with `ugraph status --clusters`, or `ugraph ledger --stuck 0` for the
|
|
52
|
+
per-item work queue.
|
|
53
|
+
|
|
54
|
+
## Workflow (single-pass, and Phase B/C of two-phase)
|
|
55
|
+
|
|
56
|
+
### 1. Pick the batch
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
ugraph ledger --pending --limit 10
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Default batch size is **10 transcripts**. Larger batches degrade canonicalization —
|
|
63
|
+
you stop noticing that talk 14 and talk 3 are describing the same idea.
|
|
64
|
+
|
|
65
|
+
### 2. Load what already exists — before reading any transcript
|
|
66
|
+
|
|
67
|
+
Read `concepts/index.md` and `entities/index.md` at the KB root, or:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
ugraph status --thin # concepts with one source — the likeliest merge targets
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This is the dedup baseline. You cannot canonicalize against pages you haven't seen,
|
|
74
|
+
and the most common failure of this pass is creating a near-duplicate of a concept that
|
|
75
|
+
already exists under a slightly different name.
|
|
76
|
+
|
|
77
|
+
### 3. Read the transcripts
|
|
78
|
+
|
|
79
|
+
Read each `raw/` file in the batch. For each, note:
|
|
80
|
+
|
|
81
|
+
- **Claims worth keeping** — with their `[HH:MM:SS]` timestamps
|
|
82
|
+
- **Named things** — tools, people, companies → candidate entities
|
|
83
|
+
- **Ideas** — techniques, patterns, arguments → candidate concepts
|
|
84
|
+
|
|
85
|
+
Ignore: conference logistics, speaker intros, demo narration, audience Q&A chatter.
|
|
86
|
+
A 20-minute talk usually yields 1–3 real concepts. Often zero. **Zero is a valid
|
|
87
|
+
result** — say so rather than manufacturing a page.
|
|
88
|
+
|
|
89
|
+
### 4. Canonicalize
|
|
90
|
+
|
|
91
|
+
For each candidate, decide:
|
|
92
|
+
|
|
93
|
+
| Situation | Action |
|
|
94
|
+
|---|---|
|
|
95
|
+
| Page already exists | **Merge** — add the new source's angle + citation to the existing page. Update `sources:` and `updated:`. |
|
|
96
|
+
| New, and appears in ≥2 sources *or* linked from ≥2 places | **Create** a new page |
|
|
97
|
+
| New, appears once, not linked elsewhere | **Embed** it in a parent concept — do not create a page |
|
|
98
|
+
|
|
99
|
+
That last row is the page-creation threshold from SCHEMA.md. Respect it. A KB of
|
|
100
|
+
single-mention stubs is worse than a smaller dense one.
|
|
101
|
+
|
|
102
|
+
### 5. Write the pages
|
|
103
|
+
|
|
104
|
+
Follow SCHEMA.md exactly:
|
|
105
|
+
|
|
106
|
+
- Frontmatter: `type`, `title`, one-sentence `description`, `domain` (closed vocabulary
|
|
107
|
+
in `taxonomy.json`), `status`, `sources`, `created`, `updated`
|
|
108
|
+
- **Relative markdown links only.** No `[[wikilinks]]` anywhere in the OKF tree.
|
|
109
|
+
- Typed relationship headings: `## Prerequisites`, `## Builds on`, `## Contrasts with`,
|
|
110
|
+
`## Implemented by`, `## Related`, `## Sources`
|
|
111
|
+
- **Reciprocate every typed edge.** If A links to B under a typed heading, add the
|
|
112
|
+
matching link on B. The linter warns on one-way edges.
|
|
113
|
+
- Cite claims: `([Talk title](../sources/ai-engineer/slug.md) @ 00:14:32)`
|
|
114
|
+
|
|
115
|
+
### 6. Update the source pages you consumed
|
|
116
|
+
|
|
117
|
+
For each source in the batch:
|
|
118
|
+
|
|
119
|
+
- Replace the placeholder `description` with a real one-sentence thesis
|
|
120
|
+
- Set `summary_status: done`
|
|
121
|
+
- Replace the stub body with a short summary and a `## Concepts extracted` list
|
|
122
|
+
linking to the concept pages you wrote
|
|
123
|
+
|
|
124
|
+
### 7. Record what you did
|
|
125
|
+
|
|
126
|
+
The lifecycle ledger derives current state from the files, but it cannot know *when* a
|
|
127
|
+
stage happened or *why* something was set aside. Phases A–C run in an agent rather than
|
|
128
|
+
in Python, so those transitions are only in the ledger if you put them there:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
ugraph ledger record <source-slug> extracted --by "phase A"
|
|
132
|
+
ugraph ledger record <source-slug> synthesized --by "phase C" --detail "fed 3 concepts"
|
|
133
|
+
ugraph ledger record <source-slug> skipped --by "phase A" --detail "vendor pitch, no transferable content"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`skipped` matters as much as the others. A talk with nothing in it is *finished*, not
|
|
137
|
+
pending, and without that record it sits in the backlog forever being re-read.
|
|
138
|
+
|
|
139
|
+
If you defer a talk to a different cluster, record `extracted` with a detail saying
|
|
140
|
+
where it went. That is the difference between "in flight" and "forgotten".
|
|
141
|
+
|
|
142
|
+
### 8. Validate
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
ugraph index
|
|
146
|
+
ugraph lint
|
|
147
|
+
ugraph verify
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
All three must pass before you report done — `lint` and `verify` with **0 errors**. Fix what it reports; do not
|
|
151
|
+
hand back a failing KB. Orphan warnings on sources you just processed mean you didn't
|
|
152
|
+
link them from a concept — go back to step 5.
|
|
153
|
+
|
|
154
|
+
### 9. Report
|
|
155
|
+
|
|
156
|
+
Tell the user, concretely:
|
|
157
|
+
|
|
158
|
+
- Concepts **created** vs **merged into** (these are different, and merges are the
|
|
159
|
+
signal the KB is working)
|
|
160
|
+
- Entities added
|
|
161
|
+
- Transcripts that yielded nothing, and why
|
|
162
|
+
- Current lint status
|
|
163
|
+
|
|
164
|
+
Then stop. Let them review the diff before the next batch.
|
|
165
|
+
|
|
166
|
+
## Quality bar
|
|
167
|
+
|
|
168
|
+
The pages you write should read like the hand-built ones in `concepts/` — for example
|
|
169
|
+
any well-formed page already in `concepts/`. Specifically:
|
|
170
|
+
|
|
171
|
+
- A `>` blockquote opening line that states the idea sharply
|
|
172
|
+
- Prose that explains *why it matters*, not a bulleted transcript restatement
|
|
173
|
+
- Genuine cross-links that a reader would actually follow
|
|
174
|
+
- Every non-obvious claim traceable to a source and timestamp
|
|
175
|
+
|
|
176
|
+
**Do not pad.** If a concept only warrants four sentences, write four sentences.
|
|
177
|
+
A short true page beats a long padded one.
|
|
178
|
+
|
|
179
|
+
## What not to do
|
|
180
|
+
|
|
181
|
+
- Don't invent claims the transcript doesn't support. Auto-captions garble names and
|
|
182
|
+
terms — if a term looks mangled, verify against the video or leave it out.
|
|
183
|
+
- Don't create a concept page per talk.
|
|
184
|
+
- Don't use `[[wikilinks]]` in the OKF tree.
|
|
185
|
+
- Don't edit anything in `raw/`. It is immutable provenance.
|
|
186
|
+
- Don't mark `summary_status: done` on a source you didn't actually read.
|
|
187
|
+
- Don't skip the lint step.
|
|
188
|
+
|
|
189
|
+
## Related
|
|
190
|
+
|
|
191
|
+
- Stage 1 ingestion — `ugraph ingest`
|
|
192
|
+
- Schema contract — `SCHEMA.md` at the KB root
|
|
193
|
+
- Conformance gate — `ugraph lint` · quote verification — `ugraph verify`
|
|
194
|
+
- Index generation — `ugraph index` · lifecycle — `ugraph ledger`
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Phase A candidate extraction — text documents (chunk-anchored)
|
|
2
|
+
|
|
3
|
+
You are extracting candidate concepts from one pasted text document. The document is
|
|
4
|
+
given to you as numbered chunks (`--- CHUNK <id> ---`). This is mechanical work:
|
|
5
|
+
find the claims, copy the words exactly. Do not synthesize, do not editorialize, do
|
|
6
|
+
not merge ideas across the document.
|
|
7
|
+
|
|
8
|
+
## Rules
|
|
9
|
+
|
|
10
|
+
1. `verbatim_quote` MUST be an exact substring of ONE chunk, copied
|
|
11
|
+
character-for-character (whitespace may differ). Never quote across a chunk
|
|
12
|
+
boundary. If you cannot quote it, it is not a concept — it is your paraphrase,
|
|
13
|
+
and it will be rejected by a substring test before anything is written.
|
|
14
|
+
2. Do NOT invent anchors or timestamps. The pipeline derives the anchor (chunk id)
|
|
15
|
+
from your quote. You only supply name, claim, and quote.
|
|
16
|
+
3. `claim` is one sentence: what the text asserts, in your words. The claim may
|
|
17
|
+
paraphrase; the quote may not.
|
|
18
|
+
4. `name` is a short concept name (e.g. "reciprocal rank fusion").
|
|
19
|
+
5. Prefer 3–8 strong concepts over 20 weak ones. Marketing copy, a changelog of
|
|
20
|
+
trivia, or content-free notes are `yield: "none"` with an empty list — that is a
|
|
21
|
+
correct answer.
|
|
22
|
+
6. Tables count as text: quoting one full row is fine if it sits inside one chunk.
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
|
|
26
|
+
Return ONLY this JSON object, no prose, no code fence:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"yield": "high | medium | low | none",
|
|
31
|
+
"concepts": [
|
|
32
|
+
{
|
|
33
|
+
"name": "concept name",
|
|
34
|
+
"claim": "one sentence: what is asserted",
|
|
35
|
+
"verbatim_quote": "exact substring from one chunk"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Phase A — candidate extraction (subagent spec)
|
|
2
|
+
|
|
3
|
+
You read **one transcript** and emit **one JSON file**. You do not write knowledge base
|
|
4
|
+
pages. You do not decide whether a concept deserves a page — that decision needs a view
|
|
5
|
+
across the whole corpus, which you don't have.
|
|
6
|
+
|
|
7
|
+
Your output is the raw material a later canonicalization pass clusters. Precision matters
|
|
8
|
+
more than coverage: a wrong quote poisons a page that cites it.
|
|
9
|
+
|
|
10
|
+
## Input / output
|
|
11
|
+
|
|
12
|
+
- **Read:** `<kb>/raw/<channel>/<slug>.md`
|
|
13
|
+
- **Write:** the KB's candidates directory — `ugraph status --json`
|
|
14
|
+
reports it, and it defaults to `.ugraph/candidates/<slug>.json`
|
|
15
|
+
|
|
16
|
+
Nothing else. Do not touch anything under the knowledge base itself.
|
|
17
|
+
|
|
18
|
+
## Schema
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"slug": "ai-engineer/<slug>",
|
|
23
|
+
"title": "exact title from the transcript frontmatter",
|
|
24
|
+
"yield": "high | low | none",
|
|
25
|
+
"thesis": "One sentence: the argument this talk makes. Not a topic label.",
|
|
26
|
+
"cluster_hint": "harness | memory-context | rl-posttraining | evals | security | fde | multi-agent | long-horizon | meta-role | ux-product | local-edge | vertical | mcp | other",
|
|
27
|
+
"concepts": [
|
|
28
|
+
{
|
|
29
|
+
"name": "short lowercase noun phrase",
|
|
30
|
+
"claim": "One sentence stating what the talk asserts about this.",
|
|
31
|
+
"verbatim_quote": "Exact words copied from the transcript.",
|
|
32
|
+
"timestamp": "00:14:32",
|
|
33
|
+
"domain": "agentic_systems | ai_engineering | rag | local_llms | machine_learning | mathematics | system_design | product"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"entities": [
|
|
37
|
+
{"name": "TauBench", "subtype": "tool", "note": "one line on what it is / why it matters here"}
|
|
38
|
+
],
|
|
39
|
+
"notes": "Optional. Caveats, garbled sections, anything the canonicalizer should know."
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Rules
|
|
44
|
+
|
|
45
|
+
**Quotes must be verbatim.** Copy exactly from the transcript — do not clean up grammar,
|
|
46
|
+
do not paraphrase, do not stitch two sentences together. The quote is what a later page
|
|
47
|
+
will cite, and someone will click the timestamp to check it. Auto-captions are messy;
|
|
48
|
+
that's fine, copy the mess.
|
|
49
|
+
|
|
50
|
+
**Timestamps must be real.** Use the `[HH:MM:SS]` marker of the paragraph the quote came
|
|
51
|
+
from. Never estimate.
|
|
52
|
+
|
|
53
|
+
**Watch for garbled names.** These are machine captions. Speaker names, company names, and
|
|
54
|
+
product names are frequently mangled — real examples: "Aruba"/"Rue Ba" for Uber,
|
|
55
|
+
"SER"/"Sonder" for SonderMind, "Sweet Bench" for SWE-Bench. If a term looks corrupted and
|
|
56
|
+
you cannot confidently recover it, **omit it or flag it in `notes`. Never guess a name.**
|
|
57
|
+
|
|
58
|
+
**`yield: none` is a correct answer.** Track intros, sponsor pitches, workshop logistics,
|
|
59
|
+
and demo narration frequently contain no transferable idea. Return `"yield": "none"` with
|
|
60
|
+
an empty `concepts` array and say why in `notes`. Do not manufacture concepts to look
|
|
61
|
+
productive. A typical 20-minute conference talk yields **1–3** real concepts; many yield
|
|
62
|
+
zero.
|
|
63
|
+
|
|
64
|
+
**Name concepts generically, not by talk.** `"context compaction"`, not
|
|
65
|
+
`"Notion's approach to context compaction"`. The canonicalizer merges by name, so
|
|
66
|
+
talk-specific names defeat the whole point. If two talks describe the same idea, they
|
|
67
|
+
should produce the same or similar `name`.
|
|
68
|
+
|
|
69
|
+
**One entry per distinct idea.** Don't split one idea into four near-identical entries to
|
|
70
|
+
pad the list, and don't merge two genuinely different ideas into one.
|
|
71
|
+
|
|
72
|
+
## What counts as a concept
|
|
73
|
+
|
|
74
|
+
Include a technique, pattern, architectural decision, failure mode, or argument that
|
|
75
|
+
would still be useful to someone who never watches this talk.
|
|
76
|
+
|
|
77
|
+
Exclude: product announcements, company background, conference logistics, "come to our
|
|
78
|
+
booth", personal anecdotes without a transferable point, and restatements of things every
|
|
79
|
+
practitioner already knows.
|
|
80
|
+
|
|
81
|
+
**Read the Q&A. Weight it up, not down.** This is counterintuitive and it was learned the
|
|
82
|
+
hard way: on a 94-minute workshop, ~60% of the runtime was setup and live-coding narration
|
|
83
|
+
that yielded nothing — but the audience Q&A was the single richest vein in the file, and
|
|
84
|
+
four of eleven concepts came from it. Prepared talks are rehearsed and often pitch-shaped.
|
|
85
|
+
Q&A is unscripted practitioners asking about the thing that actually bit them
|
|
86
|
+
("when do you copy data into a graph versus leave it in place?"). A speaker rarely
|
|
87
|
+
volunteers that. Never skip the last third of a transcript because the prepared portion
|
|
88
|
+
has ended.
|
|
89
|
+
|
|
90
|
+
**Judge the source, not just the content.** If a talk is a vendor pitch with a
|
|
91
|
+
predetermined conclusion, or rests on a demo rather than a benchmark, say so in `notes`.
|
|
92
|
+
Extract the ideas anyway — but the canonicalizer needs to know whether a claim is backed
|
|
93
|
+
by production numbers at scale or by one person's home lab, because that decides whether
|
|
94
|
+
the resulting page carries `confidence: low`.
|
|
95
|
+
|
|
96
|
+
**The speaker can be wrong.** Verbatim quoting protects against caption noise; it does not
|
|
97
|
+
protect against factual error. One talk glossed OWL as "web object language" (it is Web
|
|
98
|
+
Ontology Language). Record the claim accurately, flag the error in `notes`, and never
|
|
99
|
+
propagate it as fact.
|
|
100
|
+
|
|
101
|
+
## Yield levels
|
|
102
|
+
|
|
103
|
+
| Level | Meaning |
|
|
104
|
+
|---|---|
|
|
105
|
+
| `high` | 2+ concepts a practitioner could act on |
|
|
106
|
+
| `low` | 1 concept, or ideas that are real but thin |
|
|
107
|
+
| `none` | nothing transferable |
|
|
108
|
+
|
|
109
|
+
## Before you finish
|
|
110
|
+
|
|
111
|
+
- Every `verbatim_quote` appears character-for-character in the transcript
|
|
112
|
+
- Every `timestamp` matches a real `[HH:MM:SS]` marker in that file
|
|
113
|
+
- Every `domain` is from the closed list above
|
|
114
|
+
- The JSON parses
|
|
115
|
+
- You wrote exactly one file, to the candidates directory
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: overview
|
|
3
|
+
title: "Knowledge Base Schema (OKF-v)"
|
|
4
|
+
description: "Page types, frontmatter contracts, relationships, and linking rules for this knowledge base."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Knowledge Base Schema — OKF-v
|
|
8
|
+
|
|
9
|
+
This knowledge base uses plain Markdown, YAML frontmatter, generated indexes,
|
|
10
|
+
and relative links. Raw source material remains inspectable; derived pages link
|
|
11
|
+
back to the sources that support them.
|
|
12
|
+
|
|
13
|
+
## Directory layout
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
knowledge/
|
|
17
|
+
├── index.md
|
|
18
|
+
├── SCHEMA.md
|
|
19
|
+
├── taxonomy.json
|
|
20
|
+
├── concepts/
|
|
21
|
+
├── entities/
|
|
22
|
+
│ ├── tools/
|
|
23
|
+
│ ├── people/
|
|
24
|
+
│ └── organizations/
|
|
25
|
+
├── sources/
|
|
26
|
+
├── raw/
|
|
27
|
+
└── _mocs/
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`concepts/` is flat. Subject grouping is represented by the `domain` field,
|
|
31
|
+
which keeps file paths stable when classification changes.
|
|
32
|
+
|
|
33
|
+
## Page contracts
|
|
34
|
+
|
|
35
|
+
All dates use `YYYY-MM-DD`.
|
|
36
|
+
|
|
37
|
+
### Concept
|
|
38
|
+
|
|
39
|
+
Location: `concepts/<slug>.md`
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
---
|
|
43
|
+
type: concept
|
|
44
|
+
title: "Generation-verification loop"
|
|
45
|
+
description: "A generator proposes outputs and an independent gate rejects unsupported ones."
|
|
46
|
+
domain: agentic_systems
|
|
47
|
+
status: growing
|
|
48
|
+
tags: [verification]
|
|
49
|
+
sources: [example/source-slug]
|
|
50
|
+
created: 2026-01-01
|
|
51
|
+
updated: 2026-01-01
|
|
52
|
+
---
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Required fields: `type`, `title`, `description`, `domain`, `status`, `created`,
|
|
56
|
+
and `updated`. Status is one of `seed`, `growing`, or `evergreen`.
|
|
57
|
+
|
|
58
|
+
### Entity
|
|
59
|
+
|
|
60
|
+
Location: `entities/{tools,people,organizations}/<slug>.md`
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
---
|
|
64
|
+
type: entity
|
|
65
|
+
subtype: person
|
|
66
|
+
title: "Example Person"
|
|
67
|
+
description: "A short, factual description."
|
|
68
|
+
resource: https://example.com
|
|
69
|
+
handles: ["@example"]
|
|
70
|
+
created: 2026-01-01
|
|
71
|
+
updated: 2026-01-01
|
|
72
|
+
---
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Required fields: `type`, `subtype`, `title`, `description`, `created`, and
|
|
76
|
+
`updated`. Subtype is one of `tool`, `person`, or `organization`.
|
|
77
|
+
|
|
78
|
+
### Source
|
|
79
|
+
|
|
80
|
+
Location: `sources/<publisher>/<slug>.md`
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
---
|
|
84
|
+
type: source
|
|
85
|
+
source_type: article
|
|
86
|
+
title: "Example source"
|
|
87
|
+
description: "The source's central claim in one sentence."
|
|
88
|
+
slug: example/source
|
|
89
|
+
url: https://example.com/source
|
|
90
|
+
created: 2026-01-01
|
|
91
|
+
updated: 2026-01-01
|
|
92
|
+
---
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Required fields: `type`, `source_type`, `title`, `description`, `slug`,
|
|
96
|
+
`created`, and `updated`. Video sources additionally require `youtube_id`,
|
|
97
|
+
`url`, `published`, `duration`, and `raw`.
|
|
98
|
+
|
|
99
|
+
### Raw transcript
|
|
100
|
+
|
|
101
|
+
Location: `raw/<publisher>/<slug>.md`
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
---
|
|
105
|
+
type: raw-transcript
|
|
106
|
+
immutable: true
|
|
107
|
+
slug: example/source
|
|
108
|
+
url: https://example.com/source
|
|
109
|
+
---
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Never edit generated raw transcripts by hand. Timestamped transcript blocks use:
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
[00:04:12] The exact source text appears here.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### MOC and overview
|
|
119
|
+
|
|
120
|
+
Maps of content use `type: moc`. Entry points, redirects, and this schema use
|
|
121
|
+
`type: overview`. Both require `type` and `title`.
|
|
122
|
+
|
|
123
|
+
## Relationships
|
|
124
|
+
|
|
125
|
+
A Markdown link under one of these headings asserts an edge:
|
|
126
|
+
|
|
127
|
+
- `## Prerequisites`
|
|
128
|
+
- `## Builds on`
|
|
129
|
+
- `## Contrasts with`
|
|
130
|
+
- `## Implemented by`
|
|
131
|
+
- `## Related`
|
|
132
|
+
- `## Sources`
|
|
133
|
+
|
|
134
|
+
Typed edges should be linked in both directions where that relationship is
|
|
135
|
+
meaningful. Provenance links from concepts to sources do not require a forward
|
|
136
|
+
link from every source.
|
|
137
|
+
|
|
138
|
+
## Linking rules
|
|
139
|
+
|
|
140
|
+
- Use relative Markdown links inside the knowledge base.
|
|
141
|
+
- Do not use `[[wikilinks]]` in the strict tree (`concepts`, `entities`,
|
|
142
|
+
`sources`, and `_mocs`).
|
|
143
|
+
- Every link must resolve.
|
|
144
|
+
- Filenames are stable identities; use kebab-case and do not rename casually.
|
|
145
|
+
- Prefer one topic per page.
|
|
146
|
+
|
|
147
|
+
## Citation rule
|
|
148
|
+
|
|
149
|
+
Claims from timestamped material cite the source and exact time:
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
The speaker describes a verification loop
|
|
153
|
+
([Example talk](../sources/example/talk.md) @ 00:14:32).
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Text extraction candidates carry a content-addressed chunk anchor. ugraph's
|
|
157
|
+
verification gate rejects quotes that do not occur verbatim in the source.
|
|
158
|
+
|
|
159
|
+
## Domains
|
|
160
|
+
|
|
161
|
+
The closed vocabulary is defined in `taxonomy.json`. The default domains are:
|
|
162
|
+
|
|
163
|
+
`agentic_systems`, `ai_engineering`, `rag`, `local_llms`,
|
|
164
|
+
`machine_learning`, `mathematics`, `system_design`, and `product`.
|
|
165
|
+
|
|
166
|
+
## Validation
|
|
167
|
+
|
|
168
|
+
Run:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
ugraph lint
|
|
172
|
+
ugraph verify
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Errors include malformed frontmatter, unknown closed-vocabulary values, broken
|
|
176
|
+
links, invalid strict-tree wikilinks, and source pages whose raw target is
|
|
177
|
+
missing. Warnings identify issues such as orphan pages and one-way typed edges.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Closed vocabulary used for validation and generated index grouping.",
|
|
3
|
+
"domains": {
|
|
4
|
+
"agentic_systems": "Agentic Systems",
|
|
5
|
+
"ai_engineering": "AI Engineering",
|
|
6
|
+
"rag": "Retrieval & RAG",
|
|
7
|
+
"local_llms": "Local LLMs",
|
|
8
|
+
"machine_learning": "Machine Learning",
|
|
9
|
+
"mathematics": "Mathematics",
|
|
10
|
+
"system_design": "System Design",
|
|
11
|
+
"product": "Product & Strategy"
|
|
12
|
+
},
|
|
13
|
+
"domain_order": [
|
|
14
|
+
"agentic_systems",
|
|
15
|
+
"ai_engineering",
|
|
16
|
+
"rag",
|
|
17
|
+
"local_llms",
|
|
18
|
+
"machine_learning",
|
|
19
|
+
"mathematics",
|
|
20
|
+
"system_design",
|
|
21
|
+
"product"
|
|
22
|
+
],
|
|
23
|
+
"entity_subtypes": {
|
|
24
|
+
"tool": "Tools",
|
|
25
|
+
"person": "People",
|
|
26
|
+
"organization": "Organizations"
|
|
27
|
+
},
|
|
28
|
+
"entity_dirs": {
|
|
29
|
+
"tool": "tools",
|
|
30
|
+
"person": "people",
|
|
31
|
+
"organization": "organizations"
|
|
32
|
+
},
|
|
33
|
+
"source_types": {
|
|
34
|
+
"video": "Videos",
|
|
35
|
+
"talk": "Talks",
|
|
36
|
+
"paper": "Papers",
|
|
37
|
+
"article": "Articles",
|
|
38
|
+
"thread": "Threads",
|
|
39
|
+
"course": "Courses",
|
|
40
|
+
"book": "Books"
|
|
41
|
+
},
|
|
42
|
+
"moc_for_domain": {},
|
|
43
|
+
"page_types": {}
|
|
44
|
+
}
|