Thalo
Quick start workflow
- Initialize a knowledge base with
thalo init to generate entities.thalo, AGENTS.md, and
personal-bio.md.
- Add or edit entries in
*.thalo files or fenced code blocks inside Markdown (lang: thalo).
- Validate after changes with
thalo check to catch schema, link, and syntax issues.
- Format with
thalo format when preparing a commit or cleanup (or use Prettier with the plugin)
- Run
thalo actualize to materialize syntheses (queries + prompt) for LLM use.
Entry syntax
Follow this structure:
{timestamp} {directive} {entity} "Title" [^link-id] [#tags...]
{key}: {value}
...
# Section
{content}
Guidelines:
- Use ISO 8601 local time with timezone, e.g.
2026-01-05T15:30Z.
- Use
create for new entries and update for modifications.
- Provide a stable
^link-id when you want to reference the entry elsewhere.
- Put all content inside sections; required sections are defined in
entities.thalo.
- Entities are typically
journal, opinion, reference, or lore (see entities.thalo).
Metadata
Metadata fields are indented key-value pairs. Values can be:
- Strings:
author: "Jane Doe" or unquoted author: Jane Doe
- Links:
subject: ^self or related: ^my-other-entry
- Dates:
published: 2023-03-16
- Date ranges:
date: 2020 ~ 2021
Sections
Content sections start with # SectionName (indented). All content must be within a section.
Each entity type defines which sections are required/optional in entities.thalo.
Defining entities
Define or update entities in entities.thalo using define-entity blocks. Each entity specifies:
- Metadata fields with types (
string, link, datetime, date-range, enums, arrays,
unions).
- Sections that determine required/optional content.
After editing or adding entries or entities, generally run thalo check to validate.
If you need the default entity templates, load references/entities.thalo.txt.
Syntheses
Syntheses are queries plus prompts that let you generate structured summaries or narratives.
- Create with
define-synthesis blocks.
- Use
sources: to select entries by entity, tag, or metadata filters.
- Run
thalo actualize to output the sources and prompt for downstream LLM use.
Working in Markdown
Thalo can live inside Markdown files. The fenced code block language SHOULD be thalo (don't use it
in this file as an example because it would be parsed):
```text
...entries...
```
The CLI and LSP will parse fenced thalo blocks in .md files.
Installation
If thalo is not available, install via the user's package manager (local or global):
# Local (recommended for repo tooling)
npm install --save-dev @rejot-dev/thalo-cli
# Or with your preferred PM:
pnpm add -D @rejot-dev/thalo-cli
yarn add -D @rejot-dev/thalo-cli
# Global (optional)
npm install -g @rejot-dev/thalo-cli
Prettier integration
This repo uses the Thalo Prettier plugin. The config is in prettier.config.mjs and includes:
plugins: ["@rejot-dev/thalo-prettier"];
Use thalo format for CLI formatting, or run Prettier normally and it will format Thalo/Markdown
with the plugin enabled.
CLI reference (condensed)
thalo init [directory] (options: --dry-run, --force) creates entities.thalo, AGENTS.md,
personal-bio.md.
thalo check [paths...] validates syntax, metadata, sections, links, enums. Options include
--format, --severity, --max-warnings, --rule, --watch, --file-type.
thalo format [paths...] formats .thalo and .md (options: --check, --write,
--file-type).
thalo actualize [links...] outputs pending synthesis updates and prompts. Supports -i for
custom instructions templates. Tracks changes via git or timestamps.
thalo query "<query>" [paths...] filters by entity, tags, links, metadata. Options: --format,
--limit.
thalo rules list shows validation rules (filter by --severity, --category, --json).
thalo lsp starts the language server (stdio).
- Global:
--help, --version.
References
- Use
references/entities.thalo.txt for the default entity definitions from thalo init.
- Use
references/example-entries.thalo.txt for sample entries.
- Use
references/scripting-api.md for the scripting API summary.
- Use
date -u +"%Y-%m-%dT%H:%MZ" to generate timestamps quickly.
1---2name: thalo3description: Use when working with Thalo (Thought And Lore Language): creating or editing .thalo files or thalo code blocks in Markdown, setting up a knowledge base with thalo-cli (init, check, actualize), defining entities/syntheses, or generating an AGENTS.md guide for collaborators.4---56# Thalo78## Quick start workflow910- Initialize a knowledge base with `thalo init` to generate `entities.thalo`, `AGENTS.md`, and11 `personal-bio.md`.12- Add or edit entries in `*.thalo` files or fenced code blocks inside Markdown (lang: `thalo`).13- Validate after changes with `thalo check` to catch schema, link, and syntax issues.14- Format with `thalo format` when preparing a commit or cleanup (or use Prettier with the plugin)15- Run `thalo actualize` to materialize syntheses (queries + prompt) for LLM use.1617## Entry syntax1819Follow this structure:2021```text22{timestamp} {directive} {entity} "Title" [^link-id] [#tags...]23 {key}: {value}24 ...2526 # Section27 {content}28```2930Guidelines:3132- Use ISO 8601 local time with timezone, e.g. `2026-01-05T15:30Z`.33- Use `create` for new entries and `update` for modifications.34- Provide a stable `^link-id` when you want to reference the entry elsewhere.35- Put all content inside sections; required sections are defined in `entities.thalo`.36- Entities are typically `journal`, `opinion`, `reference`, or `lore` (see `entities.thalo`).3738## Metadata3940Metadata fields are indented key-value pairs. Values can be:4142- Strings: `author: "Jane Doe"` or unquoted `author: Jane Doe`43- Links: `subject: ^self` or `related: ^my-other-entry`44- Dates: `published: 2023-03-16`45- Date ranges: `date: 2020 ~ 2021`4647## Sections4849Content sections start with `# SectionName` (indented). **All content must be within a section.**50Each entity type defines which sections are required/optional in `entities.thalo`.5152## Defining entities5354Define or update entities in `entities.thalo` using `define-entity` blocks. Each entity specifies:5556- **Metadata** fields with types (`string`, `link`, `datetime`, `date-range`, enums, arrays,57 unions).58- **Sections** that determine required/optional content.5960After editing or adding entries or entities, generally run `thalo check` to validate.6162If you need the default entity templates, load `references/entities.thalo.txt`.6364## Syntheses6566Syntheses are queries plus prompts that let you generate structured summaries or narratives.6768- Create with `define-synthesis` blocks.69- Use `sources:` to select entries by entity, tag, or metadata filters.70- Run `thalo actualize` to output the sources and prompt for downstream LLM use.7172## Working in Markdown7374Thalo can live inside Markdown files. The fenced code block language SHOULD be `thalo` (don't use it75in this file as an example because it would be parsed):7677````text78```text79...entries...80```81````8283The CLI and LSP will parse fenced `thalo` blocks in `.md` files.8485## Installation8687If `thalo` is not available, install via the user's package manager (local or global):8889```bash90# Local (recommended for repo tooling)91npm install --save-dev @rejot-dev/thalo-cli9293# Or with your preferred PM:94pnpm add -D @rejot-dev/thalo-cli95yarn add -D @rejot-dev/thalo-cli9697# Global (optional)98npm install -g @rejot-dev/thalo-cli99```100101## Prettier integration102103This repo uses the Thalo Prettier plugin. The config is in `prettier.config.mjs` and includes:104105```js106plugins: ["@rejot-dev/thalo-prettier"];107```108109Use `thalo format` for CLI formatting, or run Prettier normally and it will format Thalo/Markdown110with the plugin enabled.111112## CLI reference (condensed)113114- `thalo init [directory]` (options: `--dry-run`, `--force`) creates `entities.thalo`, `AGENTS.md`,115 `personal-bio.md`.116- `thalo check [paths...]` validates syntax, metadata, sections, links, enums. Options include117 `--format`, `--severity`, `--max-warnings`, `--rule`, `--watch`, `--file-type`.118- `thalo format [paths...]` formats `.thalo` and `.md` (options: `--check`, `--write`,119 `--file-type`).120- `thalo actualize [links...]` outputs pending synthesis updates and prompts. Supports `-i` for121 custom instructions templates. Tracks changes via git or timestamps.122- `thalo query "<query>" [paths...]` filters by entity, tags, links, metadata. Options: `--format`,123 `--limit`.124- `thalo rules list` shows validation rules (filter by `--severity`, `--category`, `--json`).125- `thalo lsp` starts the language server (stdio).126- Global: `--help`, `--version`.127128## References129130- Use `references/entities.thalo.txt` for the default entity definitions from `thalo init`.131- Use `references/example-entries.thalo.txt` for sample entries.132- Use `references/scripting-api.md` for the scripting API summary.133- Use `date -u +"%Y-%m-%dT%H:%MZ"` to generate timestamps quickly.