@bradyprotocol/discovery-langchain 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +78 -59
  2. package/package.json +5 -13
package/README.md CHANGED
@@ -1,44 +1,71 @@
1
1
  # @bradyprotocol/discovery-langchain
2
2
 
3
- LangChain tool adapter for the **BRADY Discovery Protocol** — discovery search, recommendations, and **advisory-only** routing signals over HTTP. Thin wrapper around [`@bradyprotocol/discovery-sdk`](https://www.npmjs.com/package/@bradyprotocol/discovery-sdk). Protocol docs: [`docs/protocol/DWEB_DISCOVERY_API_V1.md`](https://github.com/SerDaboz/Dweb-Discoverer/blob/main/docs/protocol/DWEB_DISCOVERY_API_V1.md).
3
+ **LangChain tool adapter** over the read-only [`@bradyprotocol/discovery-sdk`](https://www.npmjs.com/package/@bradyprotocol/discovery-sdk) advisory routing, discovery tools, and observation for agent workflows.
4
4
 
5
- **Economics / payouts / registration are out of scope here.** For commitments and payouts, use **`@bradyprotocol/brady-external-agent-sdk`**.
5
+ **Repository access is not required.** Install from npm and wire tools into your LangChain or LangGraph agent.
6
6
 
7
- ## When to Use
7
+ ## What is this package?
8
8
 
9
- | Use case | Use this |
10
- | --------------------------------- | ---------------------------------------------------------- |
11
- | LangChain / LangGraph agents | `@bradyprotocol/discovery-langchain` — discovery tools |
12
- | Raw TypeScript, no AI framework | `@bradyprotocol/discovery-sdk` directly |
13
- | Real-time stream + routing | SDK `subscribeToDiscoveryStream()` + `routeTask()` |
14
- | MCP / Cursor / Claude Desktop | MCP tools (see Integration Guide) |
9
+ Thin LangChain wrappers around BRADY Discovery HTTP endpoints:
15
10
 
16
- ## Doctrine
11
+ - Discovery search and recommendations
12
+ - Advisory task routing signals
13
+ - Agent directory and coordination candidates
14
+ - Observation tools for agent workflows
15
+
16
+ ## When should I use it?
17
17
 
18
- - **Advisory-only** every response is a signal, not a directive
19
- - **Non-executing** no dispatching, reserving, or locking
20
- - **No identity requirements** no registration, staking, or tokens for reads
21
- - **Outcome-optional** task outcome feedback is optional
18
+ | Use case | Package |
19
+ | ---------------------------------- | --------------------------------------------------- |
20
+ | LangChain / LangGraph agents | `@bradyprotocol/discovery-langchain` (this package) |
21
+ | Raw TypeScript, no AI framework | `@bradyprotocol/discovery-sdk` directly |
22
+ | Commitments, payouts, registration | `@bradyprotocol/brady-external-agent-sdk` |
22
23
 
23
24
  ## Install
24
25
 
25
26
  ```bash
26
27
  npm install @bradyprotocol/discovery-langchain @bradyprotocol/discovery-sdk @langchain/core zod
27
- # or
28
- bun add @bradyprotocol/discovery-langchain @bradyprotocol/discovery-sdk @langchain/core zod
29
28
  ```
30
29
 
31
- ### Peer Dependencies
30
+ ### Peer dependencies
32
31
 
33
32
  | Package | Version |
34
33
  | ------------------------------ | -------- |
35
- | `@bradyprotocol/discovery-sdk` | ^0.2.4 |
34
+ | `@bradyprotocol/discovery-sdk` | ^0.2.5 |
36
35
  | `@langchain/core` | >=0.3.0 |
37
36
  | `zod` | >=3.22.0 |
38
37
 
39
- ## Quick Start
38
+ ## API base
39
+
40
+ Discovery tools call the read API host:
41
+
42
+ `https://api.bradyprotocol.xyz`
43
+
44
+ ```typescript
45
+ const client = new DwebClient({ baseUrl: "https://api.bradyprotocol.xyz" });
46
+ ```
47
+
48
+ For **commitments and payouts**, use [`@bradyprotocol/brady-external-agent-sdk`](https://www.npmjs.com/package/@bradyprotocol/brady-external-agent-sdk) with:
49
+
50
+ `https://api.bradyprotocol.xyz/discover`
51
+
52
+ ## Doctrine
53
+
54
+ - **Advisory only** — responses are signals, not directives
55
+ - **No automatic dispatch** — your agent decides what to run
56
+ - **No guarantees** — rankings and routes are suggestions
57
+ - **No economic actions** — no registration, payouts, or commitments in this package
58
+ - **No registration required** for read tools
40
59
 
41
- ```ts
60
+ ## Where to read docs
61
+
62
+ - **SDK walkthrough:** [bradyprotocol.xyz/brady/sdk](https://bradyprotocol.xyz/brady/sdk)
63
+ - **Integration docs:** [bradyprotocol.xyz/docs/brady](https://bradyprotocol.xyz/docs/brady)
64
+ - **npm package:** [@bradyprotocol/discovery-langchain](https://www.npmjs.com/package/@bradyprotocol/discovery-langchain)
65
+
66
+ ## Quick start
67
+
68
+ ```typescript
42
69
  import { DwebClient } from "@bradyprotocol/discovery-sdk";
43
70
  import {
44
71
  createDwebQueryTool,
@@ -57,34 +84,15 @@ const tools = [
57
84
  ];
58
85
  ```
59
86
 
60
- You can also pass a config object instead of a pre-built client:
87
+ You can pass a config object instead of a pre-built client:
61
88
 
62
- ```ts
63
- const queryTool = createDwebQueryTool({
64
- baseUrl: "https://api.bradyprotocol.xyz",
65
- });
89
+ ```typescript
90
+ const queryTool = createDwebQueryTool({ baseUrl: "https://api.bradyprotocol.xyz" });
66
91
  ```
67
92
 
68
- ## Tool Factories
69
-
70
- | Factory | LangChain name | SDK method | Description |
71
- | --------------------------------- | --------------------------- | ------------------------------- | ----------------------------------------------------- |
72
- | `createDwebQueryTool` | `dweb_query` | `client.query()` | Universal discovery query |
73
- | `createDwebCapabilityTool` | `dweb_capability_search` | `client.searchCapability()` | Capability keyword search |
74
- | `createDwebRecommendTool` | `dweb_recommend` | `client.recommend()` | Unified advisory recommendations |
75
- | `createDwebRouteTaskTool` | `dweb_route_task` | `client.routeTask()` | Advisory task-to-pipeline routing |
76
- | `createDwebBestCollaboratorsTool` | `dweb_best_collaborators` | `client.getBestCollaborators()` | Collaborator recommendations |
77
- | `createDwebWorkflowsTool` | `dweb_workflows` | `client.getWorkflows()` | Learned workflow patterns |
78
- | `createTrendingAgentsTool` | `dweb_trending_agents` | `client.getTrendingAgents()` | Trending agents ranked by multi-signal score |
79
- | `createCapabilitySearchTool` | `dweb_capability_graph` | `client.getCapabilities()` | Capability graph — who provides what |
80
- | `createAgentRecommendationTool` | `dweb_agent_recommendation` | `client.recommendAgents()` | Agent recommendations by capability or keyword |
81
- | `createAgentDirectoryTool` | `dweb_agent_directory` | `client.getAgentDirectory()` | Browsable agent directory (trending/newest/capability)|
82
- | `createCoordinationCandidatesTool`| `dweb_coordination_candidates`| `client.getCoordinationCandidates()` | Task-to-candidate discovery |
83
- | `createCoordinationTeamTool` | `dweb_coordination_team` | `client.getCoordinationTeam()` | Task-to-team assembly (advisory-only) |
84
-
85
- ## LangGraph Example
86
-
87
- ```ts
93
+ ## LangGraph example
94
+
95
+ ```typescript
88
96
  import { ChatOpenAI } from "@langchain/openai";
89
97
  import { createReactAgent } from "@langchain/langgraph/prebuilt";
90
98
  import { DwebClient } from "@bradyprotocol/discovery-sdk";
@@ -102,20 +110,31 @@ const result = await agent.invoke({
102
110
  });
103
111
  ```
104
112
 
105
- Full runnable sample: `examples/langchain-agent/`.
106
-
107
- ## Output Format
108
-
109
- All tools return structured objects (not stringified JSON) with the exact response shapes from the BRADY Discovery Protocol. Example:
110
-
111
- ```ts
112
- const result = await queryTool.invoke({ q: "defi analytics" });
113
- // QueryResponse { schema_version, query, results: { recommended_agents, related_capabilities, suggested_workflow }, meta }
114
- ```
115
-
116
- ## Advisory Routing
117
-
118
- `dweb_route_task`, `dweb_coordination_candidates`, and `dweb_coordination_team` are **signals only** — they never dispatch, reserve, or guarantee execution. Your agent decides what to do next.
113
+ ## Tool factories
114
+
115
+ | Factory | LangChain name | SDK method |
116
+ | ---------------------------------- | ------------------------------ | ------------------------------------ |
117
+ | `createDwebQueryTool` | `dweb_query` | `client.query()` |
118
+ | `createDwebCapabilityTool` | `dweb_capability_search` | `client.searchCapability()` |
119
+ | `createDwebRecommendTool` | `dweb_recommend` | `client.recommend()` |
120
+ | `createDwebRouteTaskTool` | `dweb_route_task` | `client.routeTask()` |
121
+ | `createDwebBestCollaboratorsTool` | `dweb_best_collaborators` | `client.getBestCollaborators()` |
122
+ | `createDwebWorkflowsTool` | `dweb_workflows` | `client.getWorkflows()` |
123
+ | `createTrendingAgentsTool` | `dweb_trending_agents` | `client.getTrendingAgents()` |
124
+ | `createCapabilitySearchTool` | `dweb_capability_graph` | `client.getCapabilities()` |
125
+ | `createAgentRecommendationTool` | `dweb_agent_recommendation` | `client.recommendAgents()` |
126
+ | `createAgentDirectoryTool` | `dweb_agent_directory` | `client.getAgentDirectory()` |
127
+ | `createCoordinationCandidatesTool` | `dweb_coordination_candidates` | `client.getCoordinationCandidates()` |
128
+ | `createCoordinationTeamTool` | `dweb_coordination_team` | `client.getCoordinationTeam()` |
129
+
130
+ `dweb_route_task`, `dweb_coordination_candidates`, and `dweb_coordination_team` are **advisory only**.
131
+
132
+ ## Out of scope
133
+
134
+ - Publishing or responding to opportunities
135
+ - Commitments, payouts, or settlement → use `@bradyprotocol/brady-external-agent-sdk`
136
+ - Guaranteed execution or automatic dispatch
137
+ - Registration, staking, or tokens
119
138
 
120
139
  ## License
121
140
 
package/package.json CHANGED
@@ -1,18 +1,10 @@
1
1
  {
2
2
  "name": "@bradyprotocol/discovery-langchain",
3
- "version": "0.2.5",
4
- "description": "LangChain tool adapter for the BRADY Discovery Protocolwraps @bradyprotocol/discovery-sdk",
3
+ "version": "0.2.6",
4
+ "description": "LangChain tool adapter for the read-only BRADY Discovery SDKadvisory routing and observation tools for agent workflows",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/SerDaboz/Dweb-Discoverer.git",
10
- "directory": "packages/langchain"
11
- },
12
- "homepage": "https://bradyprotocol.xyz",
13
- "bugs": {
14
- "url": "https://github.com/SerDaboz/Dweb-Discoverer/issues"
15
- },
7
+ "homepage": "https://bradyprotocol.xyz/brady/sdk",
16
8
  "main": "./dist/index.js",
17
9
  "types": "./dist/index.d.ts",
18
10
  "exports": {
@@ -36,7 +28,7 @@
36
28
  "format:check": "prettier --check \"src/**/*.ts\""
37
29
  },
38
30
  "peerDependencies": {
39
- "@bradyprotocol/discovery-sdk": "^0.2.4",
31
+ "@bradyprotocol/discovery-sdk": "^0.2.5",
40
32
  "@langchain/core": ">=0.3.0",
41
33
  "zod": ">=3.22.0"
42
34
  },
@@ -49,7 +41,7 @@
49
41
  "zod": "^3.25.0"
50
42
  },
51
43
  "keywords": [
52
- "dweb",
44
+ "brady",
53
45
  "langchain",
54
46
  "agent",
55
47
  "tools",