{"id":24746438,"url":"https://github.com/Dripfarm/SVDB","last_synced_at":"2025-10-10T14:32:49.464Z","repository":{"id":186197232,"uuid":"674804053","full_name":"Dripfarm/SVDB","owner":"Dripfarm","description":"Swift Vector Database. On-device, local vector database for building the next-generation of user experiences","archived":false,"fork":false,"pushed_at":"2023-08-07T17:35:26.000Z","size":19,"stargazers_count":155,"open_issues_count":3,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-28T04:06:40.011Z","etag":null,"topics":["embeddings","llm","swift","vector-database","vector-db"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/Dripfarm.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":"2023-08-04T20:30:08.000Z","updated_at":"2025-01-27T07:24:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"72e0c393-0243-4863-b165-9502fc973036","html_url":"https://github.com/Dripfarm/SVDB","commit_stats":null,"previous_names":["dripfarm/svdb"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Dripfarm/SVDB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dripfarm%2FSVDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dripfarm%2FSVDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dripfarm%2FSVDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dripfarm%2FSVDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dripfarm","download_url":"https://codeload.github.com/Dripfarm/SVDB/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dripfarm%2FSVDB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004176,"owners_count":26083688,"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-10-10T02:00:06.843Z","response_time":62,"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":["embeddings","llm","swift","vector-database","vector-db"],"created_at":"2025-01-28T04:06:39.077Z","updated_at":"2025-10-10T14:32:44.445Z","avatar_url":"https://github.com/Dripfarm.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Swift Vector Database (SVDB)\n\nA new fast local on-device vector database for Swift Apps.\n\nBuilt for those building the next-generation of user experiences only possible with on-device intelligence. \n\nLocal on-device vector databases are just the beginning. \n\n## Installation\nTo install it using the Swift Package Manager, either directly add it to your project using Xcode 11, or specify it as dependency in the Package.swift file:\n\n```\n// ...\ndependencies: [\n    .package(url: \"https://github.com/Dripfarm/SVDB.git\", from: \"1.0.0\"),\n],\n//...\n```\n\n\n## Usage\n\n### 1. Create Embeddings\n```\nlet document = \"cat\"\n```\n\n**ChatGPT:**\n\nI find [This Swift OpenAI package to be the best](https://github.com/MacPaw/OpenAI)\n\n```\nimport OpenAI\n\nfunc embed(text: String) async -\u003e [Double]? {\n\tlet query = EmbeddingsQuery(model: .textEmbeddingAda, input: text)\n\n\tlet result = try! await openAI.embeddings(query: query)\n\n\treturn result.data.first?.embedding\n}\n\nlet wordEmbedding = embed(text: document)\n```\n\n**NLEmbeddings**\n\n```\nimport NaturalLanguage\n\nlet embedding: NLEmbedding? = NLEmbedding.wordEmbedding(for: .english)\n\nlet wordEmedding = embedding?.vector(for: document) //returns double array\n```\n\n### 2. Add Documents\n\n```\nlet animalCollection = SVDB.shared.collection(\"animals\")\n\nSVDB.shared.addDocument(text: document, embedding: wordEmbedding)\n\n```\n\n### 3. Search\n\n```\nlet dogEmedding = embedding?.vector(for: \"dog\")\n\nlet results = animalCollection.search(query: dogEmedding)\n```\n\n## Demo\n\nCheck out the demo [Demo](https://github.com/Dripfarm/SVDB/tree/master/SVDBDemo)\n\n## Todo\nNot sure. I want to make it easier to add documents and take care of the embeddings for you. Any suggestions?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDripfarm%2FSVDB","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDripfarm%2FSVDB","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDripfarm%2FSVDB/lists"}