{"id":30862320,"url":"https://github.com/cdimascio/langchain-s3-cached-embeddings","last_synced_at":"2025-09-07T17:14:39.551Z","repository":{"id":270249439,"uuid":"909757786","full_name":"cdimascio/langchain-s3-cached-embeddings","owner":"cdimascio","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-29T17:32:13.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T18:30:03.270Z","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/cdimascio.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}},"created_at":"2024-12-29T17:31:18.000Z","updated_at":"2024-12-29T17:32:16.000Z","dependencies_parsed_at":"2024-12-29T18:40:34.182Z","dependency_job_id":null,"html_url":"https://github.com/cdimascio/langchain-s3-cached-embeddings","commit_stats":null,"previous_names":["cdimascio/langchain-s3-cached-embeddings"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cdimascio/langchain-s3-cached-embeddings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Flangchain-s3-cached-embeddings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Flangchain-s3-cached-embeddings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Flangchain-s3-cached-embeddings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Flangchain-s3-cached-embeddings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdimascio","download_url":"https://codeload.github.com/cdimascio/langchain-s3-cached-embeddings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Flangchain-s3-cached-embeddings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274066376,"owners_count":25216447,"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-09-07T02:00:09.463Z","response_time":67,"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":[],"created_at":"2025-09-07T17:14:26.887Z","updated_at":"2025-09-07T17:14:39.515Z","avatar_url":"https://github.com/cdimascio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# langchain-s3-cached-embeddings\n\nProxies _**any**_ langchain `Embeddings` class such as `OpenAIEmbeddings`, `GoogleGenerativeAIEmbeddings`, persisting all generated embeddings to S3. This allows subsequent calls to _optionally_ leverage the cached embeddings, avoiding additional and unecessary cost of re-embedding. \n## Install\n\n```bash\npip install langchain-s3-cached-embeddings\n```\n\n## Usage\n\n```python\nfrom langchain_s3_text_loaders import S3DirectoryLoader\n\n   embeddings = S3EmbeddingsConduit(\n        embeddings=OpenAIEmbeddings(model=model), # required\n        bucket=\"my-embeddings-bucket\", # required\n        prefix=\"my-optional-prefix\"\n    )\n\n```\n\n## Advanced Usage\n\n```python\n   embeddings = S3EmbeddingsConduit(\n        embeddings=OpenAIEmbeddings(model=model), # required\n        bucket=\"my-embeddings-bucket\", # required\n        prefix=\"my-optional-prefix\"\n        filenaming_function: Optional[Callable[[str, int], str]] = None,\n        cache_behavior = CacheBehavior.NO_CACHE):\n\n```\n\n## Usage Options\n\n- `embeddings` - (required) any class implementing `langchain_core.embeddings.Embeddings`\n- `bucket` - (required) the s3 bucket name\n- `prefix` - (required) the s3 key name\n- `filenaming_function` - (optional) redeives two arguments, 1. the file contents (`str`), 2. the index (`int`) e.g. `9` for the `10`the document and returns the filename ()`str`)\n- `cache_behavior` - (optional) \n    - `CacheBehavior.NO_CACHE` - do not use cached embeddings, instead embed using the `embeddings` class' standard `embed_documents(...)` method\n    - `CacheBehavior.ONLY_CACHE` - use cached embeddings. if the embeddings are no present, it raises an exception\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdimascio%2Flangchain-s3-cached-embeddings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdimascio%2Flangchain-s3-cached-embeddings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdimascio%2Flangchain-s3-cached-embeddings/lists"}