Make a Product searchable by its category__name, tags__name and brand__description β automatically. Sentence-transformers embeddings, pluggable vector backends, admin UI and REST API out of the box.
Most Django search solutions treat each model in isolation. Django Graph Search builds rich search context by walking the ORM relation graph before indexing.
Follows FK, M2M and reverse relations to a configurable depth, with per-field weights and traversal limits (MAX_RELATED_ITEMS, MAX_TEXT_LENGTH).
Sentence-transformers embeddings out of the box; OpenAI and Cohere cloud embeddings when you don't want PyTorch in your workers.
ChromaDB, FAISS, Qdrant, pgvector β one interface, upsert semantics everywhere. Switch with a single settings key.
Signals dispatch via transaction.on_commit into a bounded daemon thread pool, Celery or django-q β requests never block.
Semantic search inside /admin/, index-coverage dashboard, and a REST API with permissions, throttling and streaming.
Optional session-aware search with clarification loops, query expansion, reranking and SSE/NDJSON event streaming.
Three steps to semantic search across your models.
# 1. settings.py INSTALLED_APPS = [ ..., "django_graph_search" ] GRAPH_SEARCH = { "MODELS": [ {"model": "shop.Product", "fields": ["name", "description", "category__name", "tags__name"]}, ], "VECTOR_STORE": { "BACKEND": "django_graph_search.backends.ChromaDBBackend", "OPTIONS": {"persist_directory": "vector_db"}, }, } # 2. urls.py urlpatterns = [ path("api/search/", include("django_graph_search.urls")) ] # 3. build the index and query $ python manage.py build_search_index $ curl "http://localhost:8000/api/search/?q=red+phone&limit=5"
Same API, same document format β pick per environment. All backends re-index with upsert semantics since 0.3.4.
| Backend | Best for | Server required |
|---|---|---|
| ChromaDB | Development, small-medium datasets | No |
| FAISS | High-speed CPU search, offline, optional disk persistence | No |
| Qdrant | Production, large datasets, filtering | Yes |
| pgvector | Same PostgreSQL as Django, no separate vector server | PostgreSQL + vector |
Reliability & security hardening β fully backward-compatible with 0.3.x.
DuplicateIDError or create duplicatestransaction.on_commit; rollback can't corrupt the index/api/search/similar/ access control β now enforces the same permissions and throttling as other endpointspersist_path, reload on startupMAX_RELATED_ITEMS and MAX_TEXT_LENGTH guard against runaway indexinglimit β model filters are pushed into the vector store; find_similar excludes the object itselfdata exposes only fields from your model config