Skip to main content

UB Entry CRUD

Benchmarked against: Anthropic — Files API (CRUD operations) Infrastructure: Cloud UB (Cloudflare D1 + Vectorize) Scope: Create, Read, Update, Search operations on Universal Brain entries

The Universal Brain provides a complete set of operations for managing knowledge entries. All operations go through MCP servers — either Cloud UB or Local UBI.


Operations overview

OperationMCP ToolDescription
Createingest_fragmentAdd new entry via MTAAA pipeline
Readget_entryRetrieve single entry by ID
Listget_recentGet most recent entries
Searchsearch_brainHybrid search (semantic + keyword)
Browsesearch_by_categoryList entries by category
Updateupdate_entryModify entry fields
Statsget_statsIngestion statistics

Create — ingest_fragment

Adds new knowledge through the MTAAA 5-node pipeline. See Ingest Fragment API for full details.

result = ingest_fragment(
path="Decision: Use Cloud UB as unified brain for all ships",
input_type="text",
source="manual"
)
# Returns: {"entry_id": "ub-a1b2c3d4e5f6", "category": "knowledge", ...}

Read — get_entry

Retrieve a single entry by its ID.

entry = get_entry(entry_id="ub-a1b2c3d4e5f6")

Response fields

FieldTypeDescription
entry_idstringUnique identifier (e.g., ub-a1b2c3d4e5f6)
titlestringEntry title
contentstringFull content body
categorystringPrimary category
subcategorystringSubcategory
tagsstringComma-separated tags
entitiesstringExtracted entities
sourcestringOrigin (manual, api, etc.)
source_shipstringWhich ship created this (SS1, SS2, SS3)
ss_agent_idstringWhich agent created this
created_atstringISO timestamp
updated_atstringISO timestamp

List — get_recent

Retrieve the most recently ingested entries.

entries = get_recent(limit=10)
ParameterTypeDefaultDescription
limitnumber10Number of entries to return

Search — search_brain

Hybrid search combining FTS5 keyword matching and semantic vector similarity.

results = search_brain(query="dispatch engine selection", limit=10)

How hybrid search works

ParameterTypeDefaultDescription
querystringRequiredSearch query (English recommended)
limitnumber10Maximum results

Search tips

StrategyWhen to useExample
English keywordsMost queries"dispatch engine selection guide"
Entry IDKnown entry"ub-a1b2c3d4e5f6"
Tag searchBrowse by tag"tag:decision captain-approved"
Concept searchSemantic discovery"how agents communicate"

Browse — search_by_category

List entries filtered by category and optional subcategory.

entries = search_by_category(
category="knowledge",
subcategory="ai-agents",
limit=20
)

Available categories

CategoryDescriptionExamples
knowledgeGeneral knowledgeResearch, intel, references
project_docProject documentationSpecs, designs, plans
session_recordSession recordsHandoffs, meeting notes
source_codeCode artifactsScripts, configs, snippets
config_scriptConfigurationSettings, environment configs
tradingTrading domainStrategies, analyses
mediaMedia assetsImages, screenshots metadata

Update — update_entry

Modify specific fields of an existing entry. Only non-empty fields are changed.

result = update_entry(
entry_id="ub-a1b2c3d4e5f6",
title="Updated title",
tags="decision,captain-approved,architecture"
)

Updatable fields

FieldDescription
titleEntry title
contentFull content body
categoryPrimary category
subcategorySubcategory
tagsComma-separated tags
entitiesComma-separated entities
sourceOrigin source

Stats — get_stats

Get aggregate statistics about the Universal Brain.

stats = get_stats()

Response example

StatExample value
total_entries2,500
categories.knowledge800
categories.project_doc500
unique_tags340
unique_entities520
failed_entries12

Cloud UB vs Local UBI

Both MCP servers expose the same CRUD operations, but Cloud UB is the fleet's Single Source of Truth:

FeatureCloud UBLocal UBI
ScopeFleet-wide (all ships)Single ship
StorageCloudflare D1 + VectorizeSQLite + Qdrant
AccessAny agent on any shipLocal agents only
StatusProduction (SSoT)Archive (deprecated for new entries)
EmbeddingGemini embedding-001 (768d)Gemini embedding-001 (768d)

Decision (2026-03-01): Cloud UB is the unified brain. All new entries go to Cloud UB.


Best practices

PracticeWhy
Search before ingestingPrevent duplicate entries
English contentBetter embedding quality, cross-agent consistency
Descriptive titlesImproves keyword search hits
Tag with controlled vocabularyConsistent classification
Include source attributionTrack provenance

PageRelationship
Ingest Fragment APICreating entries
Controlled VocabularyClassification taxonomy
Search ResultsSearch patterns
UB Source TrackingProvenance system