This tutorial will walk you through how to use OneGrep to power your agents with semantic tool search, trainable contexts, and feedback-driven selection that gets smarter over time. Access your MCP servers hosted on Blaxel with configurable security policies and guardrails.

This tutorial is based on a TypeScript LangGraph agent.

Prerequisites

  • Node.js: v18 or later.
  • OneGrep: Install OneGrep CLI and login to your account:
npx -y @onegrep/cli account
  • Blaxel CLI: Ensure you have Blaxel CLI installed.
  • Login to Blaxel:
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 i
  • Environment Variables: Create a .env file with your configuration. You can begin by copying the sample file:
cp .env-sample .env

Then, update the following values with your own credentials:

Running the server locally

Start the development server with hot reloading:

bl serve --hotreload
This command starts the server and enables hot reload so that changes to the source code are automatically reflected.

Testing your agent

You can test your agent using the chat interface:

bl chat --local blaxel-agent

Or run it directly with specific input:

bl run agent blaxel-agent --local --data '{"input": "What is the weather in Paris?"}'

Deploying to Blaxel

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 application.