Skip to content

Analysis

Each time xixo reads a feed, it writes one analysis. The analysis holds the cause, the status, each step’s result, every turn a model took, and a log. A feed’s current analysis is its last one that finished as done or failed. A new analysis starts with a copy of the current one’s steps, so xixo does not repeat work whose result is still valid.

Cause Raised by
upload an upload, a note, or a fetched URL, as described in adding things
sync a sync, a snapshot, an extracted child, or a parent whose children have all finished
keep the resource tool’s keep, for one object that was not yet analyzed
schedule an address’s schedule coming due
manual runFeed, analyzeFeed, or the feed tool’s analyze
ask askCatalog, as described in asking
Status Means
queued, running The analysis is open.
parked It waits for a machine that can read the file, as described in extraction. The item page shows waiting.
done, failed It finished. A finished analysis is indexed again for search.
cancelled Someone pressed Stop, called cancelAnalysis, or it passed its deadline.
gated A gate stopped it.

A queued analysis has no deadline, so a file waits in line however long the line is. Once it starts, it runs for its feed’s timeout, as described in after the analyzer.

A step is a named piece of work whose result the analysis keeps. A step that raised an error keeps the error and no result, so the next analysis runs it again. A saved result is reused, and logged as cached, unless the step was forced, its bytes changed after it ran, or the prompt or the inference resource it used changed after it ran.

A feed’s text is what its source says, and nothing a model wrote about it. It joins the text, ocr, transcript, conversation, and place steps. Search indexes it as the body, and the feed tool reads and searches it.

What a model saw in a picture or a video is kept apart, in the caption and scenes steps. Search finds a feed by them along with its summary, and an answer reads them as what a model described.

The item page shows the steps under Details, grouped by the step that produced them. When a resource or an analyzer reads only part of something, such as the first 50 comments of a GitHub issue or the first 200,000 characters of a text, the dropped step records what was left out, and Details shows it under Left out.

The server never opens a file’s bytes. xixo link reads them and answers with the steps that describe the file. A parser that a hostile file breaks runs inside xixo link’s sandbox, away from the catalog, its database, and its keys. Every install runs one xixo link beside the server, and each linked machine runs another.

xixo picks an analyzer by the feed’s mime type, and the analyzer asks for the matching extractor. Which machine reads the file depends on where it lives:

  • A file in a folder a machine shares is read on that machine, where it lies, when the machine has the extractor. xixo link makes no copy, so a file of any size is read. Only what xixo link extracted and the file’s SHA-256 reach xixo.
  • When the machine lacks the extractor and lends its files, the file goes to the pool. A machine lends unless its own configuration sets lend to false. When it does not lend, or the file is larger than 4 GB, the file waits until that machine has the extractor.
  • An upload, a mail attachment, a file in a cloud resource, and anything else with no machine of its own goes to the pool.

The pool is every connected machine whose plan has Extract text from documents, and from files other machines lend it on, and that has read xixo’s small test file. On each hello that brings new readers or a new version of xixo link, xixo sends the machine a short text file and asks it to extract it. Until the text comes back, the machine reads nothing, its own files included, and the plan’s Extract line says xixo is checking. A machine that fails the check is asked again ten minutes later, twice, and on its next hello, and the line says what it answered. xixo link beside the server comes first, since the bytes are already on the server. Otherwise the machine with the fewest questions open is asked, and it fetches the bytes once over HTTPS.

When no machine can read the file now, the analysis is parked. The machine’s card on the Resources page counts the files waiting for it. When a machine says hello, xixo queues the parked analyses it can now serve, and it checks again every ten minutes. Analyzing a file again cancels its parked analysis. See files a machine cannot read.

The extraction README lists each extractor, the types it reads, and the steps it returns. A few results are worth knowing:

  • A PDF with less than 40 characters of text a page is read as a scan, by OCR on its first 30 pages.
  • An email’s quoted history goes under a section named Earlier in the thread, so the summary is written from the message itself. Each attachment becomes a child feed. Messages that share a Message-ID, In-Reply-To, or References header are one thread, which the item page lists.
  • A workbook, a CSV file, and a TSV file keep their rows as tables, up to 5,000 rows a sheet, so an answer can work out totals and counts over them.
  • A calendar, a vCard file, a workbook, and a document with headings are cut into sections, so a passage and an answer can hold one event, contact, sheet, or section.
  • Images, video, audio, PDFs, and page captures get a thumbnail and a hi-res image, sized by the settings. Audio is drawn as its waveform.

Every analyzer runs the same sequence:

  1. Extract on a machine, as described above.
  2. Catalog children, such as an email’s attachments, when the feed is less than four levels deep. The analyzer stops until every child has been analyzed, and then xixo analyzes the parent again.
  3. Analyze what needs a model or another resource:
    • An image is described by the model that serves the vision role. It gets the hi-res image with its metadata removed, and the text OCR read off it to help. A GIF, WebP, or APNG sends several frames, as the settings say. With no model that reads images, the image gets no summary, and its item page says which model to set.
    • A photo with a GPS position is named by a Places resource that has Name where photos were taken on.
    • Audio and video are transcribed when a resource serves the transcription role. Each line opens with its moment in the recording, such as [00:03:12]. A recording up to an hour long is heard whole. A longer one is heard as six ten-minute parts spread across it, so the transcript of a 2.5-hour film covers its beginning, middle, and end. Each part is its own request to the transcription resource.
    • Video frames are captioned when a resource serves the vision role.
  4. Summarize with the inference resource that serves the analyzer’s role: vision for images and pages, fast for email and the fallback, and smart for the rest. The summary reads the first 10,000 characters of the text. The prompt fences the text and tells the model to treat it as data. The model returns a summary and up to 8 tags, and the feed is filed under the tags. The call is sent with the model backend’s Effort on routine work. With no resource for the role, there is no summary and no tags.

When extract, analyze, or summarize fails, xixo skips that part and continues. A failed summary ends the analysis as failed, with the reason on the item page until a later analysis writes one. A change to an inference resource analyzes again every file with no summary.

After the analyzer, xixo:

  • Files the feed under the xixo:mime feed for its content type.
  • Considers an address or a staged file with the agent. For an address, the agent runs the schedule’s prompt. For a staged file, it connects the feed to the tags and feeds it belongs with, and may choose where to place it. A file synced from a resource is filed by its summary’s tags alone.
  • Settles a staged file that the agent did not place into the default storage.

An ask analysis skips all of this, and answers the question instead.

An analysis runs for its feed’s timeout, ten minutes by default. setFeedTimeout, or the feed form, sets any value from one minute to one day. An ask with no timeout set starts with the Time per ask of the model backend that serves the agent role, or two minutes. An agent that needs longer asks for more, up to one day from the start.

Analysis jobs run at most ANALYSIS_PER_TENANT at a time in each tenant, 2 by default. A failed call to a resource is retried four more times, with longer waits, before the analysis fails.

Loading a model is slow, and two models that do not fit in memory together unload each other on every call. So xixo orders bulk work by the model it needs:

  • An analysis caused by a sync reads its file in a job whose priority comes from the model that summarizes it. Roles that one model serves share a priority.
  • One that still needs the agent, such as a file that is not yet placed, hands its filing to a second job at the priority of the agent model, which always comes last.

A large sync therefore summarizes everything with one model, then the next, and files with the agent’s model last. Every other cause runs at the highest priority, ahead of bulk work, because someone is waiting for it.