Team Ai
Apppublic

amer003100/RAG_PostgreSQL

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Overview

This Space hosts a simple RAG API powered by FastAPI, vecs (Postgres/Timescale), and an LLM provider.

Environment

Copy the template and fill in your secrets:

bash
cp app/example.env app/.env

Required keys:

  • —OPENAI_API_KEY
  • —TIMESCALE_SERVICE_URL

Run locally (Docker)

bash
docker build -t rag-space .
docker run --rm -p 7860:7860 --env-file app/.env rag-space

Then open: http://localhost:7860

Run locally (no Docker)

Python 3.12 is required.

Using uv:

bash
uv venv
uv sync
uv run uvicorn app.api:app --host 0.0.0.0 --port 7860

Or using pip:

bash
python -m venv .venv
. .venv/bin/activate
pip install -e .
uvicorn app.api:app --host 0.0.0.0 --port 7860

API

POST /api/chat

Payload example:

json
{
  "question": "ما هي طرق التوصيل؟",
  "provider": "openai",
  "filters": { "category": { "$eq": "الشحن" } }
}