Explain how you would implement a vector similarity search engine, including the trade-offs between linear search and graph-based indices.