{"id":28930697,"url":"https://github.com/neuwcodebox/hipter-test","last_synced_at":"2025-07-05T06:07:13.777Z","repository":{"id":280241622,"uuid":"941393031","full_name":"neuwcodebox/hipter-test","owner":"neuwcodebox","description":"Hono + Kysely + pgVector + TEI로 힙하게 벡터 저장소 테스트.","archived":false,"fork":false,"pushed_at":"2025-04-19T06:45:32.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T05:06:49.975Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neuwcodebox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-03-02T07:11:44.000Z","updated_at":"2025-04-19T06:45:36.000Z","dependencies_parsed_at":"2025-06-21T05:06:52.845Z","dependency_job_id":"f4d8b68e-198d-4904-a464-afe553ed5b8c","html_url":"https://github.com/neuwcodebox/hipter-test","commit_stats":null,"previous_names":["neurowhai/hipter-test","neuwcodebox/hipter-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neuwcodebox/hipter-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuwcodebox%2Fhipter-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuwcodebox%2Fhipter-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuwcodebox%2Fhipter-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuwcodebox%2Fhipter-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuwcodebox","download_url":"https://codeload.github.com/neuwcodebox/hipter-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuwcodebox%2Fhipter-test/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261316084,"owners_count":23140396,"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":"2025-06-22T15:37:18.673Z","updated_at":"2025-07-05T06:07:13.764Z","avatar_url":"https://github.com/neuwcodebox.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hipter test\n\n힙하게 벡터 저장소 테스트.\n\n## Stacks\n\n- Hono: HTTP API 서버.\n- Kysely: 타입 안전한 쿼리 빌더.\n- PostgreSQL + pgVector: 벡터 DB.\n- [TEI](https://huggingface.co/docs/text-embeddings-inference/index): 임베딩, 리랭커 모델 서빙.\n\n## Examples\n\n### 문서 등록\n\n```sh\ncurl -X 'POST' \\\n  'http://localhost:3000/api/doc' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -d '{ \"content\": \"인공지능은 의료, 금융, 교육 등 다양한 분야에서 활용될 수 있다.\" }'\n```\n\n### 문서 검색\n\n#### 유사한 문서\n\n단순히 임베딩 벡터의 유사도로 필터링.\n\n```sh\ncurl -X 'POST' \\\n  'http://localhost:3000/api/doc-search/similar?content=AI를 어떻게 활용할 수 있을까? \\\n  -H 'accept: application/json'\n```\n\n```json\n[\n  {\n    \"id\": 26,\n    \"content\": \"인공지능은 의료, 금융, 교육 등 다양한 분야에서 활용될 수 있다.\",\n    \"score\": 0.6347189385033964\n  },\n  {\n    \"id\": 7,\n    \"content\": \"인공지능은 머신러닝과 딥러닝을 포함한 다양한 기술로 구성되어 있으며, 미래 산업에 큰 변화를 가져올 수 있다.\",\n    \"score\": 0.5480274884717169\n  },\n  {\n    \"id\": 5,\n    \"content\": \"안녕하세요.\",\n    \"score\": 0.4767405390739441\n  }\n]\n```\n\n#### 답변이 되는 문서\n\n임베딩 벡터의 유사도로 1차 검색 후 재순위화를 거쳐 2차 필터링.\n\n```sh\ncurl -X 'POST' \\\n  'http://localhost:3000/api/doc-search/qna?question=AI를 어떻게 활용할 수 있을까? \\\n  -H 'accept: application/json'\n```\n\n```json\n[\n  {\n    \"id\": 26,\n    \"content\": \"인공지능은 의료, 금융, 교육 등 다양한 분야에서 활용될 수 있다.\",\n    \"score\": 0.966156\n  },\n  {\n    \"id\": 7,\n    \"content\": \"인공지능은 머신러닝과 딥러닝을 포함한 다양한 기술로 구성되어 있으며, 미래 산업에 큰 변화를 가져올 수 있다.\",\n    \"score\": 0.14878775\n  },\n  {\n    \"id\": 6,\n    \"content\": \"안녕\",\n    \"score\": 0.000016187581\n  }\n]\n```\n\n## Development\n\n1. 저장소를 Clone 후 `npm i` 명령으로 종속성을 설치한다.\n2. `.env.template` 파일을 `.env`로 복사하고 내용을 적절히 수정한다.\n3. `docker compose -f docker-compose.dev.yml up -d` 명령으로 DB, TEI 등을 실행한다.\n4. `npm run dev` 명령으로 서버를 실행한다.\n5. 웹 브라우저에서 서버의 `/api-doc` 경로로 접속하여 Swagger UI를 통해 테스트한다.\n6. DB, TEI 종료하려면 `docker compose -f docker-compose.dev.yml down` 명령으로 컨테이너를 삭제한다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuwcodebox%2Fhipter-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuwcodebox%2Fhipter-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuwcodebox%2Fhipter-test/lists"}