┌──────────────────────────────────────────────────────────────┐
│ Shared Docker Network: fqa-network │
├──────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────┐ │
│ │ Ollama (shared)│ │
│ │ :11434 │ │
│ └────────┬────────┘ │
│ │ │
│ ┌─────────────┼─────────────┐ │
│ │ │ │ │
│ ┌────▼─────┐ ┌────▼─────┐ ┌───▼──────┐ │
│ │ AI-1 │ │ AI-2 │ │ AI-3 │ │
│ ├──────────┤ ├──────────┤ ├──────────┤ │
│ │ FastAPI-1│ │ FastAPI-2│ │ FastAPI-3│ │
│ │ :8001 │ │ :8002 │ │ :8003 │ │
│ ├──────────┤ ├──────────┤ ├──────────┤ │
│ │Weaviate-1│ │Weaviate-2│ │Weaviate-3│ │
│ │ :8081 │ │ :8082 │ │ :8083 │ │
│ │ :6061 │ │ :6062 │ │ :6063 │ │
│ │ :50051 │ │ :50052 │ │ :50053 │ │
│ ├──────────┤ ├──────────┤ ├──────────┤ │
│ │ Neo4j-1 │ │ Neo4j-2 │ │ Neo4j-3 │ │
│ │ :7474 │ │ :7475 │ │ :7476 │ │
│ │ :7687 │ │ :7688 │ │ :7689 │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ │
└──────────────────────────────────────────────────────────────┘
Get up and running in 5 minutes:
# 1. Clone and setup Python environment
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 2. Configure environment (edit REPLICA_ID if needed)
cp .env.template .env
# 3. Make scripts executable
chmod +x scripts/*.sh
# 4. Start shared services
docker network create fqa-network
make ollama # Start Ollama + download models
make cadvisor # Optional: monitoring
# 5. Start databases (Weaviate + Neo4j)
docker compose up -d
# 6. Start FastAPI backend
source .venv/bin/activate && source .env && python -m uvicorn backend.main:app --host 0.0.0.0 --port ${BACKEND_PORT} --reload
Access your services:
- FastAPI: http://localhost:${BACKEND_PORT}/docs
- Weaviate: http://localhost:${WEAVIATE_HTTP_PORT}
- Neo4j: http://localhost:${NEO4J_HTTP_PORT}
- Ollama: http://localhost:${OLLAMA_PORT}
- cAdvisor: http://localhost:8090
Prerequisites
-
Docker
docker --version
-
Docker Compose
docker compose --version
ordocker-compose --version
-
Virtual environment
(.venv)
(Python 3.10) -
Ollama image (
ollama/ollama:latest
) -
Weaviate image (
semitechnologies/weaviate:latest
) -
Neo4j 5.20 image (
neo4j:5.20
) -
Create a virtual environment and activate it:
python -m venv .venv
source .venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
or
uv venv .venv -p 3.10
source .venv/bin/activate
uv pip install -r requirements.txt
- Configure environment variables:
cp .env.template .env
Edit the .env
file to set the environment variables
For general configuration:
REPLICA_ID=<replica_id>
BACKEND_PORT=<backend_port> # default: 8000, 8001, 8002, ...
For Weaviate:
WEAVIATE_CONTAINER_NAME="weaviate-${REPLICA_ID}"
WEAVIATE_HTTP_PORT=<weaviate_http_port> # default: 8080, 8081, 8082, ...
WEAVIATE_METRICS_PORT=<weaviate_metrics_port> # default: 6060, 6061, 6062, ...
WEAVIATE_GRPC_PORT=<weaviate_grpc_port> # default: 50051, 50052, 50053, ...
VOLUME_WEAVIATE_DATA="weaviate-data-${REPLICA_ID}"
For Neo4j:
NEO4J_CONTAINER_NAME="neo4j-${REPLICA_ID}"
NEO4J_HTTP_PORT=<neo4j_http_port> # default: 7474, 7475, 7476, ...
NEO4J_BOLT_PORT=<neo4j_bolt_port> # default: 7687, 7688, 7689, ...
VOLUME_NEO4J_DATA="neo4j-data-${REPLICA_ID}"
VOLUME_NEO4J_LOGS="neo4j-logs-${REPLICA_ID}"
VOLUME_NEO4J_IMPORT="neo4j-import-${REPLICA_ID}"
Load environment variables:
source .env
-
Create
fqa-network
:docker network create fqa-network
-
Give permissions to scripts:
chmod +x scripts/*.sh
-
Start ollama (required):
make ollama
-
Start cadvisor (optional):
make cadvisor
-
Start weaviate and neo4j (required):
docker compose up -d
ordocker-compose up -d
# Make sure .env exists
cp .env.template .env && source .env
# Start services
docker compose up -d
# Check status
docker compose ps
# View logs
docker compose logs -f
# Check health
docker ps
If you want to stop the services, safely use docker compose down
or docker-compose down
do not use -v
flag
- Start backend:
uvicorn backend.main:app --host 0.0.0.0 --port ${BACKEND_PORT} --reload
orpython backend/main.py
orsource .venv/bin/activate && source .env && python -m uvicorn backend.main:app --host 0.0.0.0 --port ${BACKEND_PORT} --reload
(Note: installuvicorn
if not installeduv pip install uvicorn
)
- Initialize the codebase ✅
- Complete the flexible configuration ✅
- Simple RAG pipeline with Ollama (embedding model, generative model, reranker model)
- Complete API server with FastAPI (
/health
,/query
,/query/stream
,/collections
, etc.)
- Gather the data
- Chunk the data
- Vectorize the data
- Extract Entities & Relationships
- Generate the graph
- Perform the retrieval
- Generate the answer
/
├── /docs
|
├── /backend (FastAPI application)
|
├── /tools (CLI tools)
|
├── /src (Core Logic)
| ├── /pipeline (Data Processing Pipeline)
| | ├── SimpleRAGPipeline
| | ├── SimpleGraphRAGPipeline
| | |...
| |
| ├── /preprocess
| |
| ├── /inference
| |
| |...
|
├── /scripts (Build scripts)
|
├── /tests (Unit tests)
|
├── requirements.txt
├── .env.template
├── .gitignore
├── .Makefile
└── README.md