Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

Repository files navigation

Blaxel OneGrep Semantic Tool Search Agent

Blaxel

License: MIT Node.js 18+ TypeScript LangGraph OneGrep

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.

📑 Table of Contents

✨ Features

  • 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

🚀 Quick Start

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

📋 Prerequisites

  • 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

💻 Installation

Clone the repository and install dependencies:

git clone https://github.com/blaxel-ai/template-onegrep.git
cd template-onegrep
pnpm install

Set up OneGrep account and CLI:

npx -y @onegrep/cli account

Follow the prompts to authenticate with your OneGrep account.

Set up environment variables:

cp .env-sample .env

Edit 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 build

This command should complete without errors, confirming that TypeScript compilation and all dependencies are properly configured.

🔧 Usage

Running Locally

Start the development server with hot reloading:

bl serve --hotreload

For production build and run:

bl serve

Note: The development server automatically restarts when you make changes to the source code and runs on the configured port.

Testing

You can test your OneGrep semantic tool search agent locally:

# Using the Blaxel CLI chat interface
bl chat --local blaxel-agent

Example 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

Deployment

When you are ready to deploy your agent:

bl deploy

This command uses your code and the configuration files under the .blaxel directory to deploy your OneGrep semantic tool search agent on the Blaxel platform.

📁 Project Structure

  • 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

❓ Troubleshooting

Common Issues

  1. 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
  2. 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
  3. 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
  4. 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
  5. TypeScript and Build Issues:

    • Make sure you have Node.js 18+
    • Try pnpm install to 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.

👥 Contributing

Contributions are welcome! Here's how you can contribute:

  1. Fork the repository
  2. Create a feature branch:
    git checkout -b feature/amazing-feature
  3. Commit your changes:
    git commit -m 'Add amazing feature'
  4. Push to the branch:
    git push origin feature/amazing-feature
  5. Submit a Pull Request

Please make sure to update tests as appropriate and follow the TypeScript code style of the project.

🆘 Support

If you need help with this template:

📄 License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

A template implementation of a conversational agent using onegrep and GPT-4. This agent demonstrates the power of OneGrep for building interactive AI agents and give then superpowers with better tools.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages