commit 3ef303395ff94e73d43ad90bdd88db6c5541bb18 Author: serhiimosiiash Date: Fri Dec 19 10:44:46 2025 +0200 Initial commit: Antigravity Agent Core diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dae317f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.9-slim + +WORKDIR /app + +# Встановлюємо бібліотеки для Postgres +RUN apt-get update && apt-get install -y libpq-dev gcc && rm -rf /var/lib/apt/lists/* + +# Залежності +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Код +COPY . . + +CMD ["python", "main.py"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py new file mode 100644 index 0000000..c035037 --- /dev/null +++ b/main.py @@ -0,0 +1,39 @@ +import os +import time +import psycopg2 +import requests + +# Налаштування (беруться з Environment Variables) +DB_HOST = os.getenv("DB_HOST", "postgres") +DB_USER = os.getenv("DB_USER", "postgres") +DB_PASS = os.getenv("DB_PASS", "password") +GRAPHITI_URL = os.getenv("GRAPHITI_URL", "http://graphiti:8000") + +def check_connections(): + print("🕵️ Antigravity Agent: Starting Diagnostics...") + + # 1. Перевірка Graphiti (Пам'ять) + try: + r = requests.get(f"{GRAPHITI_URL}/health", timeout=3) + if r.status_code == 200: + print(f"✅ Graphiti Memory is ONLINE at {GRAPHITI_URL}") + else: + print(f"⚠️ Graphiti returned status {r.status_code}") + except Exception as e: + print(f"❌ Graphiti Connection Failed: {e}") + + # 2. Перевірка Postgres (База Знань) + try: + conn = psycopg2.connect( + host=DB_HOST, user=DB_USER, password=DB_PASS, dbname="postgres" + ) + print("✅ Postgres Database is CONNECTED") + conn.close() + except Exception as e: + print(f"❌ Postgres Connection Failed: {e}") + +if __name__ == "__main__": + while True: + check_connections() + print("💤 Sleeping for 60 seconds...") + time.sleep(60) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..fb330d7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +psycopg2-binary +requests \ No newline at end of file