Welcome to the Agent API repository! This project offers a minimal and open-source setup for serving agents using FastAPI and Postgres. Designed for speed, clarity, and developer happiness, it provides a robust foundation for building agent-based applications.
- FastAPI: Leverage the power of FastAPI for building APIs quickly and efficiently.
- Postgres: Utilize PostgreSQL for a reliable and scalable database solution.
- Minimal Setup: Get started with a straightforward configuration.
- Developer Friendly: Focus on developer happiness with clear documentation and a clean codebase.
To get started with the Agent API, follow these steps to set up your environment.
Before you begin, ensure you have the following installed:
- Python 3.7 or higher
- PostgreSQL
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/HackerGCLASS/agent-api.git cd agent-api
-
Install the required packages:
pip install -r requirements.txt
-
Set up the database:
Create a new PostgreSQL database and update the
DATABASE_URL
in the.env
file with your database credentials. -
Run the migrations:
Use the following command to set up the database schema:
alembic upgrade head
-
Start the server:
Run the FastAPI application with the command below:
uvicorn main:app --reload
Once your server is running, you can access the API at http://127.0.0.1:8000
. Use tools like Postman or curl to interact with the endpoints.
To create a new agent, send a POST request to /agents
with the following JSON body:
{
"name": "Agent Smith",
"type": "AI",
"status": "active"
}
You will receive a response like this:
{
"id": 1,
"name": "Agent Smith",
"type": "AI",
"status": "active"
}
For detailed API documentation, visit the interactive API docs provided by FastAPI at http://127.0.0.1:8000/docs
.
For the latest releases, visit our Releases section. You can download the latest version and execute it to start using the Agent API.
We welcome contributions to the Agent API! If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push to your fork and submit a pull request.
Please ensure your code follows the existing style and includes appropriate tests.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or feedback, feel free to reach out to the maintainers of this project. You can also join our community discussions on GitHub.
Thank you for checking out the Agent API! We hope you find it useful for your projects. Don't forget to check our Releases section for updates and new features. Happy coding!