Skip to content

Data model

An Intuition Core node has two PostgreSQL databases. To connect to them, see Query with SQL.

DatabaseNameHolds
Knowledge graphintuition_kgAtoms, triples, accounts, predicates, artifacts, API keys, and an activity log, in the kg schema
Event storeintuition_timescaleChain events and the read models built from them

The two are intentionally separate. You can use the knowledge graph without indexing the chain. When you do index the chain, projections replay its events and write the resulting atoms and triples into the knowledge graph.

Knowledge graph tables

kg.nodes

Atoms. The table is named nodes for historical reasons; each row is one atom.

ColumnMeaning
idThe atom's identifier
raw_typeThe form of the atom data: string, json, http_uri, ipfs_uri, or iid
data, data_hexThe atom data as text and as hexadecimal bytes
data_resolvedContent resolved during processing
statusactive or draft
visibilitypublic or unlisted. The API serves only records that are active and public
created_byThe account that created the atom, when known
is_onchainWhether the atom has been observed onchain
parse_status, classification_status, enrichment_statusThe state of each processing stage: pending, processing, completed, failed, or skipped
parse_result, classification_resultThe output of the parse and classify stages
classification_typeThe atom's normalized type, such as Person, used for filtering. Unknown until classified
iidThe atom's Intuition Identifier, set only when IID processing is enabled
search_textText the API's search matches against

Each stage also has columns for its attempt count, error, lease expiry, and timestamps, such as parse_attempts, parse_error, and parse_lease_expires_at.

kg.triples

Claims between terms.

ColumnMeaning
idThe triple's identifier
subject_id, predicate_id, object_idThe identifiers of the three terms
subject_type, predicate_type, object_typenode if the position holds an atom, triple if it holds a triple
is_counter_triple, sibling_triple_idThe link between a triple and its counter-triple
status, visibility, created_by, is_onchainAs for atoms
edge_kindThe kind of edge. claim by default
source, source_uri, confidence, inferredProvenance. confidence is between 0 and 1
provenance, metadataJSON fields for further provenance and metadata

The table has an index for each of the six orderings of subject, predicate, and object, so you can find every triple that mentions a term in any position.

Other tables

TableHolds
kg.accountsAccounts, keyed by wallet address
kg.predicatesThe predicate registry: slug, label, description, inverse_predicate_id, and the flags is_transitive, is_symmetric, is_hierarchical, is_social, and is_market. A new node is seeded with 14 predicates
kg.artifactsEnrichment output, one row per artifact: node_id, artifact_kind (the artifact type), artifact_version, status, source_uri, data, extracted, and error
kg.node_contextsContext URIs registered onchain for an atom through AtomContextRegistered events. uri_hex holds the exact bytes. uri_text is a readable copy when the bytes are valid UTF-8
kg.node_identifiersAdditional Intuition Identifiers for an atom, written only when IID processing is enabled
kg.eventsAn append-only log of activity in the graph: event_time, actor_id, entity_kind, entity_id, event_type, and a JSON payload. kg.events_hourly rolls it up by hour
kg.api_keysAPI keys: id (such as key_...), key_hash (the SHA-256 hash of the key), name, account_id, can_write, rate_limit_rpm, revoked_at, and last_used_at

The schema also defines kg.adjacency, kg.node_urls, kg.node_stats, kg.account_stats, kg.predicate_stats, and kg.triple_pattern_stats. No Core service writes to these tables yet, so they are empty on a standard node. For traversal, query kg.triples.

Event store tables

event_store

The canonical log of chain events.

ColumnMeaning
sequence_numberThe order in which the event was ingested
block_number, block_timestamp, block_hashThe block
transaction_hash, log_indexThe event's position in the chain
event_type, event_dataThe event's name, such as Deposited, and its decoded fields
term_idThe term the event concerns, when it has one
entity_idThe account the event concerns: the receiver of a deposit or the sender of a redemption
is_canonicalWhether the event is on the canonical chain

Typed event tables

One table for each event type the indexer ingests: atom_created_events, triple_created_events, deposited_events, redeemed_events, share_price_changed_events, protocol_fee_accrued_events, and atom_context_registered_events. In these tables, term_id is a number. The term_id_hex column holds the same identifier in the hexadecimal form that the read models and the knowledge graph use.

Read models

TableHolds
termTerms registered onchain. term_type is atom or triple
term_summary, term_market_cap_history, predicate_object_summary, subject_predicate_summaryMarket totals for each term, and rollups by relationship
vaultOne row per term and curve ID: total shares, total assets, current share price, market cap, and holder count
share_price_historyShare prices over time
position, position_changeEach account's shares by term and curve ID, and every change to them
active_vault_positionThe accounts that currently hold shares in each vault
signalEach deposit or redemption as a change in signal, by account, term, and curve ID
event, deposit_fact, redemption_fact, fee_transfer_factNormalized facts for analytics
account, account_pnl_state, account_pnl_snapshotAccounts, and their profit and loss over time
leaderboard_cache, leaderboard_cache_versionVersioned leaderboards
stats, stats_historyProtocol totals and their history
projection_checkpointsThe last event each projection processed
projection_dead_letterEvents a projection could not process, held for an operator to inspect

The event store also contains tables for product analytics. A standard node does not fill them.

How the databases relate

The databases are linked by identifier, not by foreign key.

  • An atom's kg.nodes.id equals its term_id in the read models.
  • A triple's kg.triples.id equals its term_id in the read models.

To combine data from both, query each database and join on the identifier in your application.

Notes

  • The query API's GET /api/schema returns the knowledge graph's tables, columns, keys, and indexes as JSON.
  • Some event store objects, including continuous aggregates, views, and compression policies, are defined only in SQL migrations, in migrations/timescale/. Read the migration before you depend on one.