RewindAI is a cutting-edge system designed to bring version control capabilities to conversational AI. Inspired by Git, it allows for deterministic replay, branching of conversation timelines, resuming from specific checkpoints, and comprehensive history inspection. This project provides both an interactive Command Line Interface (CLI) and a robust API for integrating AI conversations into other applications.
In the rapidly evolving field of AI, reproducibility and traceability are paramount. RewindAI addresses these challenges by offering:
- Deterministic Replay: Every AI response can be precisely reproduced, enabling thorough debugging and analysis.
- Conversation Branching: Explore alternative conversational paths by forking a thread from any past AI message.
- Checkpoint-based Resumption: Easily resume conversations from any saved checkpoint, providing flexibility and robust recovery.
- Transparent History: Inspect the full history of any conversation, understanding its evolution and the decisions made at each step.
- Interactive & Asynchronous Modes: Engage with the AI directly via a CLI or integrate it into your services using a powerful API with background workers.
RewindAI transforms AI conversations from ephemeral interactions into auditable, debuggable, and extensible timelines.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python 3.10+
- Docker and Docker Compose (for PostgreSQL database)
pip(Python package installer)
git clone https://github.com/your-username/rewindai.git
cd rewindaiCopy the example environment file and fill in your details, especially your GOOGLE_API_KEY (required for LLM interactions).
cp .env.example .env
# Open .env and add your GOOGLE_API_KEYRewindAI uses PostgreSQL for its event store and projection tables. Docker Compose provides an easy way to set this up.
docker-compose up -d postgresIt's recommended to use a virtual environment to manage project dependencies.
python3 -m venv my_venv
source my_venv/bin/activate
pip install -r requirements.txtThe project uses event sourcing, which requires specific tables for the event store and projections. Run the initialization scripts:
PYTHONPATH=. ./my_venv/bin/python3 scripts/postgres_init_event_store.py
PYTHONPATH=. ./my_venv/bin/python3 app/projections/worker.py # This will create projection tables on first runThe projection worker consumes events and builds the read models used by the API. This should run continuously in the background.
PYTHONPATH=. ./my_venv/bin/python3 app/projections/worker.py &The FastAPI server exposes the command and read endpoints.
PYTHONPATH=. ./my_venv/bin/uvicorn app.api.main:app --host 0.0.0.0 --port 8000 &The API documentation is available at http://localhost:8000/docs.
Engage with the AI directly via the interactive CLI.
PYTHONPATH=. ./my_venv/bin/python3 app/cli/repl.pyOnce the CLI is running, you can create new threads, send messages, inspect history, and fork conversations interactively.
(REWIND_AI) > new thread
# ... AI output ...
(REWIND_AI) > send "Hello there!"
# ... AI output ...
(REWIND_AI) > fork from 1
# ... AI creates a new branch ...
The API provides programmatic access to all core functionalities. Detailed API documentation, including request/response schemas and curl examples, is available in API.md.
We welcome contributions! If you're interested in improving RewindAI, please refer to our CONTRIBUTING.md for guidelines on setting up your development environment, submitting pull requests, and coding standards.
If you encounter any issues or have questions, please check:
- The API Documentation for endpoint details.
- Existing GitHub Issues for similar problems.
- Open a new GitHub Issue if you can't find a solution.
- [Devansh] - Initial development and core maintenance.
- GitHub: @indenigrate