In Atlas UI, navigate to your collection, open 'Atlas Search', and click 'Create Search Index' — select 'Vector Search' as the index type.
Define the index JSON with your vector field, number of dimensions, and similarity metric (cosine, euclidean, or dotProduct), then create the index.
Insert documents with an embedding field containing a BSON array of numbers matching the declared dimension count.
Run a `$vectorSearch` aggregation stage: `{ $vectorSearch: { index: 'your_index', path: 'embedding', queryVector: [...], numCandidates: 100, limit: 10 } }`.
Add a `$project` stage after `$vectorSearch` to include the `score` field via `{ score: { $meta: 'vectorSearchScore' } }` and return relevant document fields.
Known gotchas
`$vectorSearch` must be the first stage in the aggregation pipeline — it cannot be preceded by `$match` or other stages.
`numCandidates` must be greater than or equal to `limit`; increasing it improves recall at the cost of latency.
Vector Search indexes are eventually consistent — newly inserted documents may not appear in results immediately after insert.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp