{"id":30193978,"url":"https://github.com/pinecone-io/fastapi-pinecone-async-example","last_synced_at":"2025-08-13T02:07:34.320Z","repository":{"id":291650017,"uuid":"968317612","full_name":"pinecone-io/fastapi-pinecone-async-example","owner":"pinecone-io","description":"Demonstrates how to use the Pinecone Python SDK with asyncio support using FastAPI","archived":false,"fork":false,"pushed_at":"2025-06-25T13:39:47.000Z","size":139,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T05:32:27.155Z","etag":null,"topics":["asyncio","fastapi","pinecone"],"latest_commit_sha":null,"homepage":"https://www.pinecone.io/learn/pinecone-async-fastapi/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pinecone-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-04-17T21:51:18.000Z","updated_at":"2025-07-19T22:37:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"e123efc6-4143-40c0-a232-40090af2b75b","html_url":"https://github.com/pinecone-io/fastapi-pinecone-async-example","commit_stats":null,"previous_names":["pinecone-io/fastapi-pinecone-async-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pinecone-io/fastapi-pinecone-async-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinecone-io%2Ffastapi-pinecone-async-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinecone-io%2Ffastapi-pinecone-async-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinecone-io%2Ffastapi-pinecone-async-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinecone-io%2Ffastapi-pinecone-async-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pinecone-io","download_url":"https://codeload.github.com/pinecone-io/fastapi-pinecone-async-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinecone-io%2Ffastapi-pinecone-async-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270166108,"owners_count":24538445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["asyncio","fastapi","pinecone"],"created_at":"2025-08-13T02:07:29.396Z","updated_at":"2025-08-13T02:07:34.271Z","avatar_url":"https://github.com/pinecone-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using the Pinecone SDK with Asyncio support and FastAPI\n\nThis is a sample app to demonstrate how to use the [Pinecone Python SDK](https://docs.pinecone.io/reference/python-sdk) with [asyncio](https://docs.python.org/3/library/asyncio.html) support. This is a simple Next.js app with a FastAPI backend.\n\n## Getting started\n\n### Prerequisites\n\n- A Pinecone account. Create your free account [here](https://app.pinecone.io/?sessionType=signup) if you don't already have one.\n- A Pinecone API key by following [these steps](https://docs.pinecone.io/guides/projects/manage-api-keys#create-an-api-key).\n- Python 3.12 or higher.\n- [Node.js](https://nodejs.org/) 20 or higher.\n\n### Setup\n\n#### Create Python virtual environment\n\nCreate and activate a Python virtual environment:\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\n#### Install Python dependencies\n\n```bash\npip3 install -r requirements.txt\n```\n\n#### Create indexes and load data\n\nIf you don't have both a dense index and a sparse index loaded with your own data, you can load test data using the `load-data.py` in the `scripts` directory. This will create two indexes:\n\n1. a dense index using NVIDIA's `llama-text-embed-v2`, a state-of-the-art embedding model available natively in Pinecone Inference\n2. a sparse index using Pinecone's own `pinecone-sparse-english-v0` embedding model\n\nOnce the indexes are created, it will chunk and upsert data from the [GEM/sportsett_basketball dataset on Huggingface](https://huggingface.co/datasets/GEM/sportsett_basketball/viewer/default/test), converting the text to vectors automatically using the hosted embedding model.\n\n##### Setup the script environment\n\nSet up your scripts environment variables by copying the `.env.example` file in the `scripts` directory to `.env` and replacing with your environment values.\n\n##### Run the script\n\nFrom the `scripts` directory, run:\n\n```bash\npython3 load-data.py\n```\n\n#### Setup the app environment\n\nSet up your app environment variables by copying the `.env.example` file in the project root to `.env` and replacing with your environment values. You'll need to grab the index host URLs either from the [Pinecone console](https://app.pinecone.io/organizations/-/projects/-/indexes) or from the Pinecone API using `describe_index` as detailed [here](https://docs.pinecone.io/guides/data/target-an-index).\n\n#### Install Node dependencies\n\nFrom the project root, run:\n\n```bash\nnpm install\n```\n\n### Run the app\n\nFrom the project root, run:\n\n```bash\nnpm run dev\n```\n\nHead over to [http://localhost:3000](http://localhost:3000) to view the app.\n\nThe FastAPI server will be running on [http://127.0.0.1:8000](http://127.0.0.1:8000).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinecone-io%2Ffastapi-pinecone-async-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinecone-io%2Ffastapi-pinecone-async-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinecone-io%2Ffastapi-pinecone-async-example/lists"}