@agentforge/tools 0.12.5 → 0.12.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.
- package/README.md +73 -4
- package/dist/index.cjs +1818 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2091 -25
- package/dist/index.d.ts +2091 -25
- package/dist/index.js +1771 -70
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
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
|
|
|
@@ -22,10 +22,10 @@ yarn add @agentforge/tools
|
|
|
22
22
|
|
|
23
23
|
## 🎯 Overview
|
|
24
24
|
|
|
25
|
-
This package provides **
|
|
25
|
+
This package provides **88 ready-to-use tools** organized into 5 categories:
|
|
26
26
|
|
|
27
27
|
- **🌐 Web Tools** (22 tools) - HTTP requests, web search, web scraping, HTML parsing, URL manipulation, Slack integration, Confluence integration
|
|
28
|
-
- **📊 Data Tools** (
|
|
28
|
+
- **📊 Data Tools** (25 tools) - JSON, CSV, XML processing, data transformation, and Neo4j graph database with embeddings
|
|
29
29
|
- **📁 File Tools** (18 tools) - File operations, directory management, path utilities
|
|
30
30
|
- **🔧 Utility Tools** (22 tools) - Date/time, strings, math, validation
|
|
31
31
|
- **🤖 Agent Tools** (1 tool) - Human-in-the-loop and agent interaction
|
|
@@ -144,6 +144,15 @@ Tools for data processing and transformation.
|
|
|
144
144
|
- **`objectPick`** - Pick specific properties from objects
|
|
145
145
|
- **`objectOmit`** - Omit specific properties from objects
|
|
146
146
|
|
|
147
|
+
#### Neo4j Graph Database Tools
|
|
148
|
+
- **`neo4jQuery`** - Execute Cypher queries against Neo4j
|
|
149
|
+
- **`neo4jGetSchema`** - Get graph schema (labels, relationships, properties)
|
|
150
|
+
- **`neo4jFindNodes`** - Find nodes by label and properties
|
|
151
|
+
- **`neo4jTraverse`** - Traverse graph following relationships
|
|
152
|
+
- **`neo4jVectorSearch`** - Semantic search using vector indexes (GraphRAG)
|
|
153
|
+
- **`neo4jVectorSearchWithEmbedding`** - Semantic search with automatic embedding generation
|
|
154
|
+
- **`neo4jCreateNodeWithEmbedding`** - Create nodes with automatic embeddings
|
|
155
|
+
|
|
147
156
|
### 📁 File Tools (18 tools)
|
|
148
157
|
|
|
149
158
|
Tools for file system operations.
|
|
@@ -491,6 +500,66 @@ const sorted = await arraySort.invoke({
|
|
|
491
500
|
console.log(sorted.sorted);
|
|
492
501
|
```
|
|
493
502
|
|
|
503
|
+
### Neo4j Graph Database Example
|
|
504
|
+
|
|
505
|
+
```typescript
|
|
506
|
+
import {
|
|
507
|
+
initializeNeo4jTools,
|
|
508
|
+
neo4jQuery,
|
|
509
|
+
neo4jGetSchema,
|
|
510
|
+
neo4jFindNodes,
|
|
511
|
+
neo4jTraverse,
|
|
512
|
+
neo4jVectorSearch,
|
|
513
|
+
} from '@agentforge/tools';
|
|
514
|
+
|
|
515
|
+
// Initialize connection (reads from environment variables)
|
|
516
|
+
await initializeNeo4jTools();
|
|
517
|
+
|
|
518
|
+
// Get graph schema
|
|
519
|
+
const schema = await neo4jGetSchema.execute({});
|
|
520
|
+
console.log('Node Labels:', schema.schema.nodeLabels);
|
|
521
|
+
console.log('Relationships:', schema.schema.relationshipTypes);
|
|
522
|
+
|
|
523
|
+
// Execute Cypher query
|
|
524
|
+
const result = await neo4jQuery.execute({
|
|
525
|
+
cypher: 'MATCH (p:Person)-[:KNOWS]->(friend) WHERE p.name = $name RETURN friend',
|
|
526
|
+
parameters: { name: 'Alice' },
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
// Find nodes by label and properties
|
|
530
|
+
const people = await neo4jFindNodes.execute({
|
|
531
|
+
label: 'Person',
|
|
532
|
+
properties: { city: 'New York' },
|
|
533
|
+
limit: 10,
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
// Traverse graph from a starting node
|
|
537
|
+
const connections = await neo4jTraverse.execute({
|
|
538
|
+
startNodeId: 123,
|
|
539
|
+
relationshipType: 'KNOWS',
|
|
540
|
+
direction: 'outgoing',
|
|
541
|
+
maxDepth: 2,
|
|
542
|
+
limit: 50,
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
// Vector search for GraphRAG (requires vector index)
|
|
546
|
+
// Note: queryVector must be a complete array of numbers matching your embedding dimensions
|
|
547
|
+
const embeddingVector = new Array(1536).fill(0).map(() => Math.random()); // Example: 1536-dim vector
|
|
548
|
+
const similar = await neo4jVectorSearch.execute({
|
|
549
|
+
indexName: 'document_embeddings',
|
|
550
|
+
queryVector: embeddingVector,
|
|
551
|
+
limit: 5,
|
|
552
|
+
});
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
**Environment Variables:**
|
|
556
|
+
```bash
|
|
557
|
+
NEO4J_URI=bolt://localhost:7687
|
|
558
|
+
NEO4J_USER=neo4j
|
|
559
|
+
NEO4J_PASSWORD=your-password
|
|
560
|
+
NEO4J_DATABASE=neo4j # Optional, defaults to 'neo4j'
|
|
561
|
+
```
|
|
562
|
+
|
|
494
563
|
### File Operations Example
|
|
495
564
|
|
|
496
565
|
```typescript
|