An open API service indexing awesome lists of open source software.

https://github.com/qompassai/psql

Qompass AI psql
https://github.com/qompassai/psql

Last synced: 17 days ago
JSON representation

Qompass AI psql

Awesome Lists containing this project

README

          

PostgreSQL

Qompass AI on PostGres

![Repository Views](https://komarev.com/ghpvc/?username=qompassai-psql)
![GitHub all releases](https://img.shields.io/github/downloads/qompassai/psql/total?style=flat-square)

PostgreSQL




PostgreSQL Documentation


PostgreSQL Tutorials



License: AGPL v3
License: Q-CDA


â–ļī¸ Qompass AI Quick Start

```bash
bash <(curl -L https://raw.githubusercontent.com/qompassai/psql/main/scripts/quickstart.sh) ```





📄 We advise you read the script BEFORE running it 😉

#!/usr/bin/env bash
# /qompassai/psql/scripts/quickstart.sh
# Qompass AI PostgreSQL (Cross-Platform) Quick Start
# Copyright (C) 2025 Qompass AI
####################################################

set -euo pipefail

PORT=5432
DATA_DIR="$HOME/.local/share/qompass/harbor"
PG_LOG="$HOME/.local/share/qompass/pg.log"
DB_NAME="qompass"
DBX_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/dbx.lua"
DB_ENTRY_NAME="Qompass AI Harbor"

mkdir -p "$(dirname "$DBX_FILE")"
mkdir -p "$HOME/.local/share/qompass"

detect_os() {
case "$(uname -s)" in
Linux*) OS="linux" ;;
Darwin*) OS="macos" ;;
CYGWIN* | MINGW* | MSYS* | Windows*) OS="windows" ;;
*) OS="unknown" ;;
esac
}

detect_linux_distro() {
if [ -f /etc/os-release ]; then
. /etc/os-release
DISTRO_ID=$(echo "$ID" | tr '[:upper:]' '[:lower:]')
DISTRO_LIKE=$(echo "${ID_LIKE:-}" | tr '[:upper:]' '[:lower:]')
else
DISTRO_ID="unknown"
DISTRO_LIKE=""
fi
}

is_postgres_installed() {
if command -v psql >/dev/null; then
echo "✅ PostgreSQL is already installed: $(psql --version)"
return 0
fi
return 1
}

install_postgresql_linux() {
echo "==> Installing PostgreSQL for: $DISTRO_ID"
case "$DISTRO_ID" in
debian | ubuntu | linuxmint | pop)
sudo apt update
sudo apt install -y postgresql postgresql-contrib
;;
arch | manjaro)
sudo pacman -Sy --noconfirm postgresql
;;
fedora | rhel | centos)
sudo dnf install -y postgresql-server postgresql-contrib
;;
nixos)
echo "❗ On NixOS, use configuration.nix or nix-shell to enable PostgreSQL."
;;
*)
echo "❌ Unsupported Linux distro. Please install PostgreSQL manually."
exit 1
;;
esac
}

install_postgresql_macos() {
echo "==> Installing PostgreSQL on macOS..."
if ! command -v brew >/dev/null; then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew install postgresql
brew services start postgresql
}

install_postgresql_windows() {
echo "â„šī¸ Native Windows install is not automated."
echo "Get the installer from: https://www.postgresql.org/download/windows/"
exit 1
}

setup_user_cluster() {
if [ ! -d "$DATA_DIR/base" ]; then
echo "==> Initializing user-local PostgreSQL cluster in $DATA_DIR"
initdb -D "$DATA_DIR"
fi

if ! pg_ctl -D "$DATA_DIR" -l "$PG_LOG" status >/dev/null 2>&1; then
echo "==> Starting PostgreSQL server..."
pg_ctl -D "$DATA_DIR" -l "$PG_LOG" start
sleep 2
else
echo "â„šī¸ PostgreSQL server already running."
fi

if ! psql -h localhost -p "$PORT" -lqt | cut -d \| -f 1 | grep -qw "$DB_NAME"; then
echo "✅ Creating database: $DB_NAME"
createdb -h localhost -p "$PORT" "$DB_NAME"
else
echo "â„šī¸ Database '$DB_NAME' already exists."
fi
}

write_dbx_file() {
echo "==> Writing database entry to: $DBX_FILE"

cat >"$DBX_FILE" < PostgreSQL not detected, installing..." if
[ "$OS"="linux" ]; then detect_linux_distro install_postgresql_linux elif [ "$OS"="macos" ];
then install_postgresql_macos elif [ "$OS"="windows" ]; then install_postgresql_windows else
echo "❌ Unsupported OS: $OS" exit 1 fi fi setup_user_cluster write_dbx_file echo
echo "🚀 Your local PostgreSQL instance is ready." echo "📡 Connection URL:"
echo " postgresql://$USER@localhost:$PORT/$DB_NAME" echo
echo "🧠 Use this in Neovim DBUI or CLI:"
echo " psql -h localhost -p $PORT -U $USER -d $DB_NAME" } main "$@"



Or, View
the quickstart script
.



🧭 About Qompass AI


Matthew A. Porter

Former Intelligence Officer

Educator & Learner

DeepTech Founder & CEO


Publications




ORCID


ResearchGate


Zenodo

Developer Programs

[![NVIDIA
Developer](https://img.shields.io/badge/NVIDIA-Developer_Program-76B900?style=for-the-badge\&logo=nvidia\&logoColor=white)](https://developer.nvidia.com/)
[![Meta
Developer](https://img.shields.io/badge/Meta-Developer_Program-0668E1?style=for-the-badge\&logo=meta\&logoColor=white)](https://developers.facebook.com/)
[![HackerOne](https://img.shields.io/badge/-HackerOne-%23494649?style=for-the-badge\&logo=hackerone\&logoColor=white)](https://hackerone.com/phaedrusflow)
[![HuggingFace](https://img.shields.io/badge/HuggingFace-qompass-yellow?style=flat-square\&logo=huggingface)](https://huggingface.co/qompass)
[![Epic Games
Developer](https://img.shields.io/badge/Epic_Games-Developer_Program-313131?style=for-the-badge\&logo=epic-games\&logoColor=white)](https://dev.epicgames.com/)

Professional Profiles




Personal LinkedIn


Startup LinkedIn

Social Media




X/Twitter


Instagram


Qompass AI YouTube


đŸ”Ĩ How Do I Support



đŸ›ī¸ Qompass AI Pre-Seed Funding 2023-2025
🏆 Amount
📅 Date


RJOS/Zimmer Biomet Research Grant

$30,000
March 2024


Pathfinders Intern
Program


View on LinkedIn

$2,000
October 2024



🤝 How To Support Our Mission

[![GitHub
Sponsors](https://img.shields.io/badge/GitHub-Sponsor-EA4AAA?style=for-the-badge\&logo=github-sponsors\&logoColor=white)](https://github.com/sponsors/phaedrusflow)
[![Patreon](https://img.shields.io/badge/Patreon-Support-F96854?style=for-the-badge\&logo=patreon\&logoColor=white)](https://patreon.com/qompassai)
[![Liberapay](https://img.shields.io/badge/Liberapay-Donate-F6C915?style=for-the-badge\&logo=liberapay\&logoColor=black)](https://liberapay.com/qompassai)
[![Open
Collective](https://img.shields.io/badge/Open%20Collective-Support-7FADF2?style=for-the-badge\&logo=opencollective\&logoColor=white)](https://opencollective.com/qompassai)
[![Buy Me A
Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-FFDD00?style=for-the-badge\&logo=buy-me-a-coffee\&logoColor=black)](https://www.buymeacoffee.com/phaedrusflow)


🔐 Cryptocurrency Donations

**Monero (XMR):**


Monero QR Code


42HGspSFJQ4MjM5ZusAiKZj9JZWhfNgVraKb1eGCsHoC6QJqpo2ERCBZDhhKfByVjECernQ6KeZwFcnq8hVwTTnD8v4PzyH


📋 Copy Address

Funding helps us continue our research at the intersection of AI, healthcare, and education

Frequently Asked Questions

### Q: How do you mitigate against bias?

**TLDR - we do math to make AI ethically useful**

### A: We delineate between mathematical bias (MB) - a fundamental parameter in neural network equations - and
algorithmic/social bias (ASB). While MB is optimized during model training through backpropagation, ASB requires
careful consideration of data sources, model architecture, and deployment strategies. We implement attention
mechanisms for improved input processing and use legal open-source data and secure web-search APIs to help mitigate
ASB.

[AAMC AI Guidelines | One way to align AI against
ASB](https://www.aamc.org/about-us/mission-areas/medical-education/principles-ai-use)

### AI Math at a glance

## Forward Propagation Algorithm

$$
y = w_1x_1 + w_2x_2 + ... + w_nx_n + b
$$

Where:

- $y$ represents the model output
- $(x_1, x_2, ..., x_n)$ are input features
- $(w_1, w_2, ..., w_n)$ are feature weights
- $b$ is the bias term

### Neural Network Activation

For neural networks, the bias term is incorporated before activation:

$$
z = \\sum\_{i=1}^{n} w_ix_i + b
$$
$$
a = \\sigma(z)
$$

Where:

- $z$ is the weighted sum plus bias
- $a$ is the activation output
- $\\sigma$ is the activation function

### Attention Mechanism- aka what makes the Transformer (The "T" in ChatGPT) powerful

- [Attention High level overview video](https://www.youtube.com/watch?v=fjJOgb-E41w)

- [Attention Is All You Need Arxiv Paper](https://arxiv.org/abs/1706.03762)

The Attention mechanism equation is:

$$
\\text{Attention}(Q, K, V) = \\text{softmax}\\left( \\frac{QK^T}{\\sqrt{d_k}} \\right) V
$$

Where:

- $Q$ represents the Query matrix
- $K$ represents the Key matrix
- $V$ represents the Value matrix
- $d_k$ is the dimension of the key vectors
- $\\text{softmax}(\\cdot)$ normalizes scores to sum to 1

### Q: Do I have to buy a Linux computer to use this? I don't have time for that!

### A: No. You can run Linux and/or the tools we share alongside your existing operating system:

- Windows users can use Windows Subsystem for Linux [WSL](https://learn.microsoft.com/en-us/windows/wsl/install)
- Mac users can use [Homebrew](https://brew.sh/)
- The code-base instructions were developed with both beginners and advanced users in mind.

### Q: Do you have to get a masters in AI?

### A: Not if you don't want to. To get competent enough to get past ChatGPT dependence at least, you just need a
computer and a beginning's mindset. Huggingface is a good place to start.

- [Huggingface](https://docs.google.com/presentation/d/1IkzESdOwdmwvPxIELYJi8--K3EZ98_cL6c5ZcLKSyVg/edit#slide=id.p)

### Q: What makes a "small" AI model?

### A: AI models ~=10 billion(10B) parameters and below. For comparison, OpenAI's GPT4o contains approximately 200B
parameters.

What a Dual-License Means

### Protection for Vulnerable Populations

The dual licensing aims to address the cybersecurity gap that disproportionately affects underserved populations. As
highlighted by recent attacks[1], low-income residents, seniors, and foreign language
speakers face higher-than-average risks of being victims of cyberattacks. By offering both open-source and
commercial licensing options, we encourage the development of cybersecurity solutions that can reach these
vulnerable groups while also enabling sustainable development and support.

### Preventing Malicious Use

The AGPL-3.0 license ensures that any modifications to the software remain open source, preventing bad actors from
creating closed-source variants that could be used for exploitation. This is especially crucial given the rising
threats to vulnerable communities, including children in educational settings. The attack on Minneapolis Public
Schools, which resulted in the leak of 300,000 files and a $1 million ransom demand, highlights the importance of
transparency and security[8].

### Addressing Cybersecurity in Critical Sectors

The commercial license option allows for tailored solutions in critical sectors such as healthcare, which has seen
significant impacts from cyberattacks. For example, the recent Change Healthcare attack[4] affected millions of Americans and caused widespread disruption for hospitals and
other providers. In January 2025, CISA[2] and FDA[3]
jointly warned of critical backdoor vulnerabilities in Contec CMS8000 patient monitors, revealing how medical
devices could be compromised for unauthorized remote access and patient data manipulation.

### Supporting Cybersecurity Awareness

The dual licensing model supports initiatives like the Cybersecurity and Infrastructure Security Agency (CISA)
efforts to improve cybersecurity awareness[7] in "target rich" sectors, including
K-12 education[5]. By allowing both open-source and commercial use, we aim to
facilitate the development of tools that support these critical awareness and protection efforts.

### Bridging the Digital Divide

The unfortunate reality is that too many individuals and organizations have gone into a frenzy in every facet of our
daily lives[6]. These unfortunate folks identify themselves with their talk of "10X"
returns and building towards Artificial General Intelligence aka "AGI" while offering GPT wrappers. Our dual
licensing approach aims to acknowledge this deeply concerning predatory paradigm with clear eyes while still
operating to bring the best parts of the open-source community with our services and solutions.

### Recent Cybersecurity Attacks

Recent attacks underscore the importance of robust cybersecurity measures:

- The Change Healthcare cyberattack in February 2024 affected millions of Americans and caused significant
disruption to healthcare providers.
- The White House and Congress jointly designated October 2024 as Cybersecurity Awareness Month. This designation
comes with over 100 actions that align the Federal government and public/private sector partners are taking to help
every man, woman, and child to safely navigate the age of AI.

By offering both open source and commercial licensing options, we strive to create a balance that promotes
innovation and accessibility. We address the complex cybersecurity challenges faced by vulnerable populations and
critical infrastructure sectors as the foundation of our solutions, not an afterthought.

### References