{"id":49889683,"url":"https://github.com/sergiomarquezdev/gemini-embeddings-2-mongo-demo","last_synced_at":"2026-05-15T20:10:38.045Z","repository":{"id":357306433,"uuid":"1236315199","full_name":"sergiomarquezdev/gemini-embeddings-2-mongo-demo","owner":"sergiomarquezdev","description":"Educational demo: gemini-embedding-2 (multimodal: text/image/PDF/audio/video) + MongoDB Atlas Local Vector Search, FastAPI + drag-and-drop UI","archived":false,"fork":false,"pushed_at":"2026-05-12T08:40:20.000Z","size":1955,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-12T09:03:47.864Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergiomarquezdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-12T06:22:09.000Z","updated_at":"2026-05-12T08:40:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sergiomarquezdev/gemini-embeddings-2-mongo-demo","commit_stats":null,"previous_names":["sergiomarquezdev/gemini-embeddings-2-mongo-demo"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sergiomarquezdev/gemini-embeddings-2-mongo-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiomarquezdev%2Fgemini-embeddings-2-mongo-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiomarquezdev%2Fgemini-embeddings-2-mongo-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiomarquezdev%2Fgemini-embeddings-2-mongo-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiomarquezdev%2Fgemini-embeddings-2-mongo-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergiomarquezdev","download_url":"https://codeload.github.com/sergiomarquezdev/gemini-embeddings-2-mongo-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiomarquezdev%2Fgemini-embeddings-2-mongo-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33078253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:05:40.333Z","status":"ssl_error","status_checked_at":"2026-05-15T20:05:38.672Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-15T20:10:36.562Z","updated_at":"2026-05-15T20:10:38.027Z","avatar_url":"https://github.com/sergiomarquezdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gemini-embedding-2 + MongoDB Vector Search demo\n\nEducational demo: upload any file (text, image, PDF, audio, video, ZIP, RAR) and search them semantically using `gemini-embedding-2` embeddings stored in MongoDB Atlas Local.\n\n## Prerequisites\n\n- Python 3.12+\n- Docker (for MongoDB Atlas Local)\n- ffmpeg (`apt install ffmpeg` / `brew install ffmpeg` / `winget install ffmpeg`)\n- unrar (`apt install unrar` / `brew install rar` / `winget install RARLab.WinRAR`)\n- Google Cloud SDK with `gcloud auth application-default login` completed\n- A GCP project with Vertex AI API enabled\n\n## Setup\n\n```bash\ngit clone https://github.com/sergiomarquezdev/gemini-embeddings-2-mongo-demo.git\ncd gemini-embeddings-2-mongo-demo\npython -m venv .venv\nsource .venv/bin/activate          # Linux / macOS\n# source .venv/Scripts/activate    # Windows (Git Bash)\n# .venv\\Scripts\\activate            # Windows (PowerShell / cmd)\npip install -r requirements.txt\ncp .env.example .env\n# Edit .env and set GCP_PROJECT to your project ID\ndocker compose up -d mongo\ngcloud auth application-default login\nuvicorn app:app --reload\n```\n\nOpen http://localhost:8000\n\n## Smoke checklist (pre-recording)\n\n1. `GET /health` returns `{mongo: \"ok\", dedup_index: \"ready\", vector_index: \"ready\", vertex: \"configured\"}`\n2. Upload 3 short `.txt` (cats, soccer, JS), search `\"animales domésticos\"` → top result is the cats file\n3. Upload images (beach, dog, pizza), search `\"comida italiana\"` → top result is pizza\n4. Upload a 4-page scanned PDF, search text only present in the scanned image → matches (OCR works)\n5. Upload a 15-page PDF → response shows `n_chunks: 5`\n6. Upload the same `.txt` twice → second response is `status: \"already_indexed\"`\n7. Upload a ZIP with `.txt + .png + .pdf + .exe` → 3 ok, 1 skipped\n8. Upload a 30-second `.mp3` → search text from the audio → matches\n9. Upload an `.exe` directly → 415 with explicit error\n10. Upload a corrupt PDF → 422\n\n## Running tests\n\n```bash\ndocker compose up -d mongo\n.venv/Scripts/python.exe -m pytest -v   # Windows\n# or: pytest -v   (after activating venv on Linux/Mac)\n```\n\nTests mock Vertex AI but use real MongoDB. They create disposable databases per test and clean up. One test (`tests/test_archives_rar.py::test_extract_rar_with_text_file`) skips automatically if `unrar` is not installed.\n\n## Troubleshooting\n\n- **`vector_index: \"missing\"`** — Atlas Local builds the index on first start; wait ~30s and retry `/health`.\n- **`Vertex AI: 403`** — `gcloud auth application-default login` not completed, or Vertex AI API not enabled in the project.\n- **`ffmpeg: not found`** — install ffmpeg system-wide; not pip-installable.\n- **`unrar: not found`** — install via system package manager. Without it, `.rar` uploads fail with 500 and the RAR test is skipped.\n- **`vector_search: command not recognized`** — you ran the standard `mongo` image instead of `mongodb/mongodb-atlas-local`. Check `docker-compose.yml`.\n\n## Architecture references\n\n- Design spec: `docs/superpowers/specs/2026-05-11-gemini-embedding-2-mongo-design.md`\n- Implementation plan: `docs/superpowers/plans/2026-05-12-gemini-embedding-2-mongo-implementation.md`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiomarquezdev%2Fgemini-embeddings-2-mongo-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergiomarquezdev%2Fgemini-embeddings-2-mongo-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiomarquezdev%2Fgemini-embeddings-2-mongo-demo/lists"}