Skip to content

mateonunez/ait

Repository files navigation

AIt

Ask DeepWiki CI License: MIT Node.js pnpm

Hey there! I'm AIt (acts like "alt" /ɔːlt/, but also pronounced as "eight" /eΙͺt/). It depends.

AIt is a comprehensive platform for interacting with your own data with multiple sources compatible (GitHub, Linear, Spotify, Notion, X, Google, and more soon). AIt brings you AI-capabilities to your own ecosystem.

Quick Start

# 1. Clone and install
git clone https://github.com/mateonunez/ait.git
cd ait
corepack enable
pnpm install

# 2. Start services (PostgreSQL, Qdrant, Ollama, Redis)
pnpm start:services

# 3. Configure environment variables
cp .env.example .env
# Edit .env with your OAuth credentials (see Configuration section)

# 4. Initialize database
pnpm migrate

# 5. Install Ollama models (required for AI features)
docker exec -it ait_ollama ollama pull gemma3:latest # gpt-oss:20b-cloud
docker exec -it ait_ollama ollama pull mxbai-embed-large:latest

# 6. Start development servers
pnpm dev

Architecture

AIt follows a modular monorepo architecture with clear separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                   UIt                                       β”‚
β”‚                          (Web Interface - React)                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                               GATEWAY                                       β”‚
β”‚                    (Unified API + OAuth 2.0 Flows)                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                         β”‚                             β”‚
        β–Ό                         β–Ό                             β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  CONNECTORS     β”‚       β”‚    AI SDK       β”‚           β”‚    SCHEDULER    β”‚
β”‚ GitHub,Linear   β”‚       β”‚ RAG, Generation β”‚           β”‚ BullMQ + Redis  β”‚
β”‚ Spotify, X, etc β”‚       β”‚ Tool Calling    β”‚           β”‚ ETL Jobs        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                          β”‚                             β”‚
        β–Ό                          β–Ό                             β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         INFRASTRUCTURE LAYER                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   PostgreSQL    β”‚     Qdrant      β”‚     Ollama      β”‚        Redis          β”‚
β”‚ (Structured DB) β”‚ (Vector Store)  β”‚  (Local LLM)    β”‚    (Job Queue)        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow:

OAuth Auth β†’ Connector β†’ PostgreSQL β†’ ETL/Scheduler β†’ Embeddings β†’ Qdrant β†’ RAG β†’ Response

Package Overview

Package Path Description
Core packages/core Shared utilities, types, errors, HTTP client
Connectors packages/connectors OAuth 2.0 integrations (GitHub, Linear, Spotify, X)
Gateway packages/gateway Unified API gateway for all connectors
AI SDK packages/infrastructure/ai-sdk RAG, text generation, embeddings with Ollama
Scheduler packages/infrastructure/scheduler Automated ETL job scheduling with BullMQ
RetoVe packages/transformers/retove ETL pipeline for vector embeddings
UIt packages/uit Web interface (React + Vite)

Key Features

  • Multi-source Connectors: GitHub, Linear, Spotify, X, Notion, Slack and more with OAuth 2.0
  • Vector Search: Qdrant-based semantic search with embeddings
  • Local LLM: Ollama integration for text generation and embeddings
  • Automated ETL: Scheduled data synchronization with configurable priorities
  • RAG Pipeline: Multi-collection retrieval-augmented generation
  • Tool Calling: AI agents can query your connected services
  • Type-safe: OpenAPI-generated TypeScript interfaces
  • Observability: Langfuse integration for LLM monitoring

Configuration

Copy the example environment file and configure your credentials:

cp .env.example .env

Required Environment Variables

# Database
POSTGRES_URL=postgresql://root:toor@localhost:5432/ait

# Redis (for job queue)
REDIS_URL=redis://:myredissecret@localhost:6379

# Ollama (for AI features)
OLLAMA_BASE_URL=http://localhost:11434

# Qdrant (for vector search)
QDRANT_URL=http://localhost:6333

# OAuth Credentials (at least one connector)
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_secret

SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_secret

LINEAR_CLIENT_ID=your_linear_client_id
LINEAR_CLIENT_SECRET=your_linear_secret

X_CLIENT_ID=your_x_client_id
X_CLIENT_SECRET=your_x_secret

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

See individual package READMEs and .env.example for all available options.

Development

Testing

pnpm test         # Runs tests with isolated Docker services
pnpm test:watch   # Watch mode for development

Code Generation

pnpm generate:openapi                              # Generate OpenAPI types
cd packages/infrastructure/postgres && pnpm db:generate  # Generate DB types

Database Management

pnpm migrate      # Run migrations
pnpm db:studio    # Open database UI (from postgres package)

Linting

pnpm lint      # Check code with Biome
pnpm lint:fix  # Auto-fix issues

Service Management

pnpm start:services       # Start all Docker services
pnpm stop:services        # Stop all services
pnpm start:services:test  # Start all Docker services for testing
pnpm stop:services:test   # Stop all services for testing
pnpm clean:services       # Stop and remove volumes
pnpm clean:all            # Full cleanup (node_modules, dist, services)

Package Documentation

Package Description
Core Shared utilities and types
Gateway API gateway and OAuth authentication
Connectors Platform integrations framework
AI SDK RAG and text generation
Scheduler ETL job scheduling
ETL Pipeline Data transformation
PostgreSQL Database client
Qdrant Vector database
Ollama LLM service setup
Redis Job queue and caching
UIt Web interface

Troubleshooting

Services won't start

# Check Docker is running
docker info

# Check for port conflicts
lsof -i :5432  # PostgreSQL
lsof -i :6333  # Qdrant
lsof -i :11434 # Ollama
lsof -i :6379  # Redis

# Reset everything and start fresh
pnpm clean:all
pnpm install
pnpm start:services

Database connection errors

# Verify PostgreSQL is healthy
docker exec ait_postgres pg_isready -U root -d ait

# Check connection URL matches docker-compose
echo $POSTGRES_URL  # Should be: postgresql://root:toor@localhost:5432/ait

# Re-run migrations
pnpm migrate

Ollama model not found

# List installed models
docker exec ait_ollama ollama list

# Pull required models
docker exec -it ait_ollama ollama pull gemma3:latest 
docker exec -it ait_ollama ollama pull mxbai-embed-large:latest

OAuth callback errors

# Ensure HTTPS is configured for OAuth providers that require it
cd packages/gateway
npm run cert:generate
npm run cert:trust  # macOS only

# Set USE_HTTPS=true in your .env

Out of memory with Ollama

# Use smaller models
docker exec -it ait_ollama ollama pull gemma3:1b  # Smaller variant

# Or increase Docker memory limits in Docker Desktop settings

OpenAPI types missing

# Regenerate types
pnpm generate:openapi

Contributing

See CONTRIBUTING.md for development guidelines and how to submit pull requests.

License

MIT

About

Your data. Your AI. One Platform.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Languages