A Symfony application that uses AI to match photos and descriptions with ancient artefacts from the "Below the Surface" dataset.
Watch Pauline demonstrate the application in Amsterdam:
- PHP 8.2 or higher
- Composer
- MongoDB PHP Extension
- MongoDB Atlas account (or local MongoDB instance)
- OpenAI API key
- Voyage AI API key
git clone <repository-url> amsterdam-artefact-matcher
cd amsterdam-artefact-matcherInstall the MongoDB extension using pie:
pie install mongodb/mongodb-extensionVerify the installation:
php --ri mongodbYou should see MongoDB extension information if it's properly installed.
composer installCreate a free MongoDB Atlas cluster:
- Go to MongoDB Atlas
- Sign up for a free account
- Create a new cluster (the free M0 tier is sufficient for this project)
- Create a database user with read/write permissions
- Whitelist your IP address (or use
0.0.0.0/0for testing) - Get your connection string from the "Connect" button
Note: The free M0 tier on MongoDB Atlas provides:
- 512 MB storage
- Shared RAM
- No credit card required
- Perfect for development and small projects
Create a .env.local file in the project root:
cp .env .env.localEdit .env.local and set your configuration:
# MongoDB Atlas connection string
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/?retryWrites=true&w=majority
# Database name
MONGODB_DB=symfonycon-amsterdam
# Voyage AI API key (for embeddings)
VOYAGE_API_KEY=your_voyage_api_key_here
# OpenAI API key (for AI features)
OPENAI_API_KEY=your_openai_api_key_here
# Application URL
DEFAULT_URI=http://localhost:8000Getting API Keys:
- Voyage AI: Sign up at Voyage AI to get your API key
- OpenAI: Get your API key from OpenAI Platform
Create the required indexes:
bin/console doctrine:mongodb:schema:createImport the artefacts from the "Below the Surface" dataset:
bin/console app:load-artefactsThis command will:
- Download the dataset from the Below the Surface API
- Parse the CSV data
- Create artefact documents with summaries and images
- Persist them to your MongoDB database
This process may take several minutes depending on your connection speed.
Generate embeddings for all artefacts using AI:
bin/console ai:store:vectorizeThis command will:
- Process artefacts in chunks of 500
- Generate vector embeddings using the Voyage AI API
- Store the embeddings in MongoDB for similarity search
Note: This process can take a while depending on the number of artefacts and API rate limits.
Start the Symfony development server:
symfony serveVisit http://localhost:8000 in your browser to start matching artefacts!
- Text Search: Describe an artefact you're looking for
- Image Search: Upload a photo or use your camera to find similar artefacts
- Drag & Drop: Drag images directly onto the upload area
- Search History: Recent searches are saved in your browser (including images)
- AI-Powered Matching: Uses embeddings and vector similarity search
bin/console app:load-artefacts- Load artefacts from the datasetbin/console ai:store:vectorize- Generate embeddings for artefactsbin/console doctrine:mongodb:schema:create- Create MongoDB schema
If you get "Extension mongodb not found":
- Make sure you've installed it with
pie install mongodb/mongodb-extension - Check your
php.inifile includesextension=mongodb.so - Restart your web server/PHP-FPM
- Verify your connection string in
.env.local - Make sure your IP is whitelisted in MongoDB Atlas
- Check your username and password are correct
- Ensure the database user has proper permissions
- Verify your API keys are correctly set in
.env.local - Check that your OpenAI/Voyage AI accounts have sufficient credits
- Ensure there are no extra spaces or quotes around the keys
Dataset provided by Below the Surface Amsterdam. Project created by Pauline Vos for SymfonyCon 2025 Amsterdam.
