Quickstart
Quickstart
Section titled “Quickstart”This guide gets Valter running on your machine with the minimum viable setup. You’ll start the database infrastructure, run migrations, and make your first API call. For a complete setup with all optional features, see the Installation guide.
Prerequisites
Section titled “Prerequisites”You need three things installed:
- Python 3.12+ — Valter uses modern typing features (
X | None,typestatements) - Docker and Docker Compose — for PostgreSQL, Qdrant, and Redis
- make — all commands go through the Makefile
Step 1: Clone and install
Section titled “Step 1: Clone and install”git clone <repo-url> && cd Valter
# Create and activate virtual environmentpython -m venv .venvsource .venv/bin/activate
# Install with dev dependencies (prefer uv for speed)uv pip install -e ".[dev]"# or: pip install -e ".[dev]"Step 2: Start databases
Section titled “Step 2: Start databases”make docker-upThis starts three containers via Docker Compose:
| Service | Image | Port | Data |
|---|---|---|---|
| PostgreSQL 16 | postgres:16-alpine | 5432 | Documents, features, metadata, jobs |
| Qdrant | qdrant/qdrant:latest | 6333 | Semantic vector search |
| Redis 7 | redis:7-alpine | 6379 | Cache, rate limiting, job queue |
Step 3: Configure environment
Section titled “Step 3: Configure environment”cp .env.example .envThe defaults work out of the box for local development. The .env.example file is pre-configured with local connection strings:
# These are the defaults — no changes needed for local devVALTER_DATABASE_URL=postgresql+asyncpg://valter:valter_dev@localhost:5432/valterVALTER_QDRANT_URL=http://localhost:6333VALTER_REDIS_URL=redis://localhost:6379/0Step 4: Run migrations
Section titled “Step 4: Run migrations”make migrateThis runs alembic upgrade head, applying all 8 PostgreSQL migrations that create tables for documents, features, metadata, jobs, workflows, API keys, audit logs, and session memory.
Step 5: Start the server
Section titled “Step 5: Start the server”make devThe API starts on http://localhost:8000 with hot reload enabled. You’ll see structured JSON logs from structlog:
{"event": "valter.startup", "version": "0.1.0", ...}Step 6: Verify it works
Section titled “Step 6: Verify it works”Health check
Section titled “Health check”curl -s http://localhost:8000/health | python -m json.tool{ "status": "healthy", "version": "0.1.0", "stores": [ {"name": "qdrant", "status": "up", "latency_ms": 2.1}, {"name": "neo4j", "status": "down", "latency_ms": null}, {"name": "postgres", "status": "up", "latency_ms": 1.3}, {"name": "redis", "status": "up", "latency_ms": 0.4}, {"name": "artifact_storage", "status": "up", "latency_ms": 0.1}, {"name": "worker_ingest", "status": "down", "latency_ms": null} ], "uptime_seconds": 3.42}A "degraded" status is normal at this point — Neo4j and the ingest worker aren’t running yet.
Interactive API docs
Section titled “Interactive API docs”Open http://localhost:8000/docs in your browser. FastAPI generates interactive Swagger documentation for all endpoints.
Your first search
Section titled “Your first search”curl -s -X POST http://localhost:8000/v1/retrieve \ -H "Content-Type: application/json" \ -d '{"query": "responsabilidade civil dano moral"}' \ | python -m json.toolVerify a legal reference
Section titled “Verify a legal reference”curl -s -X POST http://localhost:8000/v1/verify \ -H "Content-Type: application/json" \ -d '{"text": "Conforme Súmula 297 do STJ"}' \ | python -m json.toolStep 7: Connect via MCP (optional)
Section titled “Step 7: Connect via MCP (optional)”To use Valter as a tool in Claude Desktop, add this to your claude_desktop_config.json:
{ "mcpServers": { "valter": { "command": "python", "args": ["-m", "valter.mcp"], "cwd": "/absolute/path/to/Valter", "env": { "VALTER_DATABASE_URL": "postgresql+asyncpg://valter:valter_dev@localhost:5432/valter", "VALTER_QDRANT_URL": "http://localhost:6333", "VALTER_REDIS_URL": "redis://localhost:6379/0" } } }}Restart Claude Desktop. You should see 28 tools available under “valter” in the MCP tools panel.
What’s running
Section titled “What’s running”After completing this quickstart, you have:
┌─────────────────────────────────────────┐│ Your machine ││ ││ ┌─────────────┐ ┌─────────────────┐ ││ │ Valter API │ │ Claude Desktop │ ││ │ :8000 │ │ (MCP stdio) │ ││ └──────┬──────┘ └────────┬────────┘ ││ │ │ ││ ┌──────┴──────────────────┴──────────┐ ││ │ Shared Data Stores │ ││ │ PostgreSQL :5432 │ ││ │ Qdrant :6333 │ ││ │ Redis :6379 │ ││ └────────────────────────────────────┘ │└─────────────────────────────────────────┘What’s not running (yet)
Section titled “What’s not running (yet)”| Component | What it adds | How to enable |
|---|---|---|
| Neo4j | 12 graph analytics endpoints (divergences, optimal argument, temporal evolution) | Installation guide |
| ARQ Worker | Background PDF ingestion and case analysis | make worker-ingest |
| MCP Remote | HTTP/SSE server for ChatGPT integration | make mcp-remote |
| Groq LLM | Factual extraction, query expansion, document classification | Set VALTER_GROQ_API_KEY and VALTER_GROQ_ENABLED=true |
Next steps
Section titled “Next steps”- Installation — Full setup with Neo4j, Groq, R2, and production configuration
- API Reference — All endpoints with request/response schemas
- MCP Tools — Complete reference for the 28 MCP tools
- Architecture — How the layers and data stores fit together