An Experiment to Replace backend code with Large Language Model and Agents for dynamic backend functionality with automatic infrastructure maintenance.
BackendAgent is an advanced AI tool to Replace your backend Code with the Large Language Model. It can Design backend infrasturtcures like Database, Message Queues, etc. BackendAgent can orchestrate and interact with these infractures in real time raplacing the need of backend code.
Important
This project is currently in a very early development/experimental stage. There are a lot of unimplemented/broken features at the moment. Contributions are welcome to help out with the progress!
Edited.BackendAgent.mp4
BackendAgent Now supports
- Groq
- OpenAI GPT Models
- Ollama Models
- Claud Models
In the Big Picture, Backend agent has a very simple Architecture. Request from the Frontend is sent to the common API route which is then handed to an Agent. Request is sent to the LLM to Analyze and give the codes that needs to be run on database (or any other backend infra). Agent runs the code and again sends the response back to LLM so that it can format and reafractor the output to send it back to Frontend.
![Screenshot 2024-04-19 at 11 28 30 PM](https://private-user-images.githubusercontent.com/32903192/324162815-6c251412-9d8a-4544-8927-7dde873acf1d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4Mzc1NTksIm5iZiI6MTcyMzgzNzI1OSwicGF0aCI6Ii8zMjkwMzE5Mi8zMjQxNjI4MTUtNmMyNTE0MTItOWQ4YS00NTQ0LTg5MjctN2RkZTg3M2FjZjFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE2VDE5NDA1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIwNjhjMzJmYjljOWNmYTdiNTE5YjUyZWZjYmMzZjlhMzhlMTMyYWM3ZjIwZTcwZWVmYzlkYTk5OWMzMTBmMmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.4dFkUFHtGEmdM0i-wWKEXheb-bX0F_FQtdnw22s0r4w)
Initially while starting, admin can design the backend infrastructure like database tables, Schema, etc using LLM interface whics is then implemented automatically by agent.
Version's requirements
- Python >= 3.9 and < 3.12
- sqlite3
To install BackendAgent, follow these steps:
- Clone the repository:
git clone https://github.com/nithinkash/BackendAgent.git
- Navigate to the project directory:
cd BackendAgent
- Create a virtual environment and install the required dependencies (you can use any virtual environment manager):
uv venv # On macOS and Linux. source .venv/bin/activate # On Windows. .venv\Scripts\activate uv pip install -r requirements.txt
- For ollama ollama setup guide (optinal: if you don't want to use the local models then you can skip this step)
- For API models, configure the API keys via config.toml
- Don't forget to set any of these following Base Models
- gpt-3.5-turbo
- gpt-4-0125-preview
- claude-3-haiku-20240307
- claude-3-sonnet-20240229
- claude-3-opus-20240229
> #For Oolama Models please specify installed models in your system, to check the list of installed models use command
> ollama list
- Start the server:
python BackendAgent.py
To start using BackendAgent, follow these steps:
- First Time starting a server LLM interface Automatically opens up.
- User can chat with LLM to design Backend Infra (Database for now) and API's.
- As of now this only supports sqlite3 Database.
- After Designing the DB, Agent automatically implements them and create required database and tables.
- Server is started after this inital setup which will be ready for receiving requests.
when you first time run BackendAgent, it will create a config.toml
file for you in the root directory:
-
API KEYS
OPENAI
: Your OpenAI API key for accessing GPT models.GEMINI
: Your Gemini API key for accessing Gemini models.CLAUDE
: Your Anthropic API key for accessing Claude models.MISTRAL
: Your Mistral API key for accessing Mistral models.GROQ
: Your Groq API key for accessing Groq models.
-
API ENDPOINTS
OLLAMA
: The Ollama API endpoint for accessing Local LLMs.OPENAI
: The OpenAI API endpoint for accessing OpenAI models.
Make sure to keep your API keys secure and do not share them publicly