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

@pson5/neo4j-store

v0.2.2

Published

Neo4j graph persistence, configuration, and sync helpers for PSON5 knowledge graphs.

Readme

@pson5/neo4j-store

Neo4j-backed graph persistence and sync helpers for PSON5. The .pson profile remains the source of truth; Neo4j is an optional mirror for cross-profile traversal, visualization, or any downstream graph tooling that expects Cypher.

Install

npm install @pson5/neo4j-store neo4j-driver

Requires a reachable Neo4j 5.x instance (Aura, Docker, or self-hosted). See the one-command Docker setup if you need one locally.

Configuration

Credentials resolve from environment first, then from <store>/config/neo4j.json:

export PSON_NEO4J_URI="neo4j+s://<id>.databases.neo4j.io"
export PSON_NEO4J_USERNAME=neo4j
export PSON_NEO4J_PASSWORD="<your-password>"
export PSON_NEO4J_DATABASE=neo4j      # optional

Persisting credentials via saveNeo4jConfig writes a file with 0600 permissions on POSIX systems.

Usage

Check whether Neo4j is reachable

import { getNeo4jStatus } from "@pson5/neo4j-store";

const status = await getNeo4jStatus({ rootDir: ".pson5-store" });
console.log(status);
// { configured: true, enabled: true, connected: true, uri: "bolt://…", database: "neo4j", latency_ms: 42 }

Sync a profile's knowledge graph

import { loadProfile } from "@pson5/serialization-engine";
import { syncProfileToNeo4j } from "@pson5/neo4j-store";

const profile = await loadProfile("pson_abc123", { rootDir: ".pson5-store" });
const result = await syncProfileToNeo4j(profile, { rootDir: ".pson5-store" });

console.log(`${result.nodes_written} nodes, ${result.edges_written} edges`);

The sync is idempotent: re-running with the same profile produces the same graph state. Nodes are keyed by (profile_id, node_id); edges by (profile_id, from, to, relation).

Query from Cypher directly

After sync, you can open the Neo4j Browser and run:

MATCH (p:PsonProfile {profile_id: $id})-[:HAS_NODE]->(n)-[r:PSON_EDGE]->(m)
RETURN p, n, r, m;

All Cypher written by this package uses parameterised queries — no string concatenation of user-controlled data.

What this package does not do

  • Does not hold a long-lived driver connection — each call opens and closes its own session. Integrate with @pson5/sdk or your own pool if you need persistent connections.
  • Does not replicate the entire profile. Only knowledge_graph.nodes and knowledge_graph.edges are mirrored; observed / inferred / simulated layers remain in the .pson file.
  • Does not enforce consent scopes. The caller is expected to project/redact via @pson5/privacy or @pson5/agent-context before syncing if that matters.

Related

  • @pson5/graph-engine — deterministic in-memory graph construction from a profile. You don't need Neo4j to produce a graph.
  • @pson5/sdk — the primary entry point if you want everything wired together.

License

MIT