Metadata-Version: 2.5
Name: langchain-neuronto
Version: 0.1.0
Summary: LangChain tool and retriever for the Neuronto Agentic Resource Discovery (ARD) registry.
Project-URL: Homepage, https://neuronto.com
Project-URL: Documentation, https://neuronto.com/api-docs
Author: Neuronto
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,ard,langchain,mcp,retriever,tool-discovery
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: pydantic>=2
Requires-Dist: requests>=2.25
Provides-Extra: test
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

# langchain-neuronto

LangChain integration for [Neuronto](https://neuronto.com), an Agentic Resource Discovery (ARD) registry. Describe the capability you need in plain language and get back matching tools, APIs and MCP servers.

It provides:

- `NeurontoSearchTool`: a LangChain tool an agent can call.
- `NeurontoRetriever`: a retriever returning `Document`s for use in chains.

## Install

```bash
pip install langchain-neuronto
```

Searching works without credentials. If you have an API key, set `NEURONTO_API_KEY` (sent as a bearer token) or pass `api_key=...`.

## Tool in an agent

```python
from langchain.agents import create_agent
from langchain_neuronto import NeurontoSearchTool

agent = create_agent("openai:gpt-4o-mini", tools=[NeurontoSearchTool(limit=5)])
result = agent.invoke({"messages": [("user", "Find an MCP server that can charge a credit card")]})
```

## Retriever in a chain

```python
from langchain_neuronto import NeurontoRetriever

retriever = NeurontoRetriever(k=3)
for doc in retriever.invoke("charge a credit card"):
    print(doc.metadata["name"], doc.metadata["url"], doc.metadata.get("mcp"))
```

Each document has the entry description as `page_content` and `name`, `url`, `type`, `identifier`, `score` and (for MCP servers) `mcp` in its metadata.

## Filtering by type

```python
from langchain_neuronto import NeurontoSearchTool, NeurontoRetriever

tool = NeurontoSearchTool()
print(tool.invoke({"query": "weather forecast", "type": "application/mcp-server-card+json"}))

mcp_only = NeurontoRetriever(k=5, type="application/mcp-server-card+json")
```

## Options

| Option | Default | Meaning |
| --- | --- | --- |
| `limit` / `k` | 5 | Number of results |
| `federation` | `auto` | `none` answers from the Neuronto index only |
| `base_url` | https://neuronto.com | API base |
| `api_key` | `NEURONTO_API_KEY` | Optional bearer token |

API reference: https://neuronto.com/api-docs

## License

Apache-2.0
