npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nexus-gravitas

v1.0.3

Published

Gravitas — temporal semantic memory for agentic systems. A gravit is the atomic unit of weighted, time-bound knowledge.

Readme

nexus-gravitas

Gravitas — temporal semantic memory for agentic systems.

Gravitas takes its name from the GSV Gravitas in Iain M. Banks' Excession — a Culture Mind carrying the accumulated weight of knowledge it can barely contain.

A gravit is the atomic unit of weighted, time-bound knowledge: [entity, attribute, value, tx_id]. Nothing is ever updated or deleted — only new gravita are appended. Retractions add a new gravit with retracted=true. Time-travel is native: query the DB as it was at any transaction or timestamp.

Every gravit carries an influence weight that tracks how dominant a fact is over time. Facts start at weight 1.0, gain weight when corroborated by other agents, lose weight when contradicted, and passively decay. Dominance curves, fact duration, and anomaly detection expose this lifecycle.

Stack

  • TypeScript throughout
  • PostgreSQL + pgvector backend (connection via DATABASE_URL env var)
  • MCP server as the only interface (stdio transport)

Quick Start

npm install
npm run build

DATABASE_URL=postgres://localhost/mydb node dist/index.js

The server migrates the schema on startup (idempotent CREATE IF NOT EXISTS).

Entity ID Conventions

Entity IDs are namespaced strings — human-readable and persistent across sessions. Agents address entities by name directly.

| Namespace | Description | Example | |---------------|------------------------------------------|------------------------------------| | project: | Long-lived project entities | project:ecoclaw | | session: | Agent session contexts | session:abc-123 | | task: | Discrete tasks / work items | task:implement-auth | | decision: | Recorded decisions with rationale | decision:2026-05-07:db-choice | | concept: | Domain knowledge entries | concept:temporal-database | | user: | Human users | user:gonzih | | agent: | AI agent instances or roles | agent:planner | | file: | File references | file:src/main.ts | | event: | Discrete events (UUID suffix OK) | event:f47ac10b-... |

Recommended characters: alphanumeric, -, _, :, .. Max 256 characters.

MCP Tools

Writes

transact

Atomically assert or retract a batch of facts.

{
  "facts": [
    { "op": "assert", "entity": "project:ecoclaw", "attribute": "status", "value": "active" },
    { "op": "retract", "entity": "project:ecoclaw", "attribute": "status", "value": "planning" }
  ],
  "agent_id": "agent:planner",
  "note": "Status updated after review"
}

Returns: { "tx_id": 42, "tx_at": "2026-05-07T14:23:00Z", "count": 2 }

corroborate

Explicitly corroborate a fact — increases its influence weight and resets its decay clock.

{
  "entity": "project:ecoclaw",
  "attribute": "status",
  "value": "active",
  "agent_id": "agent:reviewer",
  "note": "Confirmed active in standup"
}

Current State Queries

get

Get current facts for an entity (latest non-retracted value per attribute).

{ "entity": "project:ecoclaw" }
{ "entity": "project:ecoclaw", "attribute": "status" }

find

Find all entities currently having attribute = value.

{ "attribute": "status", "value": "active" }

query

Filtered current-state query with optional entity pattern, attribute, and since timestamp.

{ "entity_pattern": "project:%", "attribute": "status", "since": "2026-01-01T00:00:00Z" }

Time-Travel Queries

as_of

Get entity state at a specific past transaction or timestamp.

{ "entity": "project:ecoclaw", "tx_id": 42 }
{ "entity": "project:ecoclaw", "timestamp": "2026-03-01T00:00:00Z" }

history

Full timeline of all gravita (including retractions) for an entity/attribute.

{ "entity": "project:ecoclaw", "attribute": "status" }

since

All gravita added after a given transaction.

{ "tx_id": 100, "entity_pattern": "project:%" }

Semantic Weight / Dominance

get_dominance_curve

Return the full influence weight history and lifecycle phase for a fact (assert → dominance → decay → superseded).

{ "entity": "project:ecoclaw", "attribute": "status", "value": "active" }

get_dominant_facts

Return the currently dominant facts for an entity (or globally), ranked by effective influence weight.

{ "entity": "project:ecoclaw", "threshold": 0.7, "limit": 20 }

detect_anomalies

Detect facts with anomalous weight trajectories: fast_ascent (suspicious rapid corroboration), isolated_assertion (unconfirmed high-weight fact), fast_decay (contradicted quickly).

{ "entity": "project:ecoclaw", "window_hours": 24 }

get_fact_duration

Return the effective duration of a fact — the period during which it was dominant (weight above threshold).

{ "entity": "project:ecoclaw", "attribute": "status", "value": "active" }

Meta

list_entities

All distinct entity IDs, optionally filtered by attribute.

{ "attribute_filter": "status" }

list_attributes

All distinct attributes and their usage counts.

get_transaction

Transaction metadata + all gravita written in that transaction.

{ "tx_id": 42 }

stats

Total gravita, transactions, entities, attributes, and DB size.

Time-Travel Examples

# Assert initial status
transact([{ op: "assert", entity: "project:ecoclaw", attribute: "status", value: "planning" }])
→ { tx_id: 1 }

# Later: transition to active
transact([
  { op: "retract", entity: "project:ecoclaw", attribute: "status", value: "planning" },
  { op: "assert",  entity: "project:ecoclaw", attribute: "status", value: "active" }
])
→ { tx_id: 2 }

# Current state
get({ entity: "project:ecoclaw", attribute: "status" })
→ [{ attribute: "status", value: "active", tx_id: 2 }]

# As-of tx 1 (before the update)
as_of({ entity: "project:ecoclaw", tx_id: 1, attribute: "status" })
→ [{ attribute: "status", value: "planning", tx_id: 1 }]

# Full history
history({ entity: "project:ecoclaw", attribute: "status" })
→ [
    { retracted: false, value: "planning", tx_id: 1 },
    { retracted: true,  value: "planning", tx_id: 2 },
    { retracted: false, value: "active",   tx_id: 2 }
  ]

Environment Variables

| Variable | Description | Required | |----------------|------------------------------------|----------| | DATABASE_URL | PostgreSQL connection string | Yes |

Development

npm install
npm run build       # compile TypeScript
npm test            # run integration tests (requires DATABASE_URL)

MCP Configuration

See settings.snippet.json for the Claude Code / MCP config snippet.