AdiosDocs

Build and Deploy an AI Semantic Search Engine with Python FastAPI and Postgres pgvector

Build a personal knowledge-base search engine where users paste paragraphs and search by meaning, not just exact words.

Target searches: deploy fastapi python app, postgres vector database hosting, host ai backend no serverless, fastapi alternatives render heroku.

The Stack

  • Python with FastAPI
  • Postgres with the pgvector extension
  • Gemini API for embeddings
  • Adios runtime with secrets and managed database wiring

Why This Feels Like a Superpower

AI backends often import heavier Python libraries and initialize API clients at startup. On Adios, your FastAPI app runs as a normal long-lived service, so your backend can stay warm instead of rebuilding state on every request.

1. Build the API

Ask the Adios AI agent:

Build a FastAPI semantic search API. Add endpoints to insert documents and
search them using embeddings. Use Gemini for embeddings, Postgres pgvector for
similarity search, and /healthz for health checks.

2. Add adios.yaml

name: semantic-search
region: de
replicas: 1

build_cmd: python -m pip install -r requirements.txt
start_cmd: python -m uvicorn app.main:app --host 0.0.0.0 --port $PORT

runtime:
  name: [email protected]
  port: 8000
  health_path: /healthz
  memory_mb: 1024

secrets:
  DATABASE_URL: secret://DATABASE_URL
  GEMINI_API_KEY: secret://GEMINI_API_KEY

requires:
  - vector-db

Create a Postgres pgvector resource named vector-db, or set DATABASE_URL manually if you already have one.

3. Deploy

adios secrets set GEMINI_API_KEY
adios up

Your app gets a generated Adios route with TLS, runtime logs, and managed database connection details without a Dockerfile or cloud console setup.