Document Management API (FastAPI) Setup Create a virtual environment python -m venv .venv . .venv/Scripts/Activate.ps1 Install dependencies pip install -r requirements.txt Configure environment set DATABASE_URL=postgresql+psycopg2://user:password@localhost:5432/fastapi_docs set API_KEY=changeme Create database tables psql "%DATABASE_URL%" -f migrations/001_init.sql Run the API uvicorn app.main:app --reload Docs: http://localhost:8000/docs API Endpoints POST /api/users/ - Create user POST /api/documents/ - Create document from text POST /api/documents/upload - Upload text file POST /api/documents/ingest-external/{id} - Ingest from mock external system GET /api/documents/ - List documents DELETE /api/documents/{id} - Delete document POST /api/search/similar - Semantic search Notes Uses PostgreSQL for storage and a simple in-memory embeddings index. API key auth via x-api-key header.