{"id":22773770,"url":"https://github.com/moekiorg/active_pinecone","last_synced_at":"2025-08-09T10:31:28.576Z","repository":{"id":176491035,"uuid":"657885014","full_name":"moekiorg/active_pinecone","owner":"moekiorg","description":"ActiveRecord-esque base class that lets you use Pinecone. Enjoy development with LLM and Rails!","archived":false,"fork":false,"pushed_at":"2023-11-06T02:41:47.000Z","size":37,"stargazers_count":12,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-08T05:45:09.840Z","etag":null,"topics":["activerecord","ai","chatgpt","embedding","gem","llm","openai","pinecone","rails","ruby"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/active_pinecone","language":"Ruby","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/moekiorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-06-24T05:34:04.000Z","updated_at":"2024-11-24T13:50:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe0311e6-220d-4312-8dc9-9cc65cf1a057","html_url":"https://github.com/moekiorg/active_pinecone","commit_stats":null,"previous_names":["moekidev/active_pinecone","kawakamimoeki/active_pinecone","hackluckcat/active_pinecone"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moekiorg%2Factive_pinecone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moekiorg%2Factive_pinecone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moekiorg%2Factive_pinecone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moekiorg%2Factive_pinecone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moekiorg","download_url":"https://codeload.github.com/moekiorg/active_pinecone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229269494,"owners_count":18046820,"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":["activerecord","ai","chatgpt","embedding","gem","llm","openai","pinecone","rails","ruby"],"created_at":"2024-12-11T17:59:52.943Z","updated_at":"2024-12-11T17:59:53.557Z","avatar_url":"https://github.com/moekiorg.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActivePinecone\n\n![v](https://badgen.net/rubygems/v/active_pinecone)\n![dt](https://badgen.net/rubygems/dt/active_pinecone)\n![license](https://badgen.net/github/license/moekidev/active_pinecone)\n\nActiveRecord-esque base class that lets you use Pinecone.\nEnjoy development with LLM and Rails!\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add active_pinecone\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install active_pinecone\n\n## Usage\n\n### Configuration\n\nInitialize AcitvePinecone configuration.\n\n```ruby\nActivePinecone.configure do |config|\n  config.openai_access_token = ENV.fetch(\"OPENAI_ACCESS_TOKEN\")\n  config.pinecone_api_key = ENV.fetch(\"PINECONE_API_KEY\")\n  config.pinecone_environment = ENV.fetch(\"PINECONE_ENVIRONMENT\")\nend\n```\n\n### Model\n\nDefine a model.\n\n```ruby\nclass Recipe \u003c ActivePinecone::Base\n  vectorizes :title, :body\nend\n```\n\n### Initialize\n\nCreate Pinecone index. Index initialization takes a few minutes.\n\n```ruby\nRecipe.init\n```\n\n\n### Create\n\nPinecone index `Recipe` is created automatically.\n\n```ruby\nrecipe = Recipe.create(\n  title: \"Example recipe\",\n  body: \"This is an example.\",\n  author: \"Kevin\" # not vectorized\n)\n\np recipe.id\n# =\u003e b49859ba-1956-4212-8dd4-1b45b3e4e240\n```\n\n### Update\n\n```ruby\nrecipe = Recipe.find(id)\nrecipe.update(body: \"This will be changed.\")\n\np recipe.body\n# =\u003e \"This will be changed.\"\n```\n\n### Search\n\n```ruby\nrecipes = Recipe.search(\"Example\")\n\np recipes.first.title\n# =\u003e  \"Example recipe\"\n```\n\n### Assistant\n\nAssistant search vector data by **ALL** conversation history and reply.\n\n```ruby\nassistant = Recipe.assistant([\n  \"You are the assistant who answers the user's questions about the recipe.\",\n  \"The list of recipes is as follows:\"\n].join(\"\\n\"))\n\nreply = assistant.reply(\"How to make a hamburger?\")\n\np reply.role\n# =\u003e \"assistant\"\n\np reply.content\n# =\u003e \"I don't know.\"\n\np reply.references\n# [#\u003cRecipe:0x000...\u003e, ...]\n\np assistant.messages\n# =\u003e [#\u003cActivePinecone::Message:0x000...\u003e, ...]\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/moekidev/active_pinecone. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/active_pinecone/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the ActivePinecone project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/active_pinecone/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoekiorg%2Factive_pinecone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoekiorg%2Factive_pinecone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoekiorg%2Factive_pinecone/lists"}