Skip to content

Commit

Permalink
Added readme for missing tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
darielnoel committed Dec 19, 2024
1 parent 161fedd commit d52b3fa
Show file tree
Hide file tree
Showing 5 changed files with 354 additions and 126 deletions.
144 changes: 18 additions & 126 deletions packages/tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,130 +21,22 @@ npm install @kaibanjs/tools

## Available Tools

### 1. Firecrawl

Firecrawl is a tool that allows agents to interact with the Firecrawl web scraping service, enabling them to extract clean, structured data from websites.

Learn more: https://www.firecrawl.dev/

### 2. Tavily Search

Tavily Search is a tool that provides AI-optimized search capabilities, delivering comprehensive and accurate results. It's particularly useful for retrieving current information and answering questions about recent events.

Learn more: https://tavily.com/

### 3. Serper

Serper is a tool that integrates with Google Search API service, providing access to various types of search results including web search, news, images, and more. It's particularly useful for retrieving real-time information from Google's search engine.

Learn more: https://serper.dev/

### 4. Exa Search

Exa Search is a tool that integrates with Exa (https://exa.ai/), a search engine for AI that organizes the web using embeddings. It provides high-quality web data specifically optimized for AI applications.

Key features:

- Neural Search: Meaning-based search using embeddings
- Keyword Search: Traditional search capabilities
- Auto Search: Dynamically chooses between neural and keyword
- Category-focused search (company, research paper, news, github, tweet, etc.)
- Domain and text filtering
- Date-based filtering

Learn more: https://exa.ai/

### 5. WolframAlpha

WolframAlpha is a tool that integrates with WolframAlpha's computational intelligence engine, providing detailed answers to complex queries across various domains. It's particularly powerful for mathematical, scientific, and technical computations.

Key features:

- Advanced computations and data analysis
- Scientific and mathematical calculations
- Real-time data processing
- Domain-specific knowledge in:
- Mathematics
- Physics
- Chemistry
- Engineering
- Earth Sciences
- Life Sciences
- Units & Measures
- Financial calculations
- And more

Learn more: https://www.wolframalpha.com/

### 6. Github Issues

Github Issues is a tool that allows agents to interact with the Github API, enabling them to fetch issues from a repository.

Learn more: https://docs.github.com/en/rest/issues/issues

### 7. Simple RAG

The Simple RAG Tool integrates with various components from the langchain library to provide a simple interface for asking questions and retrieving answers using the Retrieval-Augmented Generation (RAG) approach. By default use MemoryVectorStore for storing vectors, OpenAIEmbeddings for embeddings, and OpenAI LLM for generating answers.

#### Features

- Integrates with the RAG Toolkit for handling the RAG process
- Uses a Loader instance to load and process documents
- Utilizes a Chunker instance to chunk and process text
- Employs an Embeddings instance for handling embeddings
- Stores vectors using a VectorStore instance
- Leverages an LLM instance for the language model
- Defines a promptQuestionTemplate for asking questions
- Requires an OpenAI API key for interacting with the OpenAI API

#### Usage

```js
const tool = new SimpleRAG({
OPENAI_API_KEY: 'your-openai-api-key',
content: 'Large content to process',
});
const result = await tool._call({ query: 'question to ask' });
```

or

```js
const tool = new SimpleRAG({
OPENAI_API_KEY: 'your-openai-api-key',
});
const result = await tool._call({
content: 'large content to process',
query: 'question to ask',
});
```

### 8. Website Search

The Website Search Tool is specifically crafted for conducting semantic searches within the content of a particular website. Leveraging a Retrieval-Augmented Generation (RAG) model, it navigates through the information provided on a given URL. Users have the flexibility to either initiate a search across any website known or discovered during its usage or to concentrate the search on a predefined, specific website.

#### Features

Conduct semantic searches within the content of a specific website.
Utilize a RAG model to navigate and retrieve relevant information.
Flexibility to search across any website or focus on a predefined one.
Usage

#### Usage

```js
import { WebsiteSearch } from '@kaibanjs/website-search';

const tool = new WebsiteSearch({
OPENAI_API_KEY: 'your-openai-api-key',
url: 'https://example.com',
});

const result = await tool._call({
query: 'What is the main topic of this website?',
});
console.log(result);
```
Here's a list of all available tools. Click on the tool names to view their detailed documentation.

| Tool | Description | Documentation |
|------|-------------|---------------|
| Exa | AI-focused search engine using embeddings to organize web data | [README](src/exa/README.md) |
| Firecrawl | Web scraping service for extracting structured data | [README](src/firecrawl/README.md) |
| GitHub Issues | GitHub API integration for fetching and analyzing repository issues | [README](src/github-issues/README.md) |
| PDF Search | Extract and search content from PDF documents | [README](src/pdf-search/README.md) |
| Serper | Google Search API integration with support for multiple search types | [README](src/serper/README.md) |
| Simple RAG | Basic Retrieval-Augmented Generation implementation for Q&A | [README](src/simple-rag/README.md) |
| Tavily Search | AI-optimized search engine for comprehensive and accurate results | [README](src/tavily/README.md) |
| Text File Search | Search and analyze content within text files | [README](src/textfile-search/README.md) |
| Website Search | Semantic search within website content using RAG models | [README](src/website-search/README.md) |
| WolframAlpha | Computational intelligence engine for complex queries and calculations | [README](src/wolfram-alpha/README.md) |
| Zapier Webhook | Integration with Zapier for workflow automation | [README](src/zapier-webhook/README.md) |
| Make Webhook | Integration with Make (formerly Integromat) for workflow automation | [README](src/make-webhook/README.md) |

## Development

Expand Down Expand Up @@ -186,13 +78,13 @@ VITE_WOLFRAM_APP_ID=your_wolfram_app_id
npm run storybook
```

5. Build the package:
6. Build the package:

```bash
npm run build
```

6. Run tests:
7. Run tests:

```bash
npm run test
Expand Down
92 changes: 92 additions & 0 deletions packages/tools/src/github-issues/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# GitHub Issues Tool

This tool integrates with GitHub's API to fetch issues from specified repositories. It provides a clean, structured way to retrieve open issues, making it ideal for monitoring and analysis purposes in AI applications and automation workflows.

## Components

The tool uses the following components:

- A GitHub API client instance
- Optional GitHub Personal Access Token for authentication
- A custom HTTP client (ky) for making API requests
- Input validation using Zod schema
- Configurable issue limit parameter
- Automatic pagination handling

## Key Features

- Fetches open issues from any public GitHub repository
- Handles pagination automatically
- Returns structured data with issue details
- Includes metadata like issue numbers, titles, labels, and descriptions
- Configurable limit for number of issues to fetch
- Built-in error handling and validation
- Support for both authenticated and unauthenticated requests

## Authentication

The tool supports two authentication modes:
- Unauthenticated: Works with public repositories (60 requests/hour limit)
- Authenticated: Uses GitHub Personal Access Token (5,000 requests/hour limit)

## Input

The input should be a JSON object with a "repoUrl" field containing the GitHub repository URL (e.g., https://github.com/owner/repo).

## Output

The output is a structured JSON object containing:
- Repository information (name, URL, owner)
- Metadata (total issues, last updated date, limit)
- Array of issues with details (number, title, URL, labels, description)

## Example

```javascript
// Basic usage
const tool = new GithubIssues({
token: 'github_pat_...', // Optional: GitHub personal access token
limit: 20 // Optional: number of issues to fetch (default: 10)
});

const result = await tool._call({
repoUrl: 'https://github.com/owner/repo'
});
```

## Advanced Example with Error Handling

```javascript
const tool = new GithubIssues({
token: process.env.GITHUB_TOKEN,
limit: 50
});

try {
const result = await tool._call({
repoUrl: 'https://github.com/facebook/react'
});

// Access structured data
console.log('Repository:', result.repository.name);
console.log('Total Issues:', result.metadata.totalIssues);

// Process issues
result.issues.forEach(issue => {
console.log(`#${issue.number}: ${issue.title}`);
console.log(`Labels: ${issue.labels.join(', ')}`);
console.log(`URL: ${issue.url}\n`);
});
} catch (error) {
console.error('Error fetching GitHub issues:', error);
}
```

### Rate Limits

- Authenticated requests: 5,000 requests per hour
- Unauthenticated requests: 60 requests per hour

### Disclaimer

Ensure you have proper API credentials if needed and respect GitHub's API rate limits and terms of service. For private repositories, authentication is required.
97 changes: 97 additions & 0 deletions packages/tools/src/serper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Serper Tool

This tool integrates with Serper (https://serper.dev/), a Google Search API service that provides programmatic access to Google Search results. It enables various types of Google searches including web search, image search, news search, and more, making it ideal for AI applications that need real-time information from the web.

## Components

The tool uses the following components:

- A Serper API client instance
- An API Key for authentication
- A custom HTTP client (ky) for making API requests
- Input validation using Zod schema
- Search type configuration
- Optional search parameters

## Search Types

The tool supports multiple search types:
- "search" (default): For general search queries
- "images": For image search
- "videos": For video search
- "places": For location-based search
- "maps": For map search
- "news": For news search
- "shopping": For shopping search
- "scholar": For academic publications search
- "patents": For patents search
- "webpage": For scraping webpages (Beta)

## Key Features

- Multiple search types for different use cases
- Clean, structured JSON responses
- High-performance API with good uptime
- Webpage scraping capability (Beta)
- Customizable search parameters
- Error handling and validation

## Input

The input depends on the search type:
- For webpage scraping: A JSON object with a "url" field
- For all other search types: A JSON object with a "query" field

## Output

The output is a structured JSON response from Serper containing search results based on the search type and query.

## Example

```javascript
// Basic search
const tool = new Serper({
apiKey: 'your-api-key',
type: 'search' // Optional, defaults to 'search'
});

const result = await tool._call({
query: 'latest AI developments'
});

// Webpage scraping
const webScraperTool = new Serper({
apiKey: 'your-api-key',
type: 'webpage'
});

const scrapingResult = await webScraperTool._call({
url: 'https://example.com'
});
```

## Advanced Example with Custom Parameters

```javascript
const tool = new Serper({
apiKey: process.env.SERPER_API_KEY,
type: 'news',
params: {
num: 10, // Number of results
gl: 'us' // Geographic location
}
});

try {
const result = await tool._call({
query: 'artificial intelligence breakthroughs'
});
console.log(result);
} catch (error) {
console.error('Error processing Serper query:', error);
}
```

### Disclaimer

Ensure you have proper API credentials and respect Serper's usage terms and rate limits. The webpage scraping feature is in Beta and may be subject to changes.
Loading

0 comments on commit d52b3fa

Please sign in to comment.