{"id":18523715,"url":"https://github.com/indexnetwork/dag-jose-vector-search","last_synced_at":"2025-07-09T03:06:24.863Z","repository":{"id":247311752,"uuid":"825098561","full_name":"indexnetwork/dag-jose-vector-search","owner":"indexnetwork","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-08T13:26:33.000Z","size":3068,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-17T05:41:14.633Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/indexnetwork.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}},"created_at":"2024-07-06T19:09:53.000Z","updated_at":"2024-07-08T13:26:37.000Z","dependencies_parsed_at":"2024-07-08T02:47:32.253Z","dependency_job_id":"0dd44ff1-2650-4383-8b91-938a4f39e750","html_url":"https://github.com/indexnetwork/dag-jose-vector-search","commit_stats":null,"previous_names":["indexnetwork/dag-jose-vector-search"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexnetwork%2Fdag-jose-vector-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexnetwork%2Fdag-jose-vector-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexnetwork%2Fdag-jose-vector-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexnetwork%2Fdag-jose-vector-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indexnetwork","download_url":"https://codeload.github.com/indexnetwork/dag-jose-vector-search/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209848,"owners_count":22032897,"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-11-06T17:37:16.545Z","updated_at":"2025-05-14T19:12:43.900Z","avatar_url":"https://github.com/indexnetwork.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dag-jose-vector-search\n\nThis project provides a web service for managing documents \u0026 vector indexes encoded in DAG-JOSE associated with decentralized identifiers (DIDs). It allows users to store, search, and manage documents and their corresponding vectors using hierarchical navigable small world (HNSW) graphs for efficient nearest neighbor search.\n\n\n\n## Usage\n\n\n### Running the service\n\nTo run the Vector Indexing Service using Docker, simply pull the image and run it.\n\n```shell\n# Pull the Docker image\ndocker pull public.ecr.aws/o7v8m7v2/indexnetwork/dag-jose-vector-search:latest-dev\n\n# Run the Docker container\ndocker run -p 3000:3000 public.ecr.aws/o7v8m7v2/indexnetwork/dag-jose-vector-search:latest-dev`\n```\n\nThis command will start the service, making it accessible at `http://localhost:3000`\n\n\n### Running the test script\n\nTo run the script with custom parameters, use the following command:\n\n\n`yarn test --server_url http://localhost:3000`\n\n\n\n### Methods\n\n#### 1. Generate Random User\n\nFor the convenience of testers, not for production use.\n\n```shell\ncurl -X GET http://localhost:3000/randomuser\n```\n\n#### 2. Encrypt a sample document with vectors.\n\nFor the convenience of testers, not for production use.\nThis service returns JWE object.\n\n```shell\ncurl -X POST http://localhost:3000/encrypt \\\n         -H \"Content-Type: application/json\" \\\n         -H \"Authorization: Bearer \u003cTOKEN\u003e\" \\\n         -d '{\n           \"vector\": [1, 2, 3, 4, 4],\n           \"document\": {\n             \"id\": \"kjzl6kcym7w8y8hh4cyi3hp83iz70gscpo06oa2kby8r31mum7txt534yjr7frn\",\n             \"conversationId\": \"kjzl6kcym7w8y7m4otsy2221w1ycvoxdkum02onyi9vd1x3vf8bc5f679fn50k0\",\n             \"controllerDID\": {\n               \"id\": \"did:key:z6MkmFfvAAMgh2zd6kscS73b6yyJFDNRr8h4EU7AhWnQtcXc\"\n             },\n             \"createdAt\": \"2024-07-05T18:36:24.407Z\",\n             \"updatedAt\": \"2024-07-05T18:36:35.225Z\",\n             \"deletedAt\": null,\n             \"name\": \"basic_assistant\",\n             \"role\": \"assistant\",\n             \"content\": \"Farcaster is a social network that has recently integrated with the decentralized semantic index...\"\n           }\n         }'\n```\n\n#### 3. Index Encrypted JWE\n\nStore a document alongside its vector embeddings using an authorized token. The token is a serialized DIDSession string, and the document is encrypted as a JWE.\n\n```shell\ncurl -X POST http://localhost:3000/index \\\n         -H \"Content-Type: application/json\" \\\n         -H \"Authorization: Bearer \u003cTOKEN\u003e\" \\\n         -d '{\n            \"jwe\": \u003cJWE\u003e\n         }'\n```\n\n#### Search\n\nSearch with vector and desired document count.\n\n```shell\ncurl -X POST http://localhost:3000/search \\\n         -H \"Content-Type: application/json\" \\\n         -H \"Authorization: Bearer \u003cTOKEN\u003e\" \\\n         -d '{\n               \"vector\": [1, 2, 3, 4, 4],\n               \"count\": 5\n             }'\n```\n\n#### Destroy\n\nDeletes all in-memory data associated with the user.\n\n```shell\ncurl -X DELETE http://localhost:3000/destroy \\\n         -H \"Authorization: Bearer \u003cTOKEN\u003e\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexnetwork%2Fdag-jose-vector-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findexnetwork%2Fdag-jose-vector-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexnetwork%2Fdag-jose-vector-search/lists"}