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

hipcortex

v0.5.2

Published

TypeScript & Node.js SDK for HipCortex - the persistent causal memory & token optimization substrate for autonomous AI agents.

Downloads

369

Readme

HipCortex TypeScript & Node.js SDK (v0.5.2)

Persistent causal topological memory, recursive Bayesian world-model prediction (/worldmodel/rollout), and automatic FSM skill compilation for autonomous AI agents.

Runs against the standalone local Rust binary (http://127.0.0.1:3030) with 0.48–0.61 ms p50 write latency, SHA-256 Merkle audit chains, and Headroom context budgeting (59–88% token savings). Zero external dependencies — uses native fetch.


🚀 Installation

npm install hipcortex

Installer note: Python is the canonical installer (pip install hipcortexhipcortex install).
This npm package is a TypeScript/Node HTTP client only — no framework scaffold wizard, no binary download, no IDE MCP registration. Use the Python CLI for install/scaffold; use this package for Node apps that talk to an existing HipCortex server.

Version matrix: npm client 0.5.2 talks to server 0.5.2 (includes /worldmodel/rollout, live_beliefs, predict). VS Code extension is 0.5.7 with 10 LM tools — docs/channels.md.


⚡ Quick Start: Multi-Tier Memory & World Model Prediction

import { HipCortexClient } from "hipcortex";

const client = new HipCortexClient({
  baseUrl: "http://127.0.0.1:3030", // or process.env.HIPCORTEX_URL
});

// 1. Multi-Tier Memory Ingestion (5 verified memory tiers)
await client.addMemory({
  actor: "agent",
  action: "configured",
  target: "jwt_token_ttl=3600",
  record_type: "Working", // Mapped natively to Temporal tier
  priority: "high",
});

await client.addMemory({
  actor: "agent",
  action: "established",
  target: "All database migrations must run inside transactions",
  record_type: "Semantic", // Mapped natively to Symbolic/LongTerm tier
  priority: "pinned",
});

// 2. Check SelfModel Execution Capacity Gates before running risky actions
if (await client.canExecute("rollout")) {
  console.log("Health check passed — engine ready for simulation");
}

// 3. World Model Trajectory Rollout Prediction (POST /worldmodel/rollout)
const rolloutResult = await client.rollout({
  initial_state: { db_status: "locked", active_tx: 1 },
  actions: ["rollback_tx", "release_lock", "retry_migration"],
});
console.log("Predicted outcome:", rolloutResult);

🧠 Proactive CodeAct Harness & Vercel AI SDK Pattern

Query the topological graph (Personalized PageRank) directly inside your LLM request pipeline:

import { HipCortexClient } from "hipcortex";
import { streamText } from "ai";

const memory = new HipCortexClient({ baseUrl: process.env.HIPCORTEX_URL! });

export async function POST(req: Request) {
  const { messages, userId } = await req.json();
  
  // Retrieve Top-K causal memory context
  const history = await memory.queryMemory({ actor: userId, limit: 10 });
  
  const result = await streamText({
    model: yourModelInstance,
    messages: [
      { role: "system", content: `Active Causal Context:\n${JSON.stringify(history.records)}` },
      ...messages
    ]
  });
  
  // Store user prompt asynchronously into causal memory
  const lastUserMsg = messages.at(-1)?.content ?? "";
  if (lastUserMsg) {
    await memory.addMemory({ actor: userId, action: "prompted", target: lastUserMsg, record_type: "Temporal" });
  }
  
  return result.toDataStreamResponse();
}

🔗 Topological Memory Foundation (TMF) Graph Methods

// Link two memories explicitly in the CausalTopoGraph
await client.linkMemories({
  source_id: "rec-uuid-1",
  target_id: "rec-uuid-2",
  relation: "caused_by"
});

// Perform Personalized PageRank (PPR α=0.85) related search from a seed record
const { results } = await client.searchRelated("rec-uuid-1", 10);
console.log("Topologically related memories:", results);

📊 Server Statistics & GDPR Right-to-Forget

// Get server diagnostics & Merkle hash chain status
const stats = await client.stats();
console.log("Memory statistics:", stats);

// Erase all records for a specific actor (GDPR right-to-forget)
await client.forget("agent");