Hive Intelligence

Documentation

/ Concepts

Architecture

0.9.0 docs, commit 05e2eb4PyPI packages at 0.9.0docs/concepts/architecture.mdpublic repository on GitHub

Local ingest tools and deterministic parsers produce exact source records and placement proposals. The Hive App connector reviews and publishes cards. One service serves both cards and records. Two stores keep knowledge and work state apart.

This is the shape of the system in one page. For the long form, with every gate and the layers on top, read the pipeline end to end.

On the active route, hive-ingest turns raw files into checked, secret-masked records and proposes where elements belong; an assistant files drafts and corrections through the Hive App connector, reviewers approve them before publication into git, and hive-serve reads the corpus to an agent. The older scripted pipeline (hive-prep feeding hive-gen's deprecated model stages) remains documented below for existing consumers:

Active ingest, review, and serving architecture
Rendered at build time from the document's own Mermaid source, in the repository's house style.

Assistant ingest and records (hive-ingest)

hive-ingest runs beside the source files over local MCP (or CLI). Rather than paraphrasing a folder directly into concept cards, it separates accounting and extraction from card authoring:

  • Folder scan, handler registry and file ledger. Every file in the folder gets one ledger entry with content-based format detection, version-family grouping, and optional routing pins. A ledger gate refuses the run if the folder and ledger disagree.
  • Credential checks and secret masking. Credential files - and archives or Office packages containing one - are excluded before any handler sees them. Secrets inside text and tables are masked as [masked] before records or model excerpts are written, with every removal logged.
  • Escalation ladder. Open routing, diagram, bloat, sheet-structure and placement decisions climb from deterministic code to Jev (key-gated System One), then to the assistant session, and finally to a person queue (disagreements, failed checks, card overrides, unhandled files).
  • Structured records. Docling builds document records (keeping DOCX tracked changes as CriticMarkup, recovering pictures Docling drops, and removing bloat with a restorable removal list); native readers build spreadsheet mapping and table records; diagram extraction reads Visio/PowerPoint shapes, metafiles and transcribed pictures; hive-apispec turns API specifications into dbobject cards.
  • Gap map and placement. gaps shows what a corpus lacks or holds weakly, and place proposes which card (or new concept) each record element belongs in. hive-ingest writes no concept card; its only corpus write is the API dbobject cards that apispec puts in its --out folder. Assistants draft concept cards and file them through the Hive App connector.

See hive-ingest.

Scripted preparation and legacy card creation

Stage 1: scripted preparation (hive-prep)

hive-prep is not deprecated; it stays as the tool library and for scripted runs without an assistant session, and for legacy Office files (.doc, .xls, .ppt) via LibreOffice until hive-ingest reads them. See what still uses hive-prep.

It takes a directory of raw documents and produces atomic markdown: one clean, single-topic file per source, with metadata frontmatter. The governing idea is put the intelligence up front in one reviewable file, then let deterministic code do the rest. Commands run in sequence: scan, dups, validate-plan, dedup-formats, normalize, route, transform, stamp, validate-atomic. See hive-prep.

Stage 2: card creation (hive-gen)

Model stages deprecated. Taxonomy, assignment and distillation below are deprecated and planned for removal in a later release; they remain for existing consumers. New ingest uses hive-ingest and publishes through the Hive App connector. The card model, promote(), post-promote passes (facets, conformance, index) and hivegen-citation-lint are not deprecated. See what is deprecated and what stays.

hive-gen historically turned atomic markdown into cards in two deprecated model passes with a human gate after each:

  • *Taxonomy (deprecated).* Given the documents for one functional area, the model proposes a list of concepts to taxonomy.<area>.draft.yaml and stops for a person to edit into taxonomy.<area>.yaml.
  • *Assignment and distillation (deprecated).* The model assigns documents to approved concepts and writes draft cards into drafts/ with status: draft for human review.
  • *Promotion and post-promote (active).* promote() moves approved drafts into concepts/<product>/. Post-promote commands (hivegen-conformance-pass, hivegen-index-generate, hivegen-citation-lint, and optional hivegen-facet-pass) normalise cards, verify record citations and regenerate the index.

Serving (hive-serve)

hive-serve is one core with two doors and two stores.

The read path, module by module. Both doors call the same transport-agnostic wrappers; only the MCP door reaches the database-object tier, the record store and the ledger:

The read path, module by module
Rendered at build time from the document's own Mermaid source, in the repository's house style.

One core

Both doors share retrieval wrappers and the resolver, but expose different client-context surfaces. See the resolver reference for scope and the serving trust boundary for access.

Two doors

REST, for anything that speaks HTTP:

Route Purpose
GET /healthz liveness. See the warning below
GET /metrics Prometheus exposition
GET /concepts the lean index (optional ?product= filter)
GET /find_concepts search metadata and cached body words; return lean metadata hits
GET /card/{card_id} one card as JSON {"id", "markdown"}
POST /resolve several cards plus their corrections, as one bundle

MCP, for any client that speaks it, exposing seventeen tools in three groups: retrieval (list_concepts, find_concepts, get_card, resolve, find_db_objects, find_records, get_record), work state (start_objective, list_objectives, get_objective, append_entry, set_status, record_quiz_result), and personal memory (remember, recall, forget, promote). Seven of them write the caller's ledger rows, and each declares to clients whether it is read-only, an additive write or a destructive one. That is the default full tool profile; the retrieval profile exposes the retrieval group alone and opens no ledger, for a connector that must not write. See tool profiles.

/healthz does not check the corpus. It reports that the process is up. A service with a stale or empty mount answers {"ok":true} while serving nothing. Alert on the card-count gauge instead; see metrics.

Two stores

Knowledge Work state
What cards and records objectives, entries, personal memory
Where markdown, YAML and JSONL in git Postgres
Lifecycle reviewed, versioned, shared (or client-scoped) mutable, per-person, private
Written by curation through review, and deterministic/checked ingest the agent, during use

They are never mixed. Knowledge is the thing many people rely on being true, so it goes through review and lives in version control. Work state is one person's in-progress thinking, so it is mutable and needs no ceremony.

Keeping them apart is what lets the corpus be trustworthy without making it annoying to use. It is also why promoting a personal memory into shared knowledge is an explicit act that ends in a draft for review, rather than a database write.

No model at serving time

By default hive-serve makes no model calls.

Consequences worth naming, all true of the default keyless mode:

  • Cheap. Serving is file reads and, for work state, one database query.
  • Deterministic. The same request returns the same cards, every time.
  • Auditable. What the agent saw is exactly what is in git at that commit.
  • Portable. No gateway, no keys, no vendor.

The reasoning is the agent's job. Hive's job is deciding what the agent is allowed to reason over, and that decision was made by a person, earlier, on the record.

An optional, key-gated semantic layer can additionally consult a System One typed-judgment model to rank retrieval candidates as a corpus grows (Hive supports the TypeSafe System One API and is validated with TypeSafe's Jev; the model id is passed through opaquely). It is off unless a key is configured, keeps recall in deterministic code, never egresses client-sensitive text, and fails open to the path above - so the keyless, portable mode described here is always available, and a model without a declared calibration posture never influences decisions. When it is on, the consequences above change accordingly (it is no longer keyless or vendor-free). See the semantic layer.

If you want semantic search as well, the corpus is plain markdown: embed the cards into your own index and run both paths against the same content. See alongside an existing RAG system.

The write path

hive-serve holds no credential that can change the corpus, which is deliberate: the read path is the part exposed to the widest audience, so nothing taken from it can rewrite what everyone reads. It is not empty-handed. Under the default full tool profile it holds LEDGER_DSN, and with it every person's work ledger and private memory; a connector that needs neither runs the retrieval profile, which opens no ledger at all.

When someone wants to correct a card or promote a memory, their assistant files a draft through the Hive App connector, a separate service. Reviewers approve or decline it, and only an approved card is published to the corpus.

Deprecated. hive-author (vf-hive-author), which files corrections and memory as issues on the corpus repository, is deprecated and planned for removal in a later release. The Hive App connector is the only supported write route. See the deprecation notice.

The chain of custody:

The chain of custody
Rendered at build time from the document's own Mermaid source, in the repository's house style.

Extensions

hive-dbparse turns schema DDL into dbobject cards deterministically, with no model. See the verification gate for failure conditions and output handling.

hive-apispec turns API specifications into dbobject cards deterministically, with no model. See its gate.

hive-zendesk (deprecated) distils closed support tickets into client-scoped issue cards. See the deprecation and replacement workflow.