Metadata-Version: 2.4
Name: nerq-langgraph
Version: 0.1.0
Summary: Trust-check node for LangGraph agents. Verify AI agent safety before execution.
Author-email: Nerq <hello@zarq.ai>
License-Expression: MIT
Project-URL: Homepage, https://nerq.ai/integrate/langgraph
Project-URL: Repository, https://github.com/zarqai/nerq-langgraph
Project-URL: Documentation, https://nerq.ai/integrate/langgraph
Project-URL: API Docs, https://nerq.ai/nerq/docs
Keywords: nerq,langgraph,trust,agents,trust-score,preflight,safety
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: langgraph>=0.0.1
Requires-Dist: requests>=2.28.0
Dynamic: license-file

# nerq-langgraph

Trust-check node for [LangGraph](https://github.com/langchain-ai/langgraph) agents. Verify AI agent safety before execution with the [Nerq Trust Index](https://nerq.ai).

## Install

```bash
pip install nerq-langgraph
```

## Quick Start — 3 Lines

```python
from nerq_langgraph import trust_check_node
from langgraph.graph import StateGraph

graph = StateGraph(dict)
graph.add_node("trust_check", trust_check_node(min_trust=70))
# trust_check returns state with trust_score, trust_grade, trust_approved
```

## Full Example

```python
from nerq_langgraph import trust_check_node
from langgraph.graph import StateGraph, END

def agent_action(state):
    if not state.get("trust_approved", False):
        return {**state, "result": "Blocked: agent failed trust check"}
    return {**state, "result": f"Executed with trust score {state['trust_score']}"}

graph = StateGraph(dict)
graph.add_node("trust_check", trust_check_node(min_trust=70))
graph.add_node("action", agent_action)
graph.set_entry_point("trust_check")
graph.add_edge("trust_check", "action")
graph.add_edge("action", END)

app = graph.compile()
result = app.invoke({"agent_name": "langchain"})
print(result["trust_approved"])  # True/False
print(result["trust_score"])     # 88.5
```

## Configuration

| Parameter | Default | Description |
|-----------|---------|-------------|
| `min_trust` | 60 | Minimum trust score to approve |
| `api_base` | `https://nerq.ai` | Nerq API endpoint |
| `cache_ttl` | 300 | Cache TTL in seconds |

## State Keys

The node reads `agent_name` or `target` from state and adds:

- `trust_score` — numeric score (0-100)
- `trust_grade` — letter grade (A+, A, B+, etc.)
- `trust_approved` — boolean

## Links

- [Nerq Trust Index](https://nerq.ai)
- [Integration Hub](https://nerq.ai/integrate)
- [LangGraph Docs](https://nerq.ai/integrate/langgraph)
- [PyPI](https://pypi.org/project/nerq-langgraph/)
