Skip to content

w3hc/diyab

Repository files navigation

Rukh

A lightweight, developer-friendly toolkit for building AI agents with Web3 integration. Built with Nest.js (TypeScript), Rukh makes it easy to create, deploy, and scale AI applications with:

  • 🚀 Quick setup and minimal configuration
  • 🔄 Built-in session management and persistent storage
  • 🔗 Seamless Web3 integration with Mantle Network
  • 🛠️ Modular architecture for easy LLM integration (Mistral, Anthropic, OpenAI, etc.)
  • 📝 Auto-generated OpenAPI documentation
  • 🎮 Token-gated access control built-in
  • ⚡ Production-ready with rate limiting and error handling

Live at: http://rukh.w3hc.org/api

Solidity contracts:

Features

  • Nest.js v11 (TypeScript-based API framework)
  • Ethers v6
  • OpenAPI/Swagger docs
  • JSON-based persistent storage
  • LangChain.js
  • Mistral ministral-3b-2410

Any other LLM service can be added (Anthropic, OpenAI, DeepSeek, or any).

Install

pnpm i

Create and edit your .env file on the model of .env.template. You can also deploy your own token contract.

Run

# development
pnpm start

# watch mode
pnpm start:dev

# production mode
pnpm start:prod

The Swagger UI should be available at http://localhost:3000/api

Test

# unit tests
pnpm test

# e2e tests
pnpm test:e2e

# test coverage
pnpm test:cov

Example requests

{
  "message": "What is Rukh?"
}

or

{
  "message": "What is Rukh?",
  "model": "mistral",
  "sessionId": "f0ea9dc7-03e8-46a7-b3ad-6c3531211f73",
  "walletAddress": "0x265E31444C6E279870eB20c15B0547373635840b"
}

Will return:

{
  "output": "Rukh is a powerful bird.",
  "model": "ministral-3b-2410",
  "network": "mantle-sepolia",
  "txHash": "0xd96b35d1daefd6dc8368f7a075a1a627df960a541eb30268b1b85cedbae0214a",
  "explorerLink": "https://explorer.sepolia.mantle.xyz/tx/0xd96b35d1daefd6dc8368f7a075a1a627df960a541eb30268b1b85cedbae0214a",
  "sessionId": "bdce1931-b09d-49ef-954b-d20074d11ffa"
}

Curl

curl -X 'POST' \
  'http://localhost:3000/ask' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "message": "What is Rukh?"
}'

Support

Feel free to reach out to Julien through:

Releases

No releases published

Packages

No packages published