{"id":17696843,"url":"https://github.com/datashaman/bail","last_synced_at":"2025-03-31T00:40:48.604Z","repository":{"id":224187376,"uuid":"762648715","full_name":"datashaman/bail","owner":"datashaman","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-25T11:26:07.000Z","size":166,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T05:43:43.110Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/datashaman.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-02-24T09:51:52.000Z","updated_at":"2024-02-24T09:52:05.000Z","dependencies_parsed_at":"2024-10-24T17:50:09.083Z","dependency_job_id":"3c3c18a3-dd58-4b41-9867-5bdfcb934099","html_url":"https://github.com/datashaman/bail","commit_stats":null,"previous_names":["datashaman/bail"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datashaman%2Fbail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datashaman%2Fbail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datashaman%2Fbail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datashaman%2Fbail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datashaman","download_url":"https://codeload.github.com/datashaman/bail/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246399800,"owners_count":20770907,"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-24T14:45:30.174Z","updated_at":"2025-03-31T00:40:48.582Z","avatar_url":"https://github.com/datashaman.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bail\n\nPOC semantic search for _Laravel_ and _PostgreSQL_ with _pgvector_. _OpenAI_'s `text-embedding-3-small` model is used for the embeddings.\n\nEmbedding responses are cached for 7 days to avoid repeated calls with the same content.\n\n## requirements\n\n* postgresql 14+\n* _OpenAI_ API key\n\n## setup\n\n```\ncomposer install\ncp .env.example .env\n$EDITOR .env // set your OpenAI api key\nphp artisan migrate\n```\n\n## seed\n\nThere are some basic documents in the seeders. You can index your own documents (see below).\n```\nphp artisan db:seed\n```\n\n## commands\n\n### index\n\n```\nDescription:\n  Index documents.\n\nUsage:\n  index [options] [--] \u003cfilename\u003e\n\nArguments:\n  filename              The filename of the documents to index\n\nOptions:\n      --chunk[=CHUNK]   Chunk size of the documents [default: \"5\"]\n      --limit[=LIMIT]   Limit the number of documents to index\n      --delete          Delete all documents before indexing\n```\n\nwhere `filename` is a JSON file with the following structure:\n```json\n[\n    {\n      \"content\": \"This is a document\",\n      \"meta\": {\n          \"key1\": \"value1\"\n      }\n    },\n    {\n      \"content\": \"This is another document\",\n      \"meta\": {\n          \"key2\": \"value2\"\n      }\n    }\n]\n```\n\n### search\n\n```\nDescription:\n  Search documents\n\nUsage:\n  search [options] [--] \u003cquery\u003e...\n\nArguments:\n  query                      The query to search for\n\nOptions:\n      --per-page[=PER-PAGE]  The number of results to return per page [default: \"10\"]\n      --page[=PAGE]          The page number to return [default: \"1\"]\n      --embedding            Use pgvector search, default is text search\n```\n\nFor example:\n```\nphp artisan search I want a big house with a huge kitchen\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatashaman%2Fbail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatashaman%2Fbail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatashaman%2Fbail/lists"}