
Build agents that pick tools like experts, secure by default
Import a single SDK to power your agents with semantic tool search, trainable contexts, and feedback-driven selection that gets smarter over time. Access tools from any provider through a unified API with configurable security policies and guardrails.
Documentation | API Reference | Getting Started | Join our Community
- β¨ Features
- π Getting Started
- π Supported Providers
- π Next Steps
- π€ Contributing
- π License
- Semantic Search: Find the right tools based on natural language descriptions and agent goals
- Context Training: Train custom tool contexts to improve selection accuracy for your specific use cases
- Feedback Learning: Selection gets smarter over time by learning from agent interactions and success patterns
- Adaptive Ranking: Tools are ranked based on historical performance and contextual relevance
- Multi-Provider Support: Connect to any supported provider through a single unified API
- Type-Safe Integration: Full TypeScript support with type definitions for all API operations
- Simple Authentication: Unified authentication handling across all providers
- Provider Agnostic: Write code once, switch providers anytime
- OpenAPI Integration
coming soon
: Register any OpenAPI server as a tool source automatically
- Guardrails & Access Control: Configure tool execution rules and approval flows - from automatic execution to human-in-the-loop oversight
- Audit Logging: Comprehensive logging of all tool selections and executions
- Network Security: Secure HTTPS connections with JWT and API key-based authentication schemes
-
Request Access
- Visit onegrep.dev to join the waitlist
- You'll receive an invite to the OneGrep sandbox environment
-
Install the CLI
# Install the OneGrep CLI
npx -y @onegrep/cli
# Create your account
npx @onegrep/cli account
# Select "Create Account" when prompted
The OneGrep sandbox comes pre-configured with:
- A collection of popular AI tools across different categories (chat, search, code analysis, etc.)
- Example tool contexts trained for common agent scenarios
- Pre-configured security policies and guardrails
- Sample agent implementations using different frameworks
Let's try out some common workflows using the CLI:
Find tools that match your agent's goals using natural language:
# Start the CLI tool explorer
npx @onegrep/cli tools
# Select "search" from the menu
# Enter your query when prompted:
"I want to be able to find recent issues in the MCP repository and what the web says about how to fix them"
# The CLI will return ranked tools matching your query
Try out tools directly from the CLI:
# Start the CLI tool explorer
npx @onegrep/cli tools
# Select "Explore integrations"
# Select "exa" from the list
# Enter your query when prompted:
"what are the recent developments in MCP"
# The tool will execute and return results
Improve tool selection by adding custom context:
# Start the CLI tool explorer
npx @onegrep/cli tools
# Select "Explore integrations"
# Select any tool
# Choose "Add property"
# Create a new property (e.g., "use_case")
# Add a value (e.g., "mcp monitoring")
# Now search again:
npx @onegrep/cli tools
# Select "search"
# Try a query related to your tag:
"I need to monitor MCP status"
# Your trained tool should appear at the top of the results
Once you have sandbox access, install the SDK:
# Install using PNPM
pnpm add @onegrep/sdk
Set up your environment:
# Get your API key from the CLI
npx @onegrep/cli account
# Select "Show authentication status"
# Your API key will be displayed
# Set the API key in your environment
export ONEGREP_API_KEY="your_sandbox_api_key"
# Set the URL to your onegrep deployment (or the public sandbox)
export ONEGREP_API_URL="https://test-sandbox.onegrep.dev"
Let's start with a complete example of running an agent that uses OneGrep for dynamic tool selection. This example uses LangChain for the agent loop and Blaxel for managing the agent runtime.
First, install the Just command runner:
brew install just
just install
just build
Then run the example agent:
# Terminal 1: Start the agent server
just bl-serve
# Terminal 2: Open a chat session with the agent
just bl-chat
This will start a local agent that:
- Uses OneGrep SDK for intelligent tool selection
- Implements a ReAct agent loop with LangChain
- Runs in a secure Blaxel runtime environment
OneGrep seamlessly integrates with LangChain, providing type-safe tool bindings:
import { getToolbox } from '@onegrep/sdk'
import { createLangchainToolbox } from '@onegrep/sdk/extensions/langchain'
// Initialize toolboxes
const toolbox = await getToolbox()
const langchainToolbox = await createLangchainToolbox(toolbox)
// Search for relevant tools based on your agent's goals
const searchResults = await toolbox.search(
'Find recent news about AI developments'
)
// Tools are already structured for LangChain
const tools = searchResults.map((result) => result.result)
// Use in your LangChain agent
const agent = await createReactAgent({
llm: new ChatOpenAI(),
tools: tools,
prompt: 'Use the most relevant tools to find and analyze AI news.'
})
// Tools are now available to your agent with proper typing and validation
const result = await agent.invoke({
input: "What's the latest news about LangChain?"
})
For more examples and detailed API documentation, check out our Documentation.
OneGrep integrates with the following tool providers:
The AI-first tool hosting platform with built-in security and scalability. Blaxel provides a wide range of pre-built tools and supports custom tool deployment.
A modern tool hosting platform focused on developer experience and enterprise features. Smithery offers extensive tool management capabilities and robust security controls.
Want to add support for your tool hosting platform? Please reach out to us at support@onegrep.dev or Create a Provider Support Request!
Ready to explore more advanced capabilities? Check out our API Reference to learn about:
- Advanced filtering and search options
- Custom tool context training
- Batch operations and error handling
- Security policy configuration
- And more!
We welcome contributions to the OneGrep TypeScript SDK! Here's how you can help:
# Fork the repository & clone it
git clone https://github.com/OneGrep/typescript-sdk.git
cd typescript-sdk
# Install dependencies & build
just install
just build
- Create an issue first to discuss the change
- Fork the repository
- Create a feature branch referencing the issue (
git checkout -b issue-123/amazing-feature
) - Make your changes
- Commit your changes (
git commit -m 'Add amazing feature'
) - Push to your branch (
git push origin issue-123/amazing-feature
) - Open a Pull Request with:
- Title:
[Issue-123] Add amazing feature
- Description: Include "Fixes #123" or "Resolves #123" to link the issue
- Title:
Have an idea for a new feature? Create a Feature Request using one of these types:
- General SDK Enhancement
- New Runtime Support
- New Provider Support
The template will guide you through providing:
- Feature type selection
- Use case description
- Proposed solution with example code
- Alternative approaches considered
Found a bug? Create a Bug Report with:
Required Information:
- Bug severity (Critical/Minor)
- Affected providers and runtimes
- Clear description and reproduction steps
- Code example
- Environment details
The template will guide you through providing all necessary information to help us resolve the issue quickly.
Error: Failed to authenticate with OneGrep API
- Ensure
ONEGREP_API_KEY
is set in your environment - Verify your API key is valid by running
npx @onegrep/cli account
- Check if your API URL is correct (
ONEGREP_API_URL
)
Error: Web search tool not found
- Confirm you have access to the required provider (Blaxel/Smithery)
- Check if the tool name matches exactly
- Try listing available tools:
await toolbox.listTools()
Error: Tool execution failed: Invalid input
- Verify input matches the tool's schema
- Check network connectivity to the tool provider
- Ensure you have necessary permissions
- Join our Community Slack
- Open an Issue
- Check our API Reference for detailed documentation