# Manual Install

### Prerequisites

* Python 3.12+
* PostgreSQL 15+ with pgvector extension
* Redis 7+

### Database Setup

{% stepper %}
{% step %}
**Create a new database and enable pgvector**

```sql
createdb qubit
\c qubit
CREATE EXTENSION vector;
```

{% endstep %}

{% step %}
**Set up your environment variables**

| Variable          | Description                        | Required |
| ----------------- | ---------------------------------- | -------- |
| `DB_PASSWORD`     | PostgreSQL password                | Yes      |
| `AUTH_SECRET_KEY` | Secret key for JWT tokens          | Yes      |
| `OPENAI_API_KEY`  | OpenAI API key for semantic search | Yes      |
| `ADMIN_USERNAME`  | Admin username                     | Yes      |
| `ADMIN_EMAIL`     | Admin email                        | Yes      |
| `ADMIN_PASSWORD`  | Admin password                     | Yes      |
| {% endstep %}     |                                    |          |

{% step %}
**Set up your environment variables**

```bash
export DATABASE_URL="postgresql://postgres:password@localhost:5432/qubit"
export REDIS_URL="redis://localhost:6379/0"
export AUTH_SECRET_KEY="your_secret_key_here"
export OPENAI_API_KEY="your_openai_key_here"
```

{% endstep %}
{% endstepper %}

### Install & Run

{% stepper %}
{% step %}
Install dependencies and run database migrations

```bash
pip install -r requirements.txt
alembic upgrade head
```

{% endstep %}

{% step %}
Create an admin user

```bash
python -m qubit.scripts.create_admin --username admin --email admin@example.com --password your_password
```

{% endstep %}

{% step %}
Start the application

```bash
python -m qubit.main --config data/config.yaml
```

{% endstep %}
{% endstepper %}

The application will be available at <http://localhost:8000>.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://qubit.deadbits.ai/getting-started/manual-install.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
