← 返回文档索引

name: gbrain-structured-writing description: Guidelines for proactively writing structured knowledge to gbrain during sessions. When to create pages, what structure to use, and how to establish entity relationships.


GBrain Structured Writing

GBrain is our structured knowledge layer — complementary to TencentDB Agent Memory (which handles automatic dialogue memory). Write to gbrain manually when you encounter key information.

Division of Labor

System What it stores How
TencentDB Agent Memory Dialogue context, session memory, short-term facts Automatic (L0-L3 pipeline)
GBrain Project pages, person profiles, architecture decisions, entity relationships Manual / cron sync

TencentDB remembers what was said. GBrain understands what things are.

When to Write to GBrain

Any of these triggers during a session:

Page Structure

Project Page

---
title: Project Name
type: concept
tags: [project, active]
source: agent_write
---

## Current Status
One-paragraph summary of where this project stands right now.

## Key Facts
- Status: active / paused / completed
- Started: 2026-05-15
- Stakeholders: [[person-slug]], [[person-slug-2]]

## Architecture
Brief technical description.

Person Page

---
title: Person Name
type: concept
tags: [person, contact]
source: agent_write
---

## Role
What they do and where.

## Relationship to You
How you know them.

## Key Facts
- Organization: [[org-slug]]
- Role: CEO / Engineer / etc.
- First met: 2026-05-01

Timeline Entry

When adding timeline to an existing page:

## Timeline (in body or via mcp_gbrain_add_timeline_entry)
- 2026-05-18: Project kicked off. MVP delivery date set to 05-23.

Links Between Pages

Use mcp_gbrain_add_link(from, to, link_type, context).

Available link types from gbrain schema: - invested_in — investor to company - works_at — person to organization - founded — person to company - advises — person to company - attended — person to event - mentioned_in — page to page - related_to — generic relationship

Important: MCP Remote Mode Limitation

When writing pages via MCP tools (not CLI), gbrain runs in remote context:

Feature CLI (gbrain put) MCP (mcp_gbrain_put_page)
Chunking + indexing ✅ Auto ✅ Auto
Wiki-link extraction ([[slug]]) ✅ Auto ❌ Skipped (remote)
Timeline auto-extraction ✅ Auto ❌ Skipped (remote)
Entity link creation ✅ Auto ❌ Skipped (remote)

Workaround: Always explicitly add links and timeline entries after writing a page via MCP:

# Step 1: Write the page
mcp_gbrain_put_page(slug="project/my-project-a1b2c3", content="...")

# Step 2: Manually add links
mcp_gbrain_add_link(from="project/my-project-a1b2c3", to="person/someone", link_type="related_to")

# Step 3: Manually add timeline
mcp_gbrain_add_timeline_entry(slug="project/my-project-a1b2c3", date="2026-05-18", summary="...")

Without these manual steps, pages written via MCP remain orphans (no links, no timeline).

Cron/Periodic

feishu_wiki_sync.py and feishu_calendar_sync.py already auto-import content. These are the passive import channel. Your manual writes are the curated knowledge channel.

Reference

See references/memory-architecture-page-example.md for a complete worked example of the write → timeline → tags workflow.