Metadata-Version: 2.4
Name: seer-tool-hub
Version: 0.0.3
Summary: A Hub & Spoke tool selection engine for AI agents with Pinecone vector store
Author-email: Akshay Sharma <akshay@getseer.dev>
Project-URL: Homepage, https://github.com/seer-engg/tool-hub
Project-URL: Documentation, https://github.com/seer-engg/tool-hub#readme
Project-URL: Repository, https://github.com/seer-engg/tool-hub
Project-URL: Issues, https://github.com/seer-engg/tool-hub/issues
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: openai>=2.8.1
Requires-Dist: pydantic>=2.12.4
Requires-Dist: python-dotenv>=1.2.1
Requires-Dist: tqdm>=4.0.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: python-dotenv; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: composio==0.9.4; extra == "dev"
Requires-Dist: composio-langchain==0.9.4; extra == "dev"
Requires-Dist: pinecone<8.0.0; extra == "dev"
Requires-Dist: langchain-pinecone>=0.2.13; extra == "dev"
Requires-Dist: setuptools-scm>=8; extra == "dev"

# Tool Hub 🎯

A "Hub & Spoke" tool selection engine for AI agents. Combines semantic search with graph-based expansion to intelligently select tools—including dependencies you didn't know you needed.

## Features

- **🧠 Smart Ingestion**: Enriches tools with LLM-generated metadata (use cases, dependencies, neighbors)
- **🔍 Hybrid Retrieval**: Vector search (Hub) + graph expansion (Spoke) for complete toolkits
- **☁️ Pinecone Backend**: Cloud-native vector store with namespace isolation for integrations
- **⚡ Async-First**: Fully async API for high-performance tool queries

## Installation

```bash
pip install -e .
pip install -e ".[dev]"  # For development dependencies
```

## Quick Start

```python
import os
from tool_hub import ToolHub

# Initialize ToolHub
hub = ToolHub(
    openai_api_key=os.getenv("OPENAI_API_KEY"),
    pinecone_index_name=os.getenv("PINECONE_INDEX_NAME"),
    pinecone_api_key=os.getenv("PINECONE_API_KEY")
)

# Ingest tools (one-time, per integration)
await hub.ingest(
    tools=tools,  # List of OpenAI-format tools
    integration_name="github",  # Namespace for this integration
    max_workers=10
)

# Query tools
results = await hub.query(
    query="list GitHub repositories",
    integration_name=["github"],  # Optional: filter by integration(s)
    top_k=5
)
```

## API Reference

**Initialization:**
```python
ToolHub(
    openai_api_key: str,           # Required
    pinecone_index_name: str,      # Required
    pinecone_api_key: str,         # Required
    llm_model: str = "gpt-5-mini",
    embedding_model: str = "text-embedding-3-small",
    embedding_dimensions: Optional[int] = None
)
```

**Methods:**

- `async ingest(tools, integration_name, max_workers=10)` - Enrich and index tools to Pinecone
- `async query(query, integration_name=None, top_k=3)` - Query tools using semantic search

## Examples

See `examples/precompute_pinecone_index.py` for complete Pinecone indexing example.

## Environment Variables

```bash
OPENAI_API_KEY=your_key
PINECONE_API_KEY=your_key
PINECONE_INDEX_NAME=your_index
```
