The one-stop decentralized AI chatbot for the Near Protocol ecosystem
This project aims to provide a one-stop AI chatbot to discover the Near ecosystem 🚀
It features an AI agent using an open-source model running on the Aleph.im decentralized cloud, and a basic frontend to simplify interactions with it.
The agent has access to several functions to serve requests about Near as best as possible:
❓ It's always better with examples, so here are some questions that this AI is able to handle:
hash
and it was send by someone.testnet.For the AI part, the current model used is Nous Hermes 2 Pro - Llama 3 8B, deployed on the Aleph.im network. This means that in runs in serverless VMs on a random node of the network, without logs. The idea is to leverage their confidential VM feature coming this fall (that allows the creation of a secure VM on the host with encrypted hardware like the RAM, storage etc) to guarantee privacy of all the chats.
This model is pretty good for this use case (function calls and JSON data handling), but combining it with a model with greater context like Phi 3 could be a future improvement. The model deployed on Aleph is then called from our Python code, where it's wrapped in a basic framework with LangChain to give it access to agentic functions mentioned in the description above. Those functions use different APIs and external packages, like oxylabs.io (for the search engine calls), near-faucet.io and a custom fork of py-near (to fix some issues with the original version). I'm also doing some recursion on the generated data and validation with Pydantic to limit hallucinations.
A simple socket.io server is exposed from the Python code, with which we can interact from the frontend (React TS project with Vite), which is a basic chat app.