oo megabrain
Shared sources and packets of earlier work.
Megabrain is the Sunport's shared, versioned knowledge for people and agents. A source keeps exact originals as numbered versions: a note, a file, a captured web page, a file at a commit, an excerpt of a thread or a run's output. A packet records what a piece of work found and decided: each claim names the source versions it rests on, and may quote the exact passage, so someone else can check the work and carry on from it. A published packet never changes; a correction publishes a new one that supersedes it. Every read says whether a claim is stale: a source it rests on was withdrawn or deleted, or has a newer version that doesn't still hold the claim's quote. Reread the current source before relying on a stale claim.
An item's audience says who may read it: owner (its owner, and the owner's agents while they act for them; the default), team (people who share a team with the owner now) or sunport (everyone who may read Megabrain; connected agents that read Megabrain read it too, and their vendors get what they read). Wherever an ID is asked for, the item's reference works too: megabrain:packet/ID, or megabrain:source/ID with @N for version N. A new Sunport starts with Megabrain on; on an older one it is off until a Sunport administrator turns it on (oo sunport megabrain on), and while it's off, every command but status answers megabrain_off.
oo megabrain status
Print whether Megabrain is on (enabled), whether its content is encrypted with the Sunport's content key (protected), when it was last turned on or off (changedAt), where it makes meaning (meaning: local, on the Sunport, or hosted, by Gemini through its model proxy) and, while it's on, how many items wait to be read or indexed, why indexing is stuck when it is, and the languages of the passages search may show you, each with how many, and the last 7 days' searches and agents' turns recall added to (index: pending, error, languages and week). It also says whether the Sunport keeps chat files (keepChatFiles: a file a person sends in the web chat, and a file an agent shows them there, kept for them automatically) and, for a person, whether theirs are (keepMyChatFiles). Any signed-in caller reads it; the index takes megabrain.read. An administrator turns it on or off with oo sunport megabrain.
oo megabrain statusIt also takes the connection options.
oo megabrain chat-files
Turn on or off keeping your own chat files in Megabrain: a file you send in the web chat, and a file an agent shows you there, kept for you alone as a source, found by search, instead of expiring after a day. They are kept while the Sunport keeps chat files (an administrator's choice, oo sunport megabrain chat-files) and yours is on, as it is until you turn it off. Only a person has a choice; it needs no permission. What was kept stays: delete it with oo megabrain source delete. Prints the status, as oo megabrain status does.
oo megabrain chat-files state| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
state | yes | on, off | on keeps your chat files, off stops keeping them |
It also takes the connection options.
oo megabrain propose
As an agent in a person's own web chat turn, propose one short note others here will need later: a decision, a fact about the company, its customers or its systems, or how to do a recurring task. The chat shows the person a card with it: they edit it, choose who can find it (themselves, their team or everyone on the Sunport) and save it to Megabrain as their own note, or dismiss it; nothing is saved until they do, and no key or agent can save it for them. Use it instead of writing shared facts into your own memory files: one fact per note, in plain words that stand alone, without secrets or people's private details. It takes megabrain.read, a read-only turn's too: it writes nothing. Anywhere else, such as a chat app, a schedule or a task another agent passed on, no card is shown and card is none, with why; a note the person already saved answers card saved, with its ref, to cite. A person keeps a note themselves with oo megabrain source add --text.
oo megabrain propose [options] text| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
text | yes | the note, at most 2000 characters | ||
--audience AUDIENCE | no | team, sunport | whom you suggest it is for: team (the person's team, the default) or sunport (everyone: connected agents that read Megabrain read it too, and their vendors get what they read); the person chooses |
It also takes the connection options.
oo megabrain search
Search the packets and sources you may read, best match first, and print the hits as JSON. A hit is an item with the passage that matched best: its kind, ID, reference and title; the passage's number (passage), where it is (locator, such as a page, a slide or a heading), an excerpt of it and the passage whole (text); how many passages the item has (passageCount); the passage's language (language, an ISO 639-1 code, null when too short to tell); how it was found (match: words, meaning or both); its audience, owner (kind and name), whether it is stale and when it changed. Of items made alike, as from one template, a search shows three and folds the rest under the first, whose alike says how many (count) and names the first ten (refs): when the one you want may be among them, read them or search again with a word that tells it apart. Search looks two ways at once. By words: passages holding every word of the query, whole, with case and accents folded, or a word few passages hold, rarer words counting for more; the title's words count with the first passage. By meaning: a model on the Sunport finds passages that say the same thing in other words or another language, each passage carrying its title. While some items' meaning is still being indexed (indexing), oo says so: the same search may find more soon. Read a hit's text first. When it doesn't answer and the source has many passages, search within it with --source: the same query over that source's newest version's passages, one hit per passage. Read a source from its hit's passage on with oo megabrain source show SOURCE_ID --passage N. A first page's languages are those of the passages it looked through, most first: when a search in your language doesn't answer and languages lists others, search again in them, with the words a document in that language would use. When nextCursor is not null, pass it to --cursor for the next page; one search ranks at most its best 100 matches by words and 100 by meaning, and its cursor ends there.
oo megabrain search [options] query| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
query | yes | what to look for, in words or a question, at most 500 characters | ||
--kind KIND | no | all, packet, source | only packets or only sources (default all) | |
--source SOURCE_ID | no | search within one source, by its ID or megabrain:source/ reference: when a hit's text doesn't answer and the source has many passages (passageCount); a source you may not read is megabrain_not_found | ||
--limit N | no | how many, 1 to 100 (default 20) | ||
--cursor CURSOR | no | where the next page starts: nextCursor from the last one |
It also takes the connection options.
oo megabrain source
A source keeps exact originals as numbered versions. Adding one keeps version 1, and update keeps the next; earlier versions stay as they were, and the claims that cite them become stale unless the new version still holds their quote. Each version's text is read once, on the Sunport. Typed text, and a UTF-8 file unless its type or name says PDF or HTML, is its own text at once; a PDF, a Word, PowerPoint or Excel file, an OpenDocument file or an HTML page is read in the background within moments, with where each page, slide, sheet or heading starts. Withdrawing keeps the source and marks it, with your reason; deleting removes every version's content and text, and the quotes of it. source show says whether you may add a version (canAddVersion) and withdraw or delete it (canChange).
oo megabrain source [COMMAND]It also takes the connection options.
oo megabrain source add
Keep a new source as its version 1, and print it with its reference. --text keeps the text given and --stdin what standard input holds, both as a note; --file keeps a file's exact bytes, with its media type and name, as a file, and so does --attachment with a chat attachment you uploaded with this credential, which otherwise expires a day after its upload. --reply-file keeps a file an agent showed in a reply of a conversation you may read (oo chat get lists them), and --code-file a file in a Code session's workspace you may download (oo code workspace ls): the Sunport reads either as you would and records where it came from itself, so neither takes an origin option. Where other content came from makes it that kind of source instead: --page a captured web page (url), --repo with --path and --commit a file at a commit (repo_file), and --thread an excerpt of a conversation you may read (thread), with --message one of its messages; the Sunport refuses a conversation or message it can't find for you. What a run keeps records the run itself, from the run's own credential. A version holds just under 6 MiB; a workspace file its folder lists as larger is refused before it is sent. --file takes several files: each is kept as a source of its own, titled by its name, with the same audience, note and origin, in order; a file refused is printed with its error on standard error, the rest are still kept, and oo exits 1. --title takes one file only. --drive-file with one --file keeps a copy of that Google Drive file in step: keeping it again for the same audience adds a version to your source kept from it when its bytes changed, and nothing when they didn't; source list --from drive:FILE_ID finds it. A file kept with --repo and --path is kept in step the same way, by its repository and path, whatever the commit; source list --from repo:REPOSITORY:PATH finds it (a repository with a colon in it isn't kept in step). --supersedes names the older source this one replaces, one you may add a version to: both stay as kept, and search shows this one in that one's place and marks that one superseded by it.
oo megabrain source add [options]| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
--title TITLE | no | what it is, at most 200 characters; a file kept without it is titled by its name | ||
--text TEXT | no | the text itself | ||
--stdin | no | the text standard input holds | ||
--file PATH | no | a file, or several, each kept as its exact bytes | ||
--attachment ATTACHMENT_ID | no | a chat attachment you uploaded in the last day, kept as its exact bytes | ||
--reply-file THREAD_ID FILE_ID | no | a file an agent showed in a reply of a conversation you may read; the Sunport records the conversation, and the message when one names the file | ||
--code-file SESSION_ID PATH | no | a file in a Code session's workspace, by its path from the workspace root; the Sunport records the session and path it came from | ||
--kind KIND | no | note, file, url, repo_file, thread, run_output | what it is, when its content and origin say otherwise | |
--audience AUDIENCE | no | owner, team, sunport | who may read it: owner (the default), team or sunport (everyone: connected agents that read Megabrain read it too, and their vendors get what they read) | |
--note NOTE | no | why it matters or what to look at; searched with it | ||
--drive-file FILE_ID | no | with one --file: the Google Drive file it is a copy of, which keeps your copy in step | ||
--supersedes SOURCE | no | the older source this one replaces, by its ID or megabrain:source/ reference | ||
--page URL | no | the http(s) address of the web page it was captured from | ||
--repo REPOSITORY | no | the repository of a file at a commit, with --path and --commit | ||
--thread THREAD_ID | no | the conversation it is an excerpt of, one you may read | ||
--path PATH | no | with --repo: the file's path in the repository | ||
--commit COMMIT | no | with --repo: the commit's hash | ||
--message MESSAGE_ID | no | with --thread: the message of that conversation it is from |
It also takes the connection options.
oo megabrain source list
The sources you may read
oo megabrain source list [options]| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
--mine | no | only the sources you own | ||
--from PLACE | no | only those kept from a chat file: upload:ATTACHMENT_ID, or replyFile:THREAD_ID:FILE_ID for a file an agent showed; from a Google Drive file kept with --drive-file: drive:FILE_ID; or from a file kept with --repo and --path: repo:REPOSITORY:PATH | ||
--limit N | no | how many, 1 to 100 (default 20) | ||
--cursor CURSOR | no | where the next page starts: nextCursor from the last one |
It also takes the connection options.
oo megabrain source show
Print a source with its versions as JSON: each version's number, ID (a claim's sourceVersionId), size, SHA-256, media type, name, note, who captured it when, the run that kept it (producedBy: its run, the person it acted for and the agents it passed through; null for a person's own keep), the sign-in the person acted through (via: a works-as-you sign-in's agent tool, such as Claude Code; null otherwise), where a version kept from a conversation's or a Code session's file came from (origin; null otherwise), and what text it holds (text): utf8 (its own UTF-8 text), extracted (text read from a document), none (nothing to read, as in an image, an archive or a scanned PDF), unreadable (a document the reader gave up on) or null (not read yet: a document waits a moment for the reader). The source's origin says where it came from: a web page, a file at a commit, a conversation and message, a run, or a Code session and path. It lists the newest 100 packets citing it that you may read (citedBy) and how many there are (citedByTotal).
--content prints the newest version's text, and --version N, or a reference ending in @N, that version's. A long text is read passage by passage: one read returns as many passages as fit in 32,000 characters (passages: first, last and total), from passage 1 or from --passage N, and oo says how to read on. A version with no text to read prints null; --output writes its exact bytes to a file.
oo megabrain source show [options] SOURCE_ID| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
SOURCE_ID | yes | the source's ID, or its megabrain:source/ reference | ||
--version N | no | one version, by its number | ||
--content | no | the newest version's text, unless --version names another | ||
--passage N | no | the version's text from passage N on | ||
--output PATH | no | write the version's exact bytes to this file | ||
--overwrite | no | with --output, replace an existing file |
It also takes the connection options.
oo megabrain source update
Keep new content as a source's next version
oo megabrain source update [options] SOURCE_ID| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
SOURCE_ID | yes | the source's ID, or its megabrain:source/ reference | ||
--text TEXT | no | the text itself | ||
--stdin | no | the text standard input holds | ||
--file PATH | no | a file, kept as its exact bytes | ||
--attachment ATTACHMENT_ID | no | a chat attachment you uploaded in the last day, kept as its exact bytes | ||
--reply-file THREAD_ID FILE_ID | no | a file an agent showed in a reply of a conversation you may read; the Sunport records the conversation, and the message when one names the file | ||
--code-file SESSION_ID PATH | no | a file in a Code session's workspace, by its path from the workspace root; the Sunport records the session and path it came from | ||
--note NOTE | no | what changed, or what to look at | ||
--supersedes SOURCE | no | the older source this source now replaces, by its ID or megabrain:source/ reference |
It also takes the connection options.
oo megabrain source withdraw
Withdraw a source: it stays, and claims that cite it become stale
oo megabrain source withdraw [options] SOURCE_ID| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
SOURCE_ID | yes | the source's ID, or its megabrain:source/ reference | ||
--reason REASON | yes | why, in a sentence; its readers see it |
It also takes the connection options.
oo megabrain source delete
Delete a source with the content of every version
oo megabrain source delete [options] SOURCE_ID| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
SOURCE_ID | yes | the source's ID, or its megabrain:source/ reference | ||
--yes | no | confirm it now; an agent passes it only once the person confirmed it in chat |
It also takes the connection options.
oo megabrain packet
A packet records what a piece of work found and decided, for whoever continues it: its title, objective and claims, each a finding, decision, next step or open question resting on exact source versions and quoting the passages it rests on, and the run that published it. A published packet never changes: publish a correction with supersedes, and the packet it names becomes superseded. Withdrawing keeps a packet and marks it, with your reason. packet show gives each basis's quote, if you may read its source, and whether the source's newest version still holds it (quoteHolds).
oo megabrain packet [COMMAND]It also takes the connection options.
oo megabrain packet publish
Publish a packet from a JSON file or standard input, and print it with its reference. It holds title, objective, audience (owner unless given), claims and, if needed, sources and supersedes. Each claim has a kind (finding, decision, next_step or open_question), its text and its basis: the source versions it rests on, each {"sourceVersionId": ID} from source show, or {"source": KEY} for one of the packet's own sources, which are kept with it in the same step and take a key besides the fields of a new source. Either kind of basis may add a locator, such as a page or a line range, and a quote: the exact passage the claim rests on, at most 1,000 characters, which must be in that version's text (spacing may differ), or the packet is refused (megabrain_basis_invalid). So is a quote of a version still being read. A document sent along in sources is read only after the packet is kept, so only text, typed or a UTF-8 file, can be quoted there: cite a document without a quote, or keep it first with source add and quote its version once read. A quote keeps the claim current through later versions that still hold it. supersedes names the packet this one corrects. oo skill megabrain shows a whole packet.
oo megabrain packet publish [options]| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
--file PATH | no | the packet's JSON file | ||
--stdin | no | read the packet's JSON from standard input |
It also takes the connection options.
oo megabrain packet show
A packet: its claims, whether each is stale, and the run that published it
oo megabrain packet show PACKET_ID| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
PACKET_ID | yes | the packet's ID, or its megabrain:packet/ reference |
It also takes the connection options.
oo megabrain packet list
The packets you may read
oo megabrain packet list [options]| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
--mine | no | only the packets you own | ||
--status STATUS | no | published, superseded, withdrawn | only published, superseded or withdrawn packets | |
--limit N | no | how many, 1 to 100 (default 20) | ||
--cursor CURSOR | no | where the next page starts: nextCursor from the last one |
It also takes the connection options.
oo megabrain packet withdraw
Withdraw a packet: it stays, marked withdrawn
oo megabrain packet withdraw [options] PACKET_ID| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
PACKET_ID | yes | the packet's ID, or its megabrain:packet/ reference | ||
--reason REASON | yes | why, in a sentence; its readers see it |
It also takes the connection options.
oo megabrain packet delete
Delete a packet and its claims
oo megabrain packet delete [options] PACKET_ID| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
PACKET_ID | yes | the packet's ID, or its megabrain:packet/ reference | ||
--yes | no | confirm it now; an agent passes it only once the person confirmed it in chat |
It also takes the connection options.
oo megabrain owners
Print how many packets and sources each owner has and how many bytes they hold, without reading them. delete deletes everything one person or agent owns, such as when they leave; packets that cite their sources show those as deleted. Both are an administrator's (megabrain.manage).
oo megabrain owners [COMMAND]It also takes the connection options.
oo megabrain owners delete
Delete everything one owner has
oo megabrain owners delete [options] kind OWNER_ID| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
kind | yes | person, agent | whether the owner is a person or an agent | |
OWNER_ID | yes | the owner's ID, as oo megabrain owners lists it | ||
--yes | no | confirm it now; an agent passes it only once the person confirmed it in chat |
It also takes the connection options.
oo megabrain delete-all
Delete every packet and source on this Sunport, for everyone, with every version's content. Megabrain stays on or off as it is. It is an administrator's.
oo megabrain delete-all [options]| Argument | Required | Default | Choices | Description |
|---|---|---|---|---|
--confirm CONFIRM | yes | delete-all | delete-all, to confirm; an agent passes it only once the person confirmed it in chat |
It also takes the connection options.