An intelligent conversational agent that leverages OneGrep's semantic tool search capabilities to dynamically discover and execute tools based on user queries. This template demonstrates advanced tool selection and autonomous action execution, even with large tool sets. Built with LangGraph and TypeScript for robust performance and seamless integration with the Blaxel platform.
- ✨ Features
- 🚀 Quick Start
- 📋 Prerequisites
- 💻 Installation
- 🔧 Usage
- 📁 Project Structure
- ❓ Troubleshooting
- 👥 Contributing
- 🆘 Support
- 📄 License
- Semantic tool search and selection powered by OneGrep
- Dynamic tool discovery for autonomous action execution
- Interactive conversational interface with intelligent tool routing
- ReAct agent pattern with LangGraph integration
- Streaming responses for real-time interaction
- Scalable tool management for large tool sets
- TypeScript implementation with robust type safety
- Serverless agent deployment as an endpoint
- Easy deployment and integration with Blaxel platform
For those who want to get up and running quickly:
# Clone the repository
git clone https://github.com/blaxel-ai/template-onegrep.git
# Navigate to the project directory
cd template-onegrep
# Install dependencies
pnpm install
# Set up OneGrep account
npx -y @onegrep/cli account
# Set up environment variables
cp .env-sample .env
# Edit .env with your OneGrep credentials
# Start the development server
bl serve --hotreload
# In another terminal, test the agent
bl chat --local blaxel-agent- Node.js: 18.0 or later
- PNPM: Fast, disk space efficient package manager
- OneGrep Account: Active OneGrep account with API access
- OneGrep CLI: Install and configure OneGrep CLI:
npx -y @onegrep/cli account
- Blaxel Platform Setup: Complete Blaxel setup by following the quickstart guide
- Blaxel CLI: Ensure you have the Blaxel CLI installed. If not, install it globally:
curl -fsSL https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh | BINDIR=/usr/local/bin sudo -E sh - Blaxel login: Login to Blaxel platform
bl login YOUR-WORKSPACE
- Blaxel CLI: Ensure you have the Blaxel CLI installed. If not, install it globally:
Clone the repository and install dependencies:
git clone https://github.com/blaxel-ai/template-onegrep.git
cd template-onegrep
pnpm installSet up OneGrep account and CLI:
npx -y @onegrep/cli accountFollow the prompts to authenticate with your OneGrep account.
Set up environment variables:
cp .env-sample .envEdit the .env file with your OneGrep credentials:
ONEGREP_API_KEY=<your-onegrep-api-key>
ONEGREP_API_URL=<your-onegrep-api-url>Verify installation:
pnpm run buildThis command should complete without errors, confirming that TypeScript compilation and all dependencies are properly configured.
Start the development server with hot reloading:
bl serve --hotreloadFor production build and run:
bl serveNote: The development server automatically restarts when you make changes to the source code and runs on the configured port.
You can test your OneGrep semantic tool search agent locally:
# Using the Blaxel CLI chat interface
bl chat --local blaxel-agentExample queries you can test:
What is the weather in Paris?
Find me some tools for data analysis
I need to process a CSV file
Help me with email automation
You can also run it directly with specific input:
bl run agent blaxel-agent --local --data '{"input": "What is the weather in Paris?"}'Expected Behavior:
- The agent uses OneGrep to semantically search for relevant tools
- Automatically selects and executes the most appropriate tool
- Provides streaming responses with tool execution results
- Handles multiple tool interactions intelligently
When you are ready to deploy your agent:
bl deployThis command uses your code and the configuration files under the .blaxel directory to deploy your OneGrep semantic tool search agent on the Blaxel platform.
- src/index.ts - Main application entry point and Fastify server setup
- src/agent.ts - Core agent implementation with OneGrep and LangGraph integration
- blaxel.toml - Blaxel deployment configuration with OneGrep environment variables
- package.json - PNPM package configuration with scripts and dependencies
- tsconfig.json - TypeScript compiler configuration with ES modules
- .env-sample - Template for required OneGrep environment variables
- .blaxel/ - Blaxel configuration files for functions and models
- LICENSE - MIT license file
-
Blaxel Platform Issues:
- Ensure you're logged in to your workspace:
bl login MY-WORKSPACE - Verify models are available:
bl get models - Check that functions exist:
bl get functions
- Ensure you're logged in to your workspace:
-
OneGrep API Connection Issues:
- Verify your OneGrep API key is valid and properly configured
- Check that your OneGrep API URL is correct and accessible
- Ensure your OneGrep account has proper permissions for tool access
- Verify network connectivity to OneGrep servers
- Test OneGrep CLI authentication:
npx -y @onegrep/cli account
-
Tool Search and Execution Issues:
- Verify OneGrep toolbox initialization is successful
- Check tool search results are being returned properly
- Ensure tools are being converted to LangChain format correctly
- Verify tool execution permissions and parameters
-
LangGraph Integration Issues:
- Check that the ReAct agent is properly configured
- Verify streaming responses are working correctly
- Ensure message handling is functioning properly
- Check for LangGraph version compatibility issues
-
TypeScript and Build Issues:
- Make sure you have Node.js 18+
- Try
pnpm installto reinstall dependencies - Check for TypeScript compilation errors with
pnpm run build - Verify ES modules configuration in package.json and tsconfig.json
- Ensure all type definitions are properly installed
For more help, please submit an issue on GitHub.
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature
- Submit a Pull Request
Please make sure to update tests as appropriate and follow the TypeScript code style of the project.
If you need help with this template:
- Submit an issue for bug reports or feature requests
- Visit the Blaxel Documentation for platform guidance
- Check the OneGrep Documentation for semantic search integration
- Review the LangGraph Documentation for framework-specific help
- Join our Discord Community for real-time assistance
This project is licensed under the MIT License. See the LICENSE file for more details.
