This document explains the design principles and technical architecture of the Gyoshu notebook-centric research system.
In the previous architecture, research metadata was stored in a research.json manifest file. In the new architecture, the Jupyter notebook is the source of truth. All research metadata, run history, and status information are stored directly within the notebook file.
Each research project is a self-contained notebook. If you move the notebook, you move the research. By using YAML frontmatter in a raw cell, notebooks become compatible with tools like Quarto while remaining easy for Gyoshu to parse and update.
Workspaces are no longer virtual tags; they are physical directories within the notebooks/ root. This makes organization intuitive and visible in any file browser or Jupyter interface.
notebooks/: The home for all research notebooks.{workspace}/: Topic-based folders._quick/: Default folder for ad-hoc analysis.README.md: Auto-generated index of all workspaces and recent activity.
reports/: Mirrors thenotebooks/structure for research outputs.{reportTitle}/figures/: Saved plots and visualizations.{reportTitle}/models/: Saved model weights and binaries.{reportTitle}/exports/: Data exports (CSV, Parquet, etc.).{reportTitle}/report.md: Generated research report.
Runtime data is stored in OS-appropriate temp directories, NOT in the project:
- Linux (with XDG):
$XDG_RUNTIME_DIR/gyoshu/(e.g.,/run/user/{uid}/gyoshu/) - Linux (fallback):
~/.cache/gyoshu/runtime/ - macOS:
~/Library/Caches/gyoshu/runtime/ - Override: Set
GYOSHU_RUNTIME_DIRenvironment variable
This directory contains active session locks, Unix sockets for the Python bridge, and temporary runtime metadata. It is strictly for ephemeral state and never touches your project files.
Metadata is stored in the first cell of the notebook (type: raw).
---
# Gyoshu Research Metadata
gyoshu:
schema_version: 1
workspace: customer-analytics
slug: churn-prediction
status: active
created: "2026-01-01T10:00:00Z"
updated: "2026-01-01T15:00:00Z"
tags: [ml, classification, xgboost]
# Last 10 runs for quick context
runs:
- id: run-001
started: "2026-01-01T10:00:00Z"
status: completed
notes: "Baseline model with default parameters"
---Gyoshu maintains README.md files in each workspace and at the root of notebooks/. These files use sentinel blocks to protect manual edits:
# My Workspace
User-written introduction here.
<!-- GYOSHU:INDEX:BEGIN -->
| Research | Status | Updated | Tags |
|----------|--------|---------|------|
| [my-proj](./my-proj.ipynb) | active | 2026-01-01 | eda |
<!-- GYOSHU:INDEX:END -->
User-written conclusion here.Gyoshu automatically detects the project layout by looking for notebooks/, nbs/, or analysis/ directories. This allows it to adapt to existing project conventions.
- Creation:
/gyoshu <goal>creates a new notebook with the appropriate frontmatter. - Execution: During execution,
python-replcaptures outputs and updates the notebook. - Tagging: Cells are automatically tagged with
gyoshu-objective,gyoshu-finding, etc., to provide structure. - Maintenance:
/gyoshu workspace syncensures all indexes are up to date.
Legacy research is supported through a dual-read mechanism. The /gyoshu migrate --to-notebooks command automates the transition by:
- Reading legacy
research.jsonfiles. - Injecting that metadata into the notebook's YAML frontmatter.
- Moving notebooks and artifacts to the new hierarchical structure.