Skip to content

A FastAPI-powered application that transforms complex data queries into clear explanations using generative AI.

License

Notifications You must be signed in to change notification settings

gabrieldylan-1/data_explainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Data Explainer API

This project is a FastAPI-powered RESTful API designed to fetch, cache, and explain data results in plain language. It connects to a MySQL database, utilizes Redis for caching, and integrates Grok AI for generative AI interactions.

The API provides tools to analyze crime statistics using sample data extracted from the Crime Data from 2020 to Present. This dataset offers insights into crime trends and patterns, making it easier to generate meaningful interpretations and explanations with the help of Grok AI integration.

Features

  • FastAPI Framework for scalable and modern Python API development.
  • MySQL Database for data storage and querying.
  • Redis Cache Layer to enhance performance by reducing database load.
  • Generative AI Integration powered by Grok AI, enabling natural language explanations.
  • Dockerized Environment for seamless deployment and consistency across systems.

Prerequisites

  • Docker and Docker Compose installed.
  • A valid Grok AI API Key. Sign up for one at Grok AI Documentation.

Getting Started

Clone the Repository

git clone https://github.com/your-username/data-explainer-api.git
cd data-explainer-api

Create a .env File

Create a .env file in the root directory with the following contents:

MYSQL_HOST=mysql
MYSQL_PORT=3306
MYSQL_DATABASE=data_explainer_db
MYSQL_USER=default_user
MYSQL_PASSWORD=default_password
XAI_API_KEY=REPLACE_WITH_YOUR_API_KEY_HERE

Build and Start the Application

Run the following command to build and start the containers:

docker-compose up --build

In case you want to end the containers:

docker-compose down -v

The API will be available at: http://localhost:8000.


API Endpoints

Example Endpoints

For the complete list of endpoints and detailed documentation, visit the Swagger UI at http://localhost:8000/docs.

Architecture

  • Backend: FastAPI
  • Database: MySQL
  • Cache Layer: Redis
  • Generative AI: Grok AI
  • Containerization: Docker and Docker Compose

License

This project is licensed under the MIT License. See the LICENSE file for details.


About

A FastAPI-powered application that transforms complex data queries into clear explanations using generative AI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published