Table of Contents
This project provides a FastAPI-based API for managing and interacting with Tangled Program Graph (TPG) experiments. It allows users to evolve TPG agents within specified environments and replay existing experiments using a given seed. The API also includes WebSocket endpoints for real-time communication and signaling between clients.
- Evolve Experiments: Initiate TPG evolution within a specified environment. The API returns the seed and PID of the new experiment.
- Replay Experiments: Replay a TPG experiment using a specific environment and seed.
- WebSocket Signaling: Establish real-time communication channels between clients for signaling purposes. This is particularly useful for interactive experiments or demonstrations.
- CORS Support: Configured to allow requests from
http://localhost:8080andhttp://127.0.0.1:8080, enabling local development and testing.
- FastAPI - A modern, fast (high-performance), web framework for building APIs with Python 3.7+
- uvicorn - ASGI server for running the FastAPI application.
- pydantic - Data validation and settings management using Python type annotations.
- uv - Fast Python package installer and resolver.
To get a local copy up and running, follow these steps.
- Python 3.12 or higher
- Clone the repository
git clone https://github.com/tangledprogramgraphs/api.git- Navigate to the project directory
cd api- Install the dependencies using
uv.
uv sync- Running the API
uv run fastapi dev