AlgoMate is a VS Code extension that enhances Algorand smart contract development with AI-powered assistance. It helps developers create, edit, and deploy smart contracts more efficiently on the Algorand blockchain. We are offering two versions of our extension :
- LLM based (ideal for small users since the call is made through API)
- SLM based (ideal for organizations wanting full privacy over model calls)
Refer to this presentation for a better understanding of the project : Canva Link Refer to this video for the live demo : Youtube Link
- Featured on the official Algorand website.
- Open-source project built for the Algorand developer ecosystem.
- Contributions, issues, and feature requests are welcome from the community.
- Purpose-based Templates: Generate contracts for various use cases:
- Escrow
- NFT (Non-Fungible Tokens)
- DAO (Decentralized Autonomous Organizations)
- DeFi (Decentralized Finance)
- Voting systems
- And more...
- Support for different Algorand contract types:
- Stateful contracts
- Stateless contracts
- Signature-based contracts
- AI-Powered Code Completion: Get intelligent code suggestions as you type
- Inline Documentation: Automatic generation of docstrings and documentation
- Code Improvement Suggestions: AI-powered code optimization recommendations
- No Hallucinations due to RAG
- Cosine Similarity to log down relevent examples from the community
- Can be modified to have LLM as a fallback for SLM
- Retry option with prompt and code passed as context
- Direct Deployment options
- Primary language: Python (PyTeal)
- Clean and readable code generation
- Node.js (v14+)
- VS Code (v1.70+)
- Python 3.8+
- Algorand Developer Tools (Goal, Sandbox, or TestNet access)
-
Clone the repository:
git clone https://github.com/yourusername/ByteBandits.git cd ByteBandits -
Install dependencies:
npm install
-
Set up Python dependencies:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -r requirements.txt
-
Set your Google API key in a
.envfile (if using LLM based):GEMINI_API_KEY=your_api_key_here
The RAG dataset is stored in one PostgreSQL table, instruction_documents.
It contains instruction, a 384-dimension instruction_embedding, code, and
metadata (JSONB). Source fields such as github_url, website_url,
file_path, repository name, or any other JSONL fields are retained in
metadata.
- Copy
.env.exampleto.envand set a local database password. - Build and start PostgreSQL with pgvector (the image is built locally from
PostgreSQL's official image for reliable Windows Docker Desktop support):
docker compose up -d
- Install the PostgreSQL importer dependencies, then import and embed the dataset:
pip install -r requirements-postgres.txt python data/load_embeddings_to_postgres.py --input data/samples.jsonl
Use a supported Python version for the selected packages. The legacy
requirements.txt includes older training dependencies and is not compatible
with Python 3.14; create the importer environment with Python 3.11 or 3.12 if
the latest sentence-transformers/PyTorch wheels are unavailable for your
machine.
The repository also exposes the PostgreSQL knowledge base to MCP-compatible
AI clients. The search_algorand_knowledge(query, top_k) tool combines
PostgreSQL full-text ranking with cosine similarity over the existing
pgvector embeddings, then returns the matching instruction, code, metadata,
and scores. The model or client uses those returned sources to produce its
answer; the MCP server does not call an LLM.
Install the MCP/RAG dependencies in the same Python environment used by the PostgreSQL database setup, and ensure the database is running and populated:
pip install -r requirements-mcp.txt
python mcp_server.pyThe server uses MCP stdio transport and the POSTGRES_* variables from .env.
Example client configuration (adjust the Python path to your environment):
{
"mcpServers": {
"algorand-knowledge": {
"command": "D:/path/to/ByteBandits/.venv-pg/Scripts/python.exe",
"args": ["D:/path/to/ByteBandits/mcp_server.py"]
}
}
}The first search downloads/loads all-MiniLM-L6-v2, the same model used during
ingestion. top_k must be between 1 and 20.
The loader is idempotent: importing the same instruction/code pair updates its embedding and metadata instead of duplicating it. To inspect the data:
docker compose exec postgres psql -U algomate -d algomate -c "SELECT id, instruction, metadata FROM instruction_documents LIMIT 5;"- Build and run the extension in VS Code:
- Press
F5to open a new VS Code window with the extension loaded - Or use the command palette:
Developer: Run Extension
- Press
-
Open the Algorand Contract Builder panel using the command palette (
Ctrl+Shift+PorCmd+Shift+P):Open Algorand Contract Panel -
Configure your contract:
- Select the contract purpose
- Choose the contract type
- Select the programming language
- Enter any specific requirements
-
Generate and deploy your contract with a single click
- Get context-aware suggestions by typing
.after an object - AI-powered method and property recommendations
- Automatic docstring generation for smart contracts
- Real-time documentation as you code
- Get suggestions for optimizing your smart contract code
- Security best practices for Algorand development
ByteBandits/
├── src/ # TypeScript source code
├── media/ # Extension assets
├── data/ # Sample contracts and templates
├── .vscode/ # VS Code configuration
├── .venv/ # Python virtual environment
├── .gitignore
├── package.json # Extension manifest
├── requirements.txt # Python dependencies
└── README.md
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with VS Code Extension API
- Powered by Google's Generative AI and Salesforce's Codegen Model
- Part of the Algorand Developer Ecosystem
Made with ❤️ for organizaton specific AI assistance