Skip to main content

NoSocial reputation reporting for LangGraph/LangChain — auto-reports agent interactions to the NoSocial oracle

Project description

nosocial-langgraph

NoSocial reputation reporting for LangGraph and LangChain. Add a callback handler — your graph nodes and tools build reputation automatically.

Install

pip install nosocial-langgraph

Usage

from nosocial_langgraph import NoSocialCallbackHandler

handler = NoSocialCallbackHandler(oracle_url="https://api.nosocial.me")

# Pass handler to any LangGraph graph invocation
result = graph.invoke({"messages": []}, config={"callbacks": [handler]})

Note: Reports are only generated for node-level events (where parent_run_id is set). This works with LangGraph graphs where nodes execute as sub-runs. Standalone LangChain chain calls may not trigger reports since they run as top-level invocations.

What it does

The callback handler intercepts LangChain/LangGraph events and submits signed interaction reports:

Event Domain Score
on_chain_end (node completes) task_completion 0.8 if output non-empty, -0.5 if empty
on_chain_error (node fails) reliability -0.8
on_tool_end (tool completes) task_completion 0.8 if output non-empty, -0.5 if empty
on_retriever_end (retriever returns) information_quality 0.7 if docs returned, -0.3 if empty

Only node-level events are reported — top-level graph runs are skipped to avoid double-counting.

Identity mapping

  • Reporter: The graph itself, identified by graph_name
  • Subject: Each node/tool in the graph, namespaced as {graph_name}:{node_name}

Each identity gets a persistent Ed25519 keypair stored in .nosocial/keys/.

Configuration

handler = NoSocialCallbackHandler(
    oracle_url="https://api.nosocial.me",  # Oracle endpoint
    keys_dir=".nosocial/keys",             # Where to store agent keypairs
    graph_name="my-graph",                 # Name for the graph's identity
    auto_register=True,                    # Auto-register agents with oracle
)

Key storage

Agent keypairs are stored as PEM files in .nosocial/keys/ with 0600 permissions. Add this to your .gitignore:

.nosocial/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nosocial_langgraph-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nosocial_langgraph-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file nosocial_langgraph-0.1.0.tar.gz.

File metadata

  • Download URL: nosocial_langgraph-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nosocial_langgraph-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a14b66d3204f41c0b4365afba5019dad9b47835ba1d4c97d2014d6999102c9e8
MD5 6565af4d59fdef3a90a7443c808e8b6a
BLAKE2b-256 3e6721377361b8429badaed76797d492f0c4bf613aed4958aa144cd64cc62581

See more details on using hashes here.

File details

Details for the file nosocial_langgraph-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nosocial_langgraph-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nosocial_langgraph-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03582c40a4b7fcd67ee8efc7c6143a37b4614ae91cdc46c2c7609157b2b69143
MD5 8ae749862d8114dfd1bfed8fdd2ac93a
BLAKE2b-256 7299f401c12fba81c32f54e228f43b48d85f7b39582ea0a75198adafcc533fe3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page