{"id":16227330,"url":"https://github.com/malipetek/semantic-router","last_synced_at":"2026-01-20T13:02:04.992Z","repository":{"id":221881659,"uuid":"755622153","full_name":"malipetek/semantic-router","owner":"malipetek","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-31T06:38:10.000Z","size":125,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-04T09:20:07.530Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malipetek.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-10T18:58:26.000Z","updated_at":"2025-12-31T06:38:13.000Z","dependencies_parsed_at":"2024-02-10T19:42:44.088Z","dependency_job_id":"4c657f04-3fbc-488b-83f2-e87589a561c9","html_url":"https://github.com/malipetek/semantic-router","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"c0b66c37c3f84789310f2412c0fb69ab948ef507"},"previous_names":["malipetek/semantic-router"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/malipetek/semantic-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malipetek%2Fsemantic-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malipetek%2Fsemantic-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malipetek%2Fsemantic-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malipetek%2Fsemantic-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malipetek","download_url":"https://codeload.github.com/malipetek/semantic-router/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malipetek%2Fsemantic-router/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28603404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T12:01:53.233Z","status":"ssl_error","status_checked_at":"2026-01-20T12:01:46.545Z","response_time":117,"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":"2024-10-10T12:52:26.885Z","updated_at":"2026-01-20T13:02:04.975Z","avatar_url":"https://github.com/malipetek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semantic Router JS\n\nA semantic router using fastembed. WIP but looks like working fine.\n\n## Installation\n\nYou can install the package using npm:\n\n```bash\nnpm install @malipetek/semantic-router\n```\n\n```bash\nyarn add @malipetek/semantic-router\n```\n\n```bash\npnpm add @malipetek/semantic-router\n```\n\n## Usage\n```javascript\nimport semantic from'@malipetek/semantic-router';\n// mimicing express syntax not very useful tho\nconst app = semantic();\n\napp.on('toolcall', [\n  'use the tool',\n  'retrieve data from database',\n  'look up from files',\n  'read the file'\n], () =\u003e {\n  console.log('A tool was called');\n});\n\n  await app.route('we need to query database for this information, we might need to use a tool'); // callback gets called\n```\nAlternate usage:\n```javascript\nimport semantic from'@malipetek/semantic-router';\n// mimicing express syntax not very useful tho\nconst app = semantic();\n\napp.on('toolcall', [\n  'use the tool',\n  'retrieve data from database',\n  'look up from files',\n  'read the file'\n]);\n\n  const result = await app.route('we need to query database for this information, we might need to use a tool'); \n\n  console.log(result); // result will be Route onject with name, do whatever you want with it\n  /**\n   * {\n   *  name: 'toolcall',\n   *  data: [\n   *    'use the tool',\n   *    'retrieve data from database',\n   *    'look up from files',\n   *    'read the file'\n   *  ]\n   * }\n   */\n```\n## FastEmbed unzip issue\nWhen you run router for the first time fastembed will download and unzip the model for creating vector embeddings, sometimes `tar` command fails to unzip all files in the archive. This is a known issue.\n\nIf you encounter this error, look up `local_cache` folder in your project directory. If the folder next to the `tar.gz` file only has 2 files, delete the folder and unzip the tar.gz manually.\n```\nthrow new Error(`Tokenizer file not found at ${tokenizerPath}`);\n```\nFaulty folder:\n![Folder missing some files](image.png)\n\nCorrect folder:\n![Alt text](image-3.png)\n\n### Warning\nDo not forget to add `local_cache` folder to .gitignore, it aint small:\n  ![Size of uncompressed model folder](image-2.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalipetek%2Fsemantic-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalipetek%2Fsemantic-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalipetek%2Fsemantic-router/lists"}