# pabcablan/artemis architecture

> Architecture diagram of the GitHub repository pabcablan/artemis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pabcablan/artemis
- Repository: https://github.com/pabcablan/artemis

## Overview

Artemis is a visual and relational art-discovery platform. Its documented workflow collects Met Museum artwork records into MongoDB, enriches artwork context from Wikidata into Neo4j, and processes artwork images into Qdrant embeddings. In the Streamlit interface, a user uploads an image, gets visually similar works, and can inspect graph context and related artworks. The graph preserves these separate product stages and their stores; some cross-service data flows are shown from the README because their runtime wiring was not sampled.

Main entry points: [`wikidata-feeder/application/usecases/enricher.py`](https://github.com/pabcablan/artemis/blob/main/wikidata-feeder/application/usecases/enricher.py) (Artwork enricher), [`front/app.py`](https://github.com/pabcablan/artemis/blob/main/front/app.py) (Streamlit app), [`front/application/usecases/recommendations.py`](https://github.com/pabcablan/artemis/blob/main/front/application/usecases/recommendations.py) (Visual recommendations), [`ia-image-processor/application/usecases/processor_usecase.py`](https://github.com/pabcablan/artemis/blob/main/ia-image-processor/application/usecases/processor_usecase.py) (Image processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Artwork collection"]
  node_met_collector["Artwork collector<br/>[collector.py]"]
  node_met_adapter["Met API adapter<br/>[adapter.py]"]
  node_met_repository["Artwork repository<br/>[repository.py]"]
end

subgraph group_enrichment["Graph enrichment"]
  node_enricher["Artwork enricher<br/>[enricher.py]"]
  node_wiki_fetcher["Wikidata fetcher<br/>[fetcher.py]"]
  node_wiki_mongo["Artwork repository<br/>[repository.py]"]
  node_neo4j_client["Graph writer<br/>[client.py]"]
end

subgraph group_processing["Image processing"]
  node_processor["Image processor"]
  node_image_repo["Image repository"]
  node_clip["CLIP embeddings<br/>[clip_service.py]"]
  node_qdrant_store["Vector store<br/>[qdrant_store.py]"]
end

subgraph group_discovery["Art discovery UI"]
  node_front_app["Streamlit app<br/>[app.py]"]
  node_upload_view["Image upload<br/>[upload.py]"]
  node_recommendations["Visual recommendations<br/>[recommendations.py]"]
  node_embedding_adapter["Image embedder<br/>[embedding.py]"]
  node_vector_search["Vector search<br/>[vector_search.py]"]
  node_results_view["Search results<br/>[results.py]"]
  node_details["Artwork details<br/>[details.py]"]
  node_graph_adapter["Graph queries"]
  node_detail_view["Detail view<br/>[detail.py]"]
end

subgraph group_storage["Data stores"]
  node_mongo[("MongoDB")]
  node_neo4j[("Neo4j")]
  node_qdrant[("Qdrant")]
end

node_user(("User"))
node_met_api["Met Museum API"]
node_wikidata_api["Wikidata"]
node_wikipedia_api["Wikipedia"]

node_met_collector -->|"uses provider"| node_met_adapter
node_met_collector -->|"stores artworks"| node_met_repository
node_met_adapter -.->|"fetches records"| node_met_api
node_met_repository -.->|"writes records"| node_mongo
node_enricher -.->|"reads artworks"| node_wiki_mongo
node_enricher -.->|"fetches context"| node_wiki_fetcher
node_enricher -.->|"writes graph"| node_neo4j_client
node_wiki_fetcher -.->|"queries"| node_wikidata_api
node_enricher -.->|"adds context"| node_wikipedia_api
node_neo4j_client -.->|"writes graph"| node_neo4j
node_processor -->|"loads images"| node_image_repo
node_processor -->|"creates embeddings"| node_clip
node_processor -->|"stores vectors"| node_qdrant_store
node_image_repo -.->|"reads artwork"| node_mongo
node_qdrant_store -.->|"stores vectors"| node_qdrant
node_user -->|"uses interface"| node_front_app
node_front_app -->|"renders upload"| node_upload_view
node_front_app -->|"renders results"| node_results_view
node_front_app -->|"renders detail"| node_detail_view
node_upload_view -.->|"submits image"| node_recommendations
node_recommendations -->|"embeds image"| node_embedding_adapter
node_recommendations -->|"searches vectors"| node_vector_search
node_recommendations -.->|"loads artwork"| node_mongo
node_embedding_adapter -.->|"uses model"| node_clip
node_vector_search -.->|"searches vectors"| node_qdrant
node_results_view -.->|"shows matches"| node_user
node_detail_view -.->|"loads detail"| node_details
node_details -->|"queries context"| node_graph_adapter
node_details -.->|"loads artwork"| node_mongo
node_graph_adapter -.->|"queries relations"| node_neo4j

click node_met_collector "https://github.com/pabcablan/artemis/blob/main/metmuseum-feeder/application/usecases/collector.py"
click node_met_adapter "https://github.com/pabcablan/artemis/blob/main/metmuseum-feeder/infrastructure/adapters/met/adapter.py"
click node_met_repository "https://github.com/pabcablan/artemis/blob/main/metmuseum-feeder/infrastructure/adapters/mongo/repository.py"
click node_enricher "https://github.com/pabcablan/artemis/blob/main/wikidata-feeder/application/usecases/enricher.py"
click node_wiki_fetcher "https://github.com/pabcablan/artemis/blob/main/wikidata-feeder/infrastructure/adapters/wikidata/fetcher.py"
click node_wiki_mongo "https://github.com/pabcablan/artemis/blob/main/wikidata-feeder/infrastructure/adapters/mongo/repository.py"
click node_neo4j_client "https://github.com/pabcablan/artemis/blob/main/wikidata-feeder/infrastructure/adapters/neo4j/client.py"
click node_processor "https://github.com/pabcablan/artemis/blob/main/ia-image-processor/application/usecases/processor_usecase.py"
click node_image_repo "https://github.com/pabcablan/artemis/blob/main/ia-image-processor/infrastructure/adapters/mongo/mongo_image_adapter.py"
click node_clip "https://github.com/pabcablan/artemis/blob/main/ia-image-processor/infrastructure/adapters/clip/clip_service.py"
click node_qdrant_store "https://github.com/pabcablan/artemis/blob/main/ia-image-processor/infrastructure/adapters/qdrant/qdrant_store.py"
click node_front_app "https://github.com/pabcablan/artemis/blob/main/front/app.py"
click node_upload_view "https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/streamlit/views/upload.py"
click node_recommendations "https://github.com/pabcablan/artemis/blob/main/front/application/usecases/recommendations.py"
click node_embedding_adapter "https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/embedding.py"
click node_vector_search "https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/vector_search.py"
click node_results_view "https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/streamlit/views/results.py"
click node_details "https://github.com/pabcablan/artemis/blob/main/front/application/usecases/details.py"
click node_graph_adapter "https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/graph/graph_query_adapter.py"
click node_detail_view "https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/streamlit/views/detail.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_met_collector,node_met_adapter,node_met_repository,node_user toneBlue
class node_enricher,node_wiki_fetcher,node_wiki_mongo,node_neo4j_client toneAmber
class node_processor,node_image_repo,node_clip,node_qdrant_store,node_met_api toneMint
class node_front_app,node_upload_view,node_recommendations,node_embedding_adapter,node_vector_search,node_results_view,node_details,node_graph_adapter,node_detail_view toneRose
class node_mongo,node_neo4j,node_qdrant,node_wikidata_api,node_wikipedia_api toneIndigo
```

## Components

### Artwork collection

- [Artwork collector](https://github.com/pabcablan/artemis/blob/main/metmuseum-feeder/application/usecases/collector.py): `metmuseum-feeder/application/usecases/collector.py`
- [Met API adapter](https://github.com/pabcablan/artemis/blob/main/metmuseum-feeder/infrastructure/adapters/met/adapter.py): `metmuseum-feeder/infrastructure/adapters/met/adapter.py`
- [Artwork repository](https://github.com/pabcablan/artemis/blob/main/metmuseum-feeder/infrastructure/adapters/mongo/repository.py): `metmuseum-feeder/infrastructure/adapters/mongo/repository.py`

### Graph enrichment

- [Artwork enricher](https://github.com/pabcablan/artemis/blob/main/wikidata-feeder/application/usecases/enricher.py): `wikidata-feeder/application/usecases/enricher.py`
- [Wikidata fetcher](https://github.com/pabcablan/artemis/blob/main/wikidata-feeder/infrastructure/adapters/wikidata/fetcher.py): `wikidata-feeder/infrastructure/adapters/wikidata/fetcher.py`
- [Artwork repository](https://github.com/pabcablan/artemis/blob/main/wikidata-feeder/infrastructure/adapters/mongo/repository.py): `wikidata-feeder/infrastructure/adapters/mongo/repository.py`
- [Graph writer](https://github.com/pabcablan/artemis/blob/main/wikidata-feeder/infrastructure/adapters/neo4j/client.py): `wikidata-feeder/infrastructure/adapters/neo4j/client.py`

### Image processing

- [Image processor](https://github.com/pabcablan/artemis/blob/main/ia-image-processor/application/usecases/processor_usecase.py): `ia-image-processor/application/usecases/processor_usecase.py`
- [Image repository](https://github.com/pabcablan/artemis/blob/main/ia-image-processor/infrastructure/adapters/mongo/mongo_image_adapter.py): `ia-image-processor/infrastructure/adapters/mongo/mongo_image_adapter.py`
- [CLIP embeddings](https://github.com/pabcablan/artemis/blob/main/ia-image-processor/infrastructure/adapters/clip/clip_service.py): `ia-image-processor/infrastructure/adapters/clip/clip_service.py`
- [Vector store](https://github.com/pabcablan/artemis/blob/main/ia-image-processor/infrastructure/adapters/qdrant/qdrant_store.py): `ia-image-processor/infrastructure/adapters/qdrant/qdrant_store.py`

### Art discovery UI

- [Streamlit app](https://github.com/pabcablan/artemis/blob/main/front/app.py): `front/app.py`
- [Image upload](https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/streamlit/views/upload.py): `front/infrastructure/adapters/streamlit/views/upload.py`
- [Visual recommendations](https://github.com/pabcablan/artemis/blob/main/front/application/usecases/recommendations.py): `front/application/usecases/recommendations.py`
- [Image embedder](https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/embedding.py): `front/infrastructure/adapters/embedding.py`
- [Vector search](https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/vector_search.py): `front/infrastructure/adapters/vector_search.py`
- [Search results](https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/streamlit/views/results.py): `front/infrastructure/adapters/streamlit/views/results.py`
- [Artwork details](https://github.com/pabcablan/artemis/blob/main/front/application/usecases/details.py): `front/application/usecases/details.py`
- [Graph queries](https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/graph/graph_query_adapter.py): `front/infrastructure/adapters/graph/graph_query_adapter.py`
- [Detail view](https://github.com/pabcablan/artemis/blob/main/front/infrastructure/adapters/streamlit/views/detail.py): `front/infrastructure/adapters/streamlit/views/detail.py`

### Data stores

- **MongoDB**
- **Neo4j**
- **Qdrant**

### Other components

- **User**
- **Met Museum API**
- **Wikidata**
- **Wikipedia**

## Connections

- Artwork collector → Met API adapter: uses provider (evidence: `metmuseum-feeder/main.py`)
- Artwork collector → Artwork repository: stores artworks
- Met API adapter → Met Museum API: fetches records
- Artwork repository → MongoDB: writes records
- Artwork enricher → Artwork repository: reads artworks
- Artwork enricher → Wikidata fetcher: fetches context (evidence: `wikidata-feeder/main.py`)
- Artwork enricher → Graph writer: writes graph (evidence: `wikidata-feeder/main.py`)
- Wikidata fetcher → Wikidata: queries
- Artwork enricher → Wikipedia: adds context
- Graph writer → Neo4j: writes graph
- Image processor → Image repository: loads images (evidence: `ia-image-processor/main.py`)
- Image processor → CLIP embeddings: creates embeddings (evidence: `ia-image-processor/main.py`)
- Image processor → Vector store: stores vectors (evidence: `ia-image-processor/main.py`)
- Image repository → MongoDB: reads artwork
- Vector store → Qdrant: stores vectors
- User → Streamlit app: uses interface
- Streamlit app → Image upload: renders upload (evidence: `front/app.py`)
- Streamlit app → Search results: renders results (evidence: `front/app.py`)
- Streamlit app → Detail view: renders detail (evidence: `front/app.py`)
- Image upload → Visual recommendations: submits image
- Visual recommendations → Image embedder: embeds image (evidence: `front/application/usecases/recommendations.py`)
- Visual recommendations → Vector search: searches vectors (evidence: `front/application/usecases/recommendations.py`)
- Visual recommendations → MongoDB: loads artwork
- Image embedder → CLIP embeddings: uses model
- Vector search → Qdrant: searches vectors
- Search results → User: shows matches
- Detail view → Artwork details: loads detail
- Artwork details → Graph queries: queries context (evidence: `front/application/usecases/details.py`)
- Artwork details → MongoDB: loads artwork
- Graph queries → Neo4j: queries relations
