Skip to content

Implement second brain enhancements including Google OKF spec - #12

Merged
gruberchris merged 9 commits into
mainfrom
feature/second-brain-enhancements
Jun 20, 2026
Merged

Implement second brain enhancements including Google OKF spec#12
gruberchris merged 9 commits into
mainfrom
feature/second-brain-enhancements

Conversation

@gruberchris

Copy link
Copy Markdown
Owner

No description provided.

…support

- Article struct, line-based parser, and serializer gain description (one-line
  summary) and source (provenance) fields; values are newline-flattened to
  protect the front matter format
- SaveArticle threads both fields; revert/tag-update/append paths preserve them
- REST create/update accept description/source (pointer semantics: omitted
  preserves, empty string clears)
- MCP create_wiki_article, edit_wiki_article, create_agent_memory,
  create_agent_plan, create_agent_skill accept both args (empty preserves on
  edit); read_article and all list tools surface them
- metadata-only parses capture a ContentPreview first-line fallback for the
  upcoming context overview tool
- Article TS interface gains description/source
- ArticleCard shows a muted two-line description under the title
- Editor adds one-line description and source inputs beneath the title,
  threaded through onSave and the create/update payloads
- article view header renders the description as a subtitle and a Source
  line (linkified for http(s) URLs)
Returns a compact sectioned index of the whole knowledge base (wiki articles,
agent memories, plans, skills) with one line per entry: title, slug,
description (or first-line content preview fallback), tags, and updated date.
Built from a single metadata-only ListArticles pass — no per-article content
reads. Optional 'type' arg filters to one section. Tool description steers
agents to call this first and read_article selectively.
… panel

- new server/links.go with ExtractWikiLinkTargets (extracted from
  get_wiki_statistics, which now reuses it) and Storage.GetBacklinks —
  on-demand O(n) scan including the home article, skipping self-links,
  returning metadata sorted by UpdatedAt desc
- new get_backlinks MCP tool; read_article appends a 'Linked from:' section
  (capped at 15 entries, silently skipped on scan error)
- GET /api/articles/{slug}/backlinks returns a JSON array (404 for unknown
  target, [] when no inbound links)
- BacklinksPanel component renders inbound links as navigable chips under
  the article body; hidden when empty
…ete guard

- edit_agent_memory mirrors edit_agent_plan with full content replacement,
  optimistic locking ('Re-read the memory' conflict hint), pointer semantics
  for title/content/description/source, and force-preservation of the scoped
  aiagent-memory-<type> tag when tags are replaced
- delete_agent_memory validates the memory tag before deleting
- delete_wiki_article now refuses memory-tagged articles, steering agents to
  the dedicated tool (human REST delete unaffected)
- create/append memory schema descriptions teach the hygiene loop; extracted
  shared hasMemoryTag helper
…ivity tool

- new server/activitylog.go: append-only JSON Lines log with one-deep 10 MB
  rotation at open; standalone ReadActivityLog opens fresh per call (readable
  by secondary stdio processes) and skips corrupt lines
- EventBus gains a SetPersist hook fired once per non-deduplicated event —
  a single choke point covering REST handlers, MCP tool calls, and events
  forwarded from secondary processes
- main.go wires persistence with an emit-time IsSecondaryProcess guard:
  secondaries forward to the primary, which persists the forwarded copy
  exactly once
- new get_recent_activity MCP tool: since (Go duration or RFC3339), limit
  (default 50, max 500), action/source filters; falls back to the in-memory
  ring when no durable log exists
- mcp_server.md: tool count 20→25, sections for get_context_overview,
  get_backlinks, edit_agent_memory, delete_agent_memory, get_recent_activity;
  description/source args on create/edit tools; delete_wiki_article memory
  guard; removed the inaccurate 'semantic' wording
- README: feature bullets for progressive disclosure/provenance/backlinks and
  the durable activity log; data dir listings include activity.jsonl
- agent_integration_guide: guidelines skill now starts sessions with
  get_context_overview + get_recent_activity and teaches memory hygiene
Step-by-step manual for the agent-CLI + NexWiki workflow: one-time setup
(deploy, Streamable HTTP connection, CLAUDE.md session-start block), the
four-step session loop (orient, drill in, plan, capture with hygiene), the
inbox + ingest-source capture-and-compile loop, a first-session script, and
tuning tips. Indexed as guide #10 in the Documentation Hub; hub entry for the
MCP guide updated to the 25-tool surface.
- Replaced legacy tag-based content identity (`aiagent-*`) with Open Knowledge Format (OKF) content types (`AI-Agent-Memory`, `AI-Agent-Plan`, `AI-Agent-Skill`, etc.).
- Adjusted MCP tools to utilize these content types for classification and validation (e.g., `edit_agent_memory`, `delete_agent_memory`, and `list_agent_memories` now rely on `type`).
- Added `resource` field support for storing canonical URIs, with pointer semantics for create/edit operations.
- Updated directory hierarchy and type-based indexing for content storage and retrieval.
- Included import/export functionality for OKF-compliant `.zip` bundles into/from the knowledge base.
- Refactored helper functions (`hasMemoryTag` → `memoryScopeTags`) for clarity and alignment with OKF standards.
- Enhanced `read_article` output with explicit content type and `resource` when available.
@gruberchris
gruberchris merged commit 73a45c9 into main Jun 20, 2026
1 check passed
@gruberchris
gruberchris deleted the feature/second-brain-enhancements branch June 20, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant