@agentforge/tools 0.12.5 → 0.13.0
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.
- package/README.md +89 -4
- package/dist/index.cjs +6973 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3919 -207
- package/dist/index.d.ts +3919 -207
- package/dist/index.js +6889 -75
- package/dist/index.js.map +1 -1
- package/package.json +26 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @agentforge/tools
|
|
2
2
|
|
|
3
|
-
> Production-ready tools collection for AgentForge -
|
|
3
|
+
> Production-ready tools collection for AgentForge - 88 tools for web, data, file, utility, and agent operations
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@agentforge/tools)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## 🎉 Status: Production Ready & Published
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
**88 production-ready tools** | **Full TypeScript support** | **Comprehensive documentation** | **LangChain compatible**
|
|
12
12
|
|
|
13
13
|
## 📦 Installation
|
|
14
14
|
|
|
@@ -20,12 +20,28 @@ pnpm add @agentforge/tools
|
|
|
20
20
|
yarn add @agentforge/tools
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
### Optional Peer Dependencies
|
|
24
|
+
|
|
25
|
+
Some tools require additional peer dependencies. Install only what you need:
|
|
26
|
+
|
|
27
|
+
**Relational Database Tools** (PostgreSQL, MySQL, SQLite):
|
|
28
|
+
```bash
|
|
29
|
+
# PostgreSQL
|
|
30
|
+
pnpm add pg @types/pg
|
|
31
|
+
|
|
32
|
+
# MySQL
|
|
33
|
+
pnpm add mysql2
|
|
34
|
+
|
|
35
|
+
# SQLite
|
|
36
|
+
pnpm add better-sqlite3 @types/better-sqlite3
|
|
37
|
+
```
|
|
38
|
+
|
|
23
39
|
## 🎯 Overview
|
|
24
40
|
|
|
25
|
-
This package provides **
|
|
41
|
+
This package provides **88 ready-to-use tools** organized into 5 categories:
|
|
26
42
|
|
|
27
43
|
- **🌐 Web Tools** (22 tools) - HTTP requests, web search, web scraping, HTML parsing, URL manipulation, Slack integration, Confluence integration
|
|
28
|
-
- **📊 Data Tools** (
|
|
44
|
+
- **📊 Data Tools** (25 tools) - JSON, CSV, XML processing, data transformation, and Neo4j graph database with embeddings
|
|
29
45
|
- **📁 File Tools** (18 tools) - File operations, directory management, path utilities
|
|
30
46
|
- **🔧 Utility Tools** (22 tools) - Date/time, strings, math, validation
|
|
31
47
|
- **🤖 Agent Tools** (1 tool) - Human-in-the-loop and agent interaction
|
|
@@ -144,6 +160,15 @@ Tools for data processing and transformation.
|
|
|
144
160
|
- **`objectPick`** - Pick specific properties from objects
|
|
145
161
|
- **`objectOmit`** - Omit specific properties from objects
|
|
146
162
|
|
|
163
|
+
#### Neo4j Graph Database Tools
|
|
164
|
+
- **`neo4jQuery`** - Execute Cypher queries against Neo4j
|
|
165
|
+
- **`neo4jGetSchema`** - Get graph schema (labels, relationships, properties)
|
|
166
|
+
- **`neo4jFindNodes`** - Find nodes by label and properties
|
|
167
|
+
- **`neo4jTraverse`** - Traverse graph following relationships
|
|
168
|
+
- **`neo4jVectorSearch`** - Semantic search using vector indexes (GraphRAG)
|
|
169
|
+
- **`neo4jVectorSearchWithEmbedding`** - Semantic search with automatic embedding generation
|
|
170
|
+
- **`neo4jCreateNodeWithEmbedding`** - Create nodes with automatic embeddings
|
|
171
|
+
|
|
147
172
|
### 📁 File Tools (18 tools)
|
|
148
173
|
|
|
149
174
|
Tools for file system operations.
|
|
@@ -491,6 +516,66 @@ const sorted = await arraySort.invoke({
|
|
|
491
516
|
console.log(sorted.sorted);
|
|
492
517
|
```
|
|
493
518
|
|
|
519
|
+
### Neo4j Graph Database Example
|
|
520
|
+
|
|
521
|
+
```typescript
|
|
522
|
+
import {
|
|
523
|
+
initializeNeo4jTools,
|
|
524
|
+
neo4jQuery,
|
|
525
|
+
neo4jGetSchema,
|
|
526
|
+
neo4jFindNodes,
|
|
527
|
+
neo4jTraverse,
|
|
528
|
+
neo4jVectorSearch,
|
|
529
|
+
} from '@agentforge/tools';
|
|
530
|
+
|
|
531
|
+
// Initialize connection (reads from environment variables)
|
|
532
|
+
await initializeNeo4jTools();
|
|
533
|
+
|
|
534
|
+
// Get graph schema
|
|
535
|
+
const schema = await neo4jGetSchema.execute({});
|
|
536
|
+
console.log('Node Labels:', schema.schema.nodeLabels);
|
|
537
|
+
console.log('Relationships:', schema.schema.relationshipTypes);
|
|
538
|
+
|
|
539
|
+
// Execute Cypher query
|
|
540
|
+
const result = await neo4jQuery.execute({
|
|
541
|
+
cypher: 'MATCH (p:Person)-[:KNOWS]->(friend) WHERE p.name = $name RETURN friend',
|
|
542
|
+
parameters: { name: 'Alice' },
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
// Find nodes by label and properties
|
|
546
|
+
const people = await neo4jFindNodes.execute({
|
|
547
|
+
label: 'Person',
|
|
548
|
+
properties: { city: 'New York' },
|
|
549
|
+
limit: 10,
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
// Traverse graph from a starting node
|
|
553
|
+
const connections = await neo4jTraverse.execute({
|
|
554
|
+
startNodeId: 123,
|
|
555
|
+
relationshipType: 'KNOWS',
|
|
556
|
+
direction: 'outgoing',
|
|
557
|
+
maxDepth: 2,
|
|
558
|
+
limit: 50,
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
// Vector search for GraphRAG (requires vector index)
|
|
562
|
+
// Note: queryVector must be a complete array of numbers matching your embedding dimensions
|
|
563
|
+
const embeddingVector = new Array(1536).fill(0).map(() => Math.random()); // Example: 1536-dim vector
|
|
564
|
+
const similar = await neo4jVectorSearch.execute({
|
|
565
|
+
indexName: 'document_embeddings',
|
|
566
|
+
queryVector: embeddingVector,
|
|
567
|
+
limit: 5,
|
|
568
|
+
});
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
**Environment Variables:**
|
|
572
|
+
```bash
|
|
573
|
+
NEO4J_URI=bolt://localhost:7687
|
|
574
|
+
NEO4J_USER=neo4j
|
|
575
|
+
NEO4J_PASSWORD=your-password
|
|
576
|
+
NEO4J_DATABASE=neo4j # Optional, defaults to 'neo4j'
|
|
577
|
+
```
|
|
578
|
+
|
|
494
579
|
### File Operations Example
|
|
495
580
|
|
|
496
581
|
```typescript
|