From 0f3e324bde63f4edd7f0f6f6a97d27465cdb8847 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 6 Oct 2026 01:43:16 +1100 Subject: [PATCH] docs: server quickstart, standalone template first, install starts PostgreSQL --- README.md | 65 +++++++++++-------- config.example.toml | 2 +- deployments/INSTRUCTIONS.md | 7 +- deployments/README.md | 11 ++-- deployments/docker-nats-stack.toml | 2 +- deployments/multi-forge-github-gitea.toml | 2 +- deployments/single-forge-github.toml | 2 +- ...ollama-standalone.toml => standalone.toml} | 10 +-- install.sh | 10 +++ 9 files changed, 67 insertions(+), 44 deletions(-) rename deployments/{local-ollama-standalone.toml => standalone.toml} (80%) diff --git a/README.md b/README.md index 3b5f90511..73ee68a6a 100644 --- a/README.md +++ b/README.md @@ -94,41 +94,50 @@ approve the binding. Sources default to signed delivery; an unsigned source must be explicitly approved. Binding changes require re-approval before they can dispatch work. -## Develop locally +## Run it on a server -The repository requires Go 1.27, [Task](https://taskfile.dev/), Node.js and npm, -and Docker with a running daemon. The development stack starts PostgreSQL 18 -through Docker Compose. See [AGENTS.md](AGENTS.md) for the tools the quality -gate needs. +You need Linux, PostgreSQL 18, Docker (agents run in containers) and a model: +local [Ollama](https://ollama.com) or a hosted provider API key. -```bash -task dev -``` +1. **Install.** From a clone (needs Go 1.27, git and jq): -Open for the dashboard with Vite hot reload. `task dev` -starts the daemon, Gateway, State Store, UI service, and frontend development -server; it uses [`deployments/dev.toml`](deployments/dev.toml) as a local -configuration overlay. Set credentials and other required settings in your local -Archie configuration as needed. + ```bash + git clone https://github.com/samcharles93/archie-core && cd archie-core + ./install.sh + ``` -Useful checks: + It builds the five services into `~/.local/bin`, asks for a forge (choose + **None** if you only want event-driven automation) and a model, writes + `~/.config/archie/config.toml`, starts PostgreSQL with Docker Compose, and + installs and starts systemd user units. Use `--no-systemd` to run the + processes yourself. A prebuilt release archive works too; its + `INSTRUCTIONS.md` covers that path. -```bash -task build # build the service and agent binaries in bin/ -task test # run the short Go test suite -task check # run the repository quality gate -``` +2. **Check it is up.** -## Deploy + ```bash + systemctl --user status archied archie-state-store archie-gateway archie-ui archie-messaging + curl -s http://127.0.0.1:8485/health/detailed + ``` -Start with the [deployment examples](deployments/README.md). They cover a single -GitHub forge, multiple GitHub and Gitea identities, local Ollama, and an -external NATS stack. Copy a suitable template to -`${XDG_CONFIG_HOME:-~/.config}/archie/config.toml`, then set its repository, -model, credential, and service settings for your environment. The examples -describe the required PostgreSQL connection and how to start each process. A -[systemd user service guide](deployments/systemd-user-service.md) is available, -but systemd is optional. +3. **Open the dashboard** at . It binds loopback by + default; tunnel to it (`ssh -L 8484:127.0.0.1:8484 server`) or see + [deployments](deployments/README.md#running-the-dashboard) to expose it + with a token. + +4. **Automate your first event** with + [Your first playbook](docs/guides/first-playbook.md): send a webhook, map + its fields, bind it to a workflow and watch the task run. + +To write the config by hand instead, start from +[`deployments/standalone.toml`](deployments/standalone.toml) (no forge) or +another [deployment template](deployments/README.md). + +## Develop + +`task dev` starts every service with Vite hot reload at +, using [`deployments/dev.toml`](deployments/dev.toml). +`task check` is the quality gate; [AGENTS.md](AGENTS.md) lists its tools. ## Documentation diff --git a/config.example.toml b/config.example.toml index f26434adb..d66b80b63 100644 --- a/config.example.toml +++ b/config.example.toml @@ -14,7 +14,7 @@ # serve from. Required: each fails closed without it. # `docker compose up -d postgres` starts a matching local postgres:18 with this # default URL. -# database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable" +database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable" # skills_dir = "~/.local/share/archie/skills" # SKILL.md search path; defaults under work_dir when unset # workflow_routing_file = "~/.local/share/archie/workflow-routing.yaml" # kind->workflow rebinding (bug/feature) diff --git a/deployments/INSTRUCTIONS.md b/deployments/INSTRUCTIONS.md index 285a078bc..74d77cd84 100644 --- a/deployments/INSTRUCTIONS.md +++ b/deployments/INSTRUCTIONS.md @@ -28,9 +28,10 @@ as a host binary. Pull it from GHCR: `ghcr.io/samcharles93/archie-agent`. 1. Pick a starting configuration. The full set of annotated templates lives in this repository's `deployments/` directory on GitHub () — - `single-forge-github.toml`, `multi-forge-github-gitea.toml`, - `local-ollama-standalone.toml`, and `docker-nats-stack.toml` cover the - common cases. Copy whichever fits to: + `standalone.toml` (no forge, the simplest start), + `single-forge-github.toml`, `multi-forge-github-gitea.toml` and + `docker-nats-stack.toml` cover the common cases. Every one needs + PostgreSQL 18 at `database_url`. Copy whichever fits to: ```bash mkdir -p ~/.config/archie diff --git a/deployments/README.md b/deployments/README.md index 404effa4c..5a1fd1b23 100644 --- a/deployments/README.md +++ b/deployments/README.md @@ -10,8 +10,9 @@ This directory contains configuration templates and guides for different deploym - **[`multi-forge-github-gitea.toml`](./multi-forge-github-gitea.toml)**: Multi-identity deployment running GitHub and a self-hosted Gitea instance simultaneously with distinct bot accounts, tokens, and repository sets. -- **[`local-ollama-standalone.toml`](./local-ollama-standalone.toml)**: - Self-hosted deployment running local LLM models via Ollama (e.g., `llama3`, `qwen2.5`) with optional standalone (forge-disabled) operation. +- **[`standalone.toml`](./standalone.toml)**: start here. Event-driven + automation with no forge or repositories, local Ollama models, loopback + services and no tokens. - **[`docker-nats-stack.toml`](./docker-nats-stack.toml)**: Host-run `archied` orchestrating sandboxed `archie-agent` containers over the repository's Compose-managed NATS service. Copy to `~/.config/archie/config.toml`, start NATS with Compose, then start `archied` on the host. @@ -42,9 +43,9 @@ archied -config ~/.config/archie/config.toml systemctl --user start archied ``` -The templates use the extracted Gateway Service by default. Start -`archie-gateway` before `archied`; it owns the conversation tables and -serves the `ChatContract` gRPC API on the configured target. +Start order does not matter: a service waits for its peers and reports them as +degraded meanwhile. Every template needs PostgreSQL 18 at `database_url`; +`docker compose up -d postgres` provides the default one. The State Store service (`archie-state-store`) owns the task data in the PostgreSQL database `database_url` names and serves the `StateStore` gRPC diff --git a/deployments/docker-nats-stack.toml b/deployments/docker-nats-stack.toml index 63f1d739b..a15412d74 100644 --- a/deployments/docker-nats-stack.toml +++ b/deployments/docker-nats-stack.toml @@ -16,7 +16,7 @@ bot_user = "archie" diff_cap_lines = 0 work_dir = "~/.local/share/archie/work" state_dir = "~/.local/share/archie" # NATS store, task logs -# The State Store's PostgreSQL connection (required; Postgres-only epic). +# The State Store's PostgreSQL connection (PostgreSQL 18, required). # `docker compose up -d postgres` provides this local default; point it at # your own Postgres 18 server otherwise. database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable" diff --git a/deployments/multi-forge-github-gitea.toml b/deployments/multi-forge-github-gitea.toml index a23dacba0..d6642df94 100644 --- a/deployments/multi-forge-github-gitea.toml +++ b/deployments/multi-forge-github-gitea.toml @@ -8,7 +8,7 @@ work_dir = "~/.local/share/archie/work" state_dir = "~/.local/share/archie" # NATS store, task logs -# The State Store's PostgreSQL connection (required; Postgres-only epic). +# The State Store's PostgreSQL connection (PostgreSQL 18, required). # `docker compose up -d postgres` provides this local default; point it at # your own Postgres 18 server otherwise. database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable" diff --git a/deployments/single-forge-github.toml b/deployments/single-forge-github.toml index e47d907b0..5336d2774 100644 --- a/deployments/single-forge-github.toml +++ b/deployments/single-forge-github.toml @@ -7,7 +7,7 @@ work_dir = "~/.local/share/archie/work" state_dir = "~/.local/share/archie" # NATS store, task logs -# The State Store's PostgreSQL connection (required; Postgres-only epic). +# The State Store's PostgreSQL connection (PostgreSQL 18, required). # `docker compose up -d postgres` provides this local default; point it at # your own Postgres 18 server otherwise. database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable" diff --git a/deployments/local-ollama-standalone.toml b/deployments/standalone.toml similarity index 80% rename from deployments/local-ollama-standalone.toml rename to deployments/standalone.toml index e26aef9f3..8368a609e 100644 --- a/deployments/local-ollama-standalone.toml +++ b/deployments/standalone.toml @@ -1,8 +1,10 @@ # ============================================================================== -# Self-Hosted Ollama + Standalone Mode Deployment Example +# Minimal event-driven deployment: no forge, no repositories # -# Runs local open-weights models via Ollama (e.g. llama3, qwen2.5) with forge -# polling disabled (standalone execution mode). +# Events arrive as webhooks at the dashboard and run workflows. Models run +# locally through Ollama; for a hosted provider replace [providers.ollama] with +# e.g. [providers.openai] class = "openai", api_key_env = "OPENAI_API_KEY" +# and change the model names to "openai/". # ============================================================================== # Standalone still needs a bot identity: it names the agent that chat turns and @@ -12,7 +14,7 @@ bot_user = "archie" work_dir = "~/.local/share/archie/work" state_dir = "~/.local/share/archie" # NATS store, task logs -# The State Store's PostgreSQL connection (required; Postgres-only epic). +# PostgreSQL 18 connection (required). # `docker compose up -d postgres` provides this local default; point it at # your own Postgres 18 server otherwise. database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable" diff --git a/install.sh b/install.sh index a6e63c640..f9f133fa6 100755 --- a/install.sh +++ b/install.sh @@ -400,6 +400,16 @@ else echo " [SKIP] ${ARCHIE_CONFIG_DIR}/config.toml already exists (preserving user config)." fi +# Every service fails closed without PostgreSQL. The generated database_url +# matches the Compose postgres service, so start it when Docker can. +if command -v docker &>/dev/null && [ -f "${SRC_DIR}/docker-compose.yml" ]; then + echo "==> Starting PostgreSQL 18 (docker compose up -d postgres)..." + docker compose -f "${SRC_DIR}/docker-compose.yml" up -d postgres || + echo " [WARN] Could not start PostgreSQL. Start it before the services, or point database_url at your own PostgreSQL 18." +else + echo " [WARN] Docker not found: point database_url in ${ARCHIE_CONFIG_DIR}/config.toml at a PostgreSQL 18 server before starting the services." +fi + # 6. Seed skills, personas, memories, and onboarding tasks echo "==> Seeding skills and templates..."