Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions docs/DATA_MODEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ write, migrate, or interoperate with Graphium files.
>
> | UI label (EN / JA) | On-disk `WikiKind` |
> |---|---|
> | Topics / 話題 | `topic` |
> | Q&A / 問答 | `answer` |
> | Topics / トピック | `topic` |
> | Answers / 問答(Q&A) | `answer` |
> | Summaries / 要約 | `summary` |
> | Claims / 知見 | `claim` |
> | Insights / 洞察 | `atom` |
Expand Down Expand Up @@ -56,6 +56,34 @@ A few invariants underpin every schema in this document.

## 2. The note: `GraphiumDocument`

### Knowledge Schema system Skill

The Knowledge Schema is a single additive `GraphiumDocument` with `source:
"skill"` and `skillMeta.systemSkillId: "knowledge-schema"`. Its storage ID is
also the fixed string `knowledge-schema`. It uses the existing `SkillMeta`
default version and prompt hash fields, and the existing
`DocumentProvenance` revision chain for edits, default synchronization, and
Reset. It is not a `WikiKind`, is never projected to the note index, and does
not require a document-version or index-schema-version change.

On first creation only, the bundled Schema body is chosen from the current
Graphium UI locale (`ja` or `en`) and that language is stored in
`skillMeta.language`. Later locale changes do not translate or overwrite the
saved Schema. Version synchronization and Reset resolve the bundled default
from the saved `skillMeta.language`, so an untouched older English Schema
auto-updates to the current English default, while an edited older Schema only gets the
standard newer-default notification.

The only operation allowed to change the saved Schema language is the explicit,
confirmed language switch shown while the fixed `knowledge-schema` document is
open. It atomically replaces the body with the selected current bundled default and
updates `skillMeta.language`, version, and default prompt hash while preserving
the document version. Before replacement, the prior full document is stored in
the existing version-snapshot store so it can be restored, and the replacement
is recorded separately as a `knowledge_schema_language_switch`
revision/activity. Ordinary Skill metadata updates still preserve the existing
Schema language.

Each note is a single JSON file (or one row in IndexedDB for the `local`
provider). The top-level shape:

Expand Down Expand Up @@ -315,9 +343,10 @@ type TableSource = {
(`.txt` / `.dat` / `.csv`) are turned into ordinary tables, and the conversion
parameters — which lines were read, with which delimiter — are kept here rather
than thrown away. Dropping them would make the numbers untraceable back to the
raw file, which is exactly the thing this app exists to prevent. The preamble a
converter normally discards (`# Device Model: ENV-MONITOR-X9`) is kept as
`meta`, because for a lab note those lines *are* the measurement conditions.
raw file, which is exactly the thing this app exists to prevent. A preamble a
converter normally discards (for example `# Source: service-export-v4`) is kept
as `meta`, because those lines may carry essential runtime, collection, or
decision context in any domain.
When the file was also registered as an asset, `fileId` links the table back to
it and the import can be re-run with the stored settings.
- **Delimited imports become a `dataTable` block by default.** The block
Expand Down Expand Up @@ -1020,7 +1049,7 @@ only then created as new.
There is no separate ingest-time "consolidation" step and no target
member-count per topic — those would be thresholds nobody could
justify. Instead, near-duplicate or over-fragmented topics (wording
variants, particle differences, per-sample slices that should share a
variants, particle differences, per-case slices that should share a
page) are caught later by two Karpathy-style *lint* mechanisms that
look at the whole topic corpus at once, rather than one Claim at a
time:
Expand Down
4 changes: 3 additions & 1 deletion manual/ai-chat-and-ask.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ By default the chat can see the note you have open. To focus it on a specific pa
| Select multiple blocks → **Ask AI about selection** | Exactly the blocks you selected |
| Select text → **Ask AI about selection** in the floating toolbar | The selected text |

Whichever starting point you use, the note you have open is passed as background as well. A quoted sentence that leans on the lines before it — a pronoun, an abbreviation, "at this temperature" — is still understood. The answer stays on the quoted part; the rest of the note is there only for context. It is re-read on every message, so edits you make mid-conversation are picked up. <Badge type="tip" text="Added in v0.29.0 (2026-08-05)" />
Whichever starting point you use, the note you have open is passed as background as well. A quoted sentence that leans on the lines before it — a pronoun, an abbreviation, "under these conditions" — is still understood. The answer stays on the quoted part; the rest of the note is there only for context. It is re-read on every message, so edits you make mid-conversation are picked up. <Badge type="tip" text="Added in v0.29.0 (2026-08-05)" />

When a chat starts from blocks or a selection, the passed content stays visible at the top of the panel under **Quote**, so you always know what the conversation is about.

Expand Down Expand Up @@ -191,3 +191,5 @@ Each skill's **Edit** dialog controls:
| **Auto-apply on Ingest** | When on, the skill's prompt is automatically appended as instructions when Graphium generates knowledge from your notes — and in AI chat conversations |

Skills are ordinary documents: click one to edit its prompt body like any note.

The built-in **Knowledge Schema** is the exception to auto-apply: Graphium always supplies its saved body as a separate instruction when an assistant helps with Knowledge, or when Topics, Answers, and Claims are generated. The first saved default follows the UI language at creation time and does not change when you later switch the UI. To replace it deliberately, open the Schema and use the confirmed **Switch to Japanese** or **Switch to English** action; the previous body stays recoverable in History. It defines structure, citations, revision, and upkeep rather than writing voice; it can be edited and reset like a system skill, but cannot be deleted.
10 changes: 6 additions & 4 deletions manual/ja/ai-chat-and-ask.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
| 複数ブロックを選択 → **選択範囲を AI に聞く** | 選択したブロックだけ |
| テキストを選択 → フローティングツールバーの **選択範囲を AI に聞く** | 選択したテキスト |

どの起点で始めても、開いているノートの本文が背景として一緒に渡ります。引用した一文が前の行に寄りかかっている場合 — 指示語、略語、「この温度で」といった書き方 — でも話が通じます。回答の主題は引用した部分のままで、残りの本文は背景として添えられるだけです。本文はメッセージのたびに読み直されるので、会話の途中で加えた編集も反映されます。 <Badge type="tip" text="v0.29.0 (2026-08-05) で追加" />
どの起点で始めても、開いているノートの本文が背景として一緒に渡ります。引用した一文が前の行に寄りかかっている場合 — 指示語、略語、「この条件で」といった書き方 — でも話が通じます。回答の主題は引用した部分のままで、残りの本文は背景として添えられるだけです。本文はメッセージのたびに読み直されるので、会話の途中で加えた編集も反映されます。 <Badge type="tip" text="v0.29.0 (2026-08-05) で追加" />

ブロックや選択範囲からチャットを始めると、渡した内容がパネル上部の **引用** の下に表示され続けます。何についての会話なのかがいつでも分かります。

Expand Down Expand Up @@ -122,15 +122,15 @@ AI の返信には、それぞれ下にアクションボタンが付きます
| **置換** | 元のブロックを回答で置き換えます(特定のブロックからチャットを始めた場合に表示されます) |
| **別ノートとして派生** | 質問と回答から新しいノートを作り、元ノートへの来歴リンクを張ってサイドピークで開きます |
| **ナレッジにする** | 回答からナレッジ候補を抽出します(下記) |
| **ナレッジに残す** | 回答をそのまま、ナレッジ層の問答ページとして保存します(下記) |
| **ナレッジに残す** | 回答をナレッジ層の問答(Q&A)ページとして保存します(下記) |

### チャットからナレッジを取り出す <Badge type="tip" text="v0.16.8 (2026-07-02) で追加" />

**ナレッジにする** は、良い回答を[ナレッジ層](/ja/knowledge-layer)のエントリに変えます。選んでいないものは何も保存されません。Graphium は「知見を抽出中…」、続いて「洞察を生成中…」と表示したあと、**ナレッジ候補(選んで保存)** というピッカーを出します。各候補には **知見** または **洞察** のバッジが付きます。**すべて選択** / **選択解除** で調整して **選択した n 件を保存** を押し、何も残したくなければ **キャンセル** で閉じます。ナレッジページになるのは、選んだ候補だけです。

### 問答をまるごと残す
### 問答(Q&A)をまるごと残す

回答がすでに 1 つのまとまった説明として読めて、知見・洞察に分ける必要が無いなら、代わりに **ナレッジに残す** を押します。Graphium はまず AI をもう一度呼び、それまでの会話を渡して、その問答を単体で読める [問答ページ](/ja/knowledge-layer#種類) に書き起こします — 会話に寄りかかった回答で省かれていた前提を補い、タイトルも依頼の言い回しから離して書き直します。回答に表示されていた引用は、書き起こした文にそのまま引き継がれます。保存前に見直す画面はありません。書き起こしに失敗したとき、または元の回答にあった出典が 1 つも残らなかったときは、Graphium はメッセージの文章とタイトル(尋ねた質問)でそのまま保存します。保存が終わるとボタンは、新しいページへの **開く** リンク付きの確認表示に変わります。保存後はトピックと同じように保守され、資料が回答を更新・反証したときに改訂され、点検・出典照合の対象にもなります。詳しくは [ナレッジ層](/ja/knowledge-layer#問答をまるごと残す) を参照してください。
回答がすでに 1 つのまとまった説明として読めて、知見・洞察に分ける必要が無いなら、代わりに **ナレッジに残す** を押します。Graphium はまず AI をもう一度呼び、それまでの会話を渡して、その問答を単体で読める [問答(Q&A)ページ](/ja/knowledge-layer#save-answer-page) に書き起こします — 会話に寄りかかった回答で省かれていた前提を補い、タイトルも依頼の言い回しから離して書き直します。回答に表示されていた引用は、書き起こした文にそのまま引き継がれます。保存前に見直す画面はありません。書き起こしに失敗したとき、または元の回答にあった出典が 1 つも残らなかったときは、Graphium はメッセージの文章とタイトル(尋ねた質問)でそのまま保存します。保存が終わるとボタンは、新しいページへの **開く** リンク付きの確認表示に変わります。保存後はトピックと同じように保守され、資料が回答を更新・反証したときに改訂され、点検・出典照合の対象にもなります。詳しくは [ナレッジ層](/ja/knowledge-layer#save-answer-page) を参照してください。

## Composer(⌘K)

Expand Down Expand Up @@ -191,3 +191,5 @@ AI の返信には、それぞれ下にアクションボタンが付きます
| **ナレッジ化時に自動適用する** | オンにすると、Graphium がノートからナレッジを生成するとき、そのスキルのプロンプトが指示として自動で追加されます。AI チャットの会話でも同じように使われます |

スキルはふつうのドキュメントです。クリックすれば、ノートと同じようにプロンプト本文を編集できます。

組み込みの**ナレッジスキーマ**は自動適用スキルとは別です。アシスタントがナレッジ生成を支援するとき、およびトピック・問答(Q&A)・知見の生成時に、保存済み本文を独立した指示として渡します。初回保存される既定本文はその時点の UI 言語に従い、その後に UI 言語を変えても自動では切り替わりません。意図して置換するときだけ、ナレッジスキーマを開いて確認付きの **日本語版に切替** または **英語版に切替** を使います。置換前の本文は履歴から復元できます。文体ではなく構造、引用、改訂、点検を定義し、組み込みスキルと同様に編集・リセットできますが削除はできません。
Loading
Loading