{"id":35034309,"url":"https://github.com/pgvector/pgvector-prolog","last_synced_at":"2026-04-04T04:38:13.746Z","repository":{"id":325872230,"uuid":"1102663118","full_name":"pgvector/pgvector-prolog","owner":"pgvector","description":"pgvector examples for Prolog","archived":false,"fork":false,"pushed_at":"2025-11-23T21:55:26.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-04T04:38:08.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Prolog","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/pgvector.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-23T21:21:20.000Z","updated_at":"2025-11-23T21:55:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pgvector/pgvector-prolog","commit_stats":null,"previous_names":["pgvector/pgvector-prolog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pgvector/pgvector-prolog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgvector%2Fpgvector-prolog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgvector%2Fpgvector-prolog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgvector%2Fpgvector-prolog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgvector%2Fpgvector-prolog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgvector","download_url":"https://codeload.github.com/pgvector/pgvector-prolog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgvector%2Fpgvector-prolog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31388168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-12-27T07:31:37.244Z","updated_at":"2026-04-04T04:38:13.741Z","avatar_url":"https://github.com/pgvector.png","language":"Prolog","funding_links":[],"categories":["Sdks \u0026 Libraries"],"sub_categories":[],"readme":"# pgvector-prolog\n\n[pgvector](https://github.com/pgvector/pgvector) examples for Prolog\n\nSupports [postgresql-prolog](https://github.com/aarroyoc/postgresql-prolog)\n\n[![Build Status](https://github.com/pgvector/pgvector-prolog/actions/workflows/build.yml/badge.svg)](https://github.com/pgvector/pgvector-prolog/actions)\n\n## Getting Started\n\nFollow the instructions for your database library:\n\n- [postgresql-prolog](#postgresql-prolog)\n\n## postgresql-prolog\n\nEnable the extension\n\n```prolog\npostgresql:query(Connection, \"CREATE EXTENSION IF NOT EXISTS vector\", ok)\n```\n\nCreate a table\n\n```prolog\npostgresql:query(Connection, \"CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3))\", ok)\n```\n\nInsert vectors\n\n```prolog\npostgresql:sql(Connection, [insert_into(items, [embedding]), values(\"[1,2,3]\")], data([]))\n```\n\nGet the nearest neighbors\n\n```prolog\npostgresql:query(Connection, \"SELECT * FROM items ORDER BY embedding \u003c-\u003e '[3,1,2]' LIMIT 5\", Rows)\n```\n\nAdd an approximate index\n\n```prolog\npostgresql:query(Connection, \"CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)\", ok)\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](example.pl)\n\n## Contributing\n\nEveryone is encouraged to help improve this project. Here are a few ways you can help:\n\n- [Report bugs](https://github.com/pgvector/pgvector-prolog/issues)\n- Fix bugs and [submit pull requests](https://github.com/pgvector/pgvector-prolog/pulls)\n- Write, clarify, or fix documentation\n- Suggest or add new features\n\nTo get started with development:\n\n```sh\ngit clone https://github.com/pgvector/pgvector-prolog.git\ncd pgvector-prolog\ncreatedb pgvector_prolog_test\nscryer-prolog example.pl -g \"main,halt.\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgvector%2Fpgvector-prolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgvector%2Fpgvector-prolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgvector%2Fpgvector-prolog/lists"}