{"id":15792866,"url":"https://github.com/nhogs/nestjs-pinecone","last_synced_at":"2025-05-07T10:46:29.745Z","repository":{"id":57683218,"uuid":"490198060","full_name":"Nhogs/nestjs-pinecone","owner":"Nhogs","description":"Pinecone module for Nestjs","archived":false,"fork":false,"pushed_at":"2022-07-13T10:28:13.000Z","size":904,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-11T23:19:49.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Nhogs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["nhogs"]}},"created_at":"2022-05-09T08:30:54.000Z","updated_at":"2023-11-21T04:06:11.000Z","dependencies_parsed_at":"2022-09-19T05:20:53.505Z","dependency_job_id":null,"html_url":"https://github.com/Nhogs/nestjs-pinecone","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nhogs%2Fnestjs-pinecone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nhogs%2Fnestjs-pinecone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nhogs%2Fnestjs-pinecone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nhogs%2Fnestjs-pinecone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nhogs","download_url":"https://codeload.github.com/Nhogs/nestjs-pinecone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229610775,"owners_count":18098440,"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","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":"2024-10-04T23:06:07.559Z","updated_at":"2024-12-13T20:26:46.939Z","avatar_url":"https://github.com/Nhogs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/nhogs"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://nhogs.com\"\u003e\u003cimg src=\"https://nhogs.com/nhogs_64.png\" align=\"right\" alt=\"nhogs-logo\" title=\"NHOGS Interactive\"\u003e\u003c/a\u003e\n\n# @nhogs/nestjs-pinecone\n\n[![pinecone logo](pinecone-logo.svg)Pinecone.io](https://www.pinecone.io/)\nvector database module for nestjs\n\n[![npm peer dependency version NestJS)](https://img.shields.io/npm/dependency-version/@nhogs/nestjs-pinecone/peer/@nestjs/core?label=Nestjs\u0026logo=nestjs\u0026logoColor=e0234e)](https://github.com/nestjs/nest)\n\n## Installation\n\n[![npm](https://img.shields.io/npm/v/@nhogs/nestjs-pinecone?label=%40nhogs%2Fnestjs-pinecone\u0026logo=npm)](https://www.npmjs.com/package/@nhogs/nestjs-pinecone)\n\n```bash\n$ npm i --save @nhogs/nestjs-pinecone\n```\n\n## Usage\n\nSee [Pincone quickstart guide](https://www.pinecone.io/docs/quickstart/) for config details\n\n### Use module in NestJS app\n\n```typescript\n@Module({\n  imports: [\n    PineconeModule.register({\n      environment: 'YOUR_ENVIRONMENT', // Default is 'us-west1-gcp',\n      project: 'YOUR_PROJECT', // Project id\n      apiKey: 'YOUR_API_KEY', // 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',\n      index: 'YOUR_INDEX', // Optional index name\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### Async configuration example\n\n```typescript\n@Module({\n  imports: [\n    PineconeModule.registerAsync({\n      imports: [ConfigModule],\n      inject: [ConfigService],\n      useFactory: (configService: ConfigService): PineconeConfig =\u003e {\n        return {\n          index: configService.get('PINECONE_INDEX'),\n          project: configService.get('PINECONE_PROJECT'),\n          environment: configService.get('PINECONE_ENV'),\n          apiKey: configService.get('PINECONE_API_KEY'),\n        };\n      },\n    }),\n    ConfigModule.forRoot({\n      envFilePath: './your/env/file/path/.env',\n    }),\n  ],\n})\nexport class AsyncAppModule {}\n```\n\n## Index Operation Service\n\n```typescript\n@Injectable()\nexport class PineconeIndexService {\n  /**\n   * Check environment and make sure your Pinecone API key works.\n   */\n  whoAmI(): Observable\u003cWhoAmIResult\u003e {}\n\n  /**\n   * This operation returns a list of your Pinecone indexes.\n   */\n  listIndexes(): Observable\u003cstring[]\u003e {}\n\n  /**\n   * Get a description of an index.\n   * @param indexName or default index set in config\n   */\n  describeIndex(indexName?: string): Observable\u003cIndexDescriptionResult\u003e {}\n}\n```\n\n## Vector Operation Service\n\n```typescript\n@Injectable()\nexport class PineconeVectorService {\n  /**\n   * The DescribeIndexStats operation returns statistics about the index's contents.\n   * @param index index name\n   */\n  describeIndexStats(index?: string): Observable\u003cIndexStatsResult\u003e {}\n\n  /**\n   * The Query operation searches a namespace, using one or more query vectors. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.\n   * @param query\n   * @param index\n   */\n  query(query: Query, index?: string): Observable\u003cQueryResults\u003e {}\n\n  /**\n   * The Delete operation deletes vectors, by id, from a single namespace. You can delete items by their id, from a single namespace.\n   * @param del\n   * @param index\n   */\n  delete(del: Delete, index?: string): Observable\u003cDeleteResult\u003e {}\n\n  /**\n   * The Fetch operation looks up and returns vectors, by id, from a single namespace. The returned vectors include the vector data and/or metadata.\n   * @param fetch\n   * @param index\n   */\n  fetch(fetch: Fetch, index?: string): Observable\u003cFetchResult\u003e {}\n\n  /**\n   * The Update operation updates vector in a namespace. If a value is included, it will overwrite the previous value. If a set_metadata is included, the values of the fields specified in it will be added or overwrite the previous value.\n   * @param update\n   * @param index\n   */\n  update(update: Update, index?: string): Observable\u003cUpdateResult\u003e {}\n\n  /**\n   * The Upsert operation writes vectors into a namespace. If a new value is upserted for an existing vector id, it will overwrite the previous value.\n   * @param upsert\n   * @param index\n   */\n  upsert(upsert: Upsert, index?: string): Observable\u003cUpsertResult\u003e {}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhogs%2Fnestjs-pinecone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhogs%2Fnestjs-pinecone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhogs%2Fnestjs-pinecone/lists"}