{"id":15304245,"url":"https://github.com/deven96/ahnlich","last_synced_at":"2026-04-01T18:03:01.896Z","repository":{"id":237379099,"uuid":"794413452","full_name":"deven96/ahnlich","owner":"deven96","description":"Suite of tools containing an in-memory vector datastore and AI proxy","archived":false,"fork":false,"pushed_at":"2026-03-28T11:46:37.000Z","size":38422,"stargazers_count":185,"open_issues_count":27,"forks_count":18,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-28T15:31:54.585Z","etag":null,"topics":["artificial-intelligence","cache","cli","datastore","fastembed","golang","golang-library","inmemory-db","node-js","nodejs","python","python-library","rust","rust-library","storage","storage-engine","vector","vector-database"],"latest_commit_sha":null,"homepage":"http://ahnlich.dev/","language":"Rust","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/deven96.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2024-05-01T05:15:29.000Z","updated_at":"2026-03-28T11:38:04.000Z","dependencies_parsed_at":"2024-05-18T12:21:59.823Z","dependency_job_id":"09095603-dbee-4d45-adc4-b49ebecc30f4","html_url":"https://github.com/deven96/ahnlich","commit_stats":{"total_commits":192,"total_committers":5,"mean_commits":38.4,"dds":0.453125,"last_synced_commit":"a929a96799bf5edaea18b0ca849cccb344009d52"},"previous_names":["deven96/ahnlich"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/deven96/ahnlich","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven96%2Fahnlich","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven96%2Fahnlich/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven96%2Fahnlich/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven96%2Fahnlich/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deven96","download_url":"https://codeload.github.com/deven96/ahnlich/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deven96%2Fahnlich/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"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":["artificial-intelligence","cache","cli","datastore","fastembed","golang","golang-library","inmemory-db","node-js","nodejs","python","python-library","rust","rust-library","storage","storage-engine","vector","vector-database"],"created_at":"2024-10-01T07:54:57.064Z","updated_at":"2026-04-01T18:03:01.886Z","avatar_url":"https://github.com/deven96.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Ahnlich\n\u003cp align=\"left\"\u003e\u003cimg src=\"assets/logo.jpg\" alt=\"ahnlich\" height=\"120px\"\u003e\u003c/p\u003e\n\n[![All Test](https://github.com/deven96/ahnlich/actions/workflows/test.yml/badge.svg)](https://github.com/deven96/ahnlich/actions/workflows/test.yml)\n\n⚠️ **Note:** Ahnlich continues to evolve **rapidly**, and while stable for most use cases, it may still receive occasional breaking updates as features improve.\n\n \"ähnlich\" means similar in german. It comprises of multiple tools for usage and development such as:\n\n- [`ahnlich-db`](ahnlich/db): In-memory vector key value store for storing embeddings/vectors with corresponding metadata(key-value maps). It's a powerful system which enables AI/ML engineers to store and search similar vectors using linear (cosine, euclidean) or non-linear similarity (kdtree) algorithms. It also leverages search within metadata values to be able to filter out entries using metadata values. A simple example can look like\n```\nGETSIMN 2 WITH [0.2, 0.1] USING cosinesimilarity IN my_store WHERE (page != hidden)\n\n// example query\nget_sim_n(\n    store=\"my_store\",\n    search_input=[0.2, 0.1],\n    closest_n=2,\n    algorithm=CosineSimilarity,\n    condition=Predicate::NotEquals{\n      key=\"page\",\n      value=\"hidden\",\n  },\n)\n```\n- [`ahnlich-ai`](ahnlich/ai/): AI proxy to communicate with `ahnlich-db`, receiving raw input, transforming into embeddings, and storing within the DB. It extends the capabilities by then allowing developers/engineers to issue queries to the same store using raw input such as images/text. It features multiple off-the-shelf models that can be selected for store index and query.\n```\nCREATESTORE my_store QUERYMODEL all-minilm-l6-v2 INDEXMODEL all-minilm-l6-v2\n\n// example query\ncreate_store(\n    store=\"my_store\",\n    index_model=\"all-minilm-l6-v2\",\n    query_model=\"all-minilm-l6-v2\",\n)\n```\n- [`ahnlich-client-rs`](ahnlich/client/): Rust client for `ahnlich-db` and `ahnlich-ai`.\n- [`ahnlich-client-py`](sdk/ahnlich-client-py/): Python client for `ahnlich-db` and `ahnlich-ai`.\n- [`ahnlich-client-go`](sdk/ahnlich-client-go/): Go client for `ahnlich-db` and `ahnlich-ai`.\n- [`ahnlich-client-node`](sdk/ahnlich-client-node/): Node.js/TypeScript client for `ahnlich-db` and `ahnlich-ai`.\n\n- [`ahnlich-cli`](ahnlich/cli/): CLI for querying `ahnlich-db` and `ahnlich-ai`\n\n\n## Architecture\n\n```mermaid\nflowchart TD\n  subgraph ai [ahnlich‑ai]\n    direction TB\n    AIClient[\"AI Client\"]\n    StoreHandlerAI[\"Store Handler\"]\n    StoreA_AI[\"Store A\"]\n    ModelNode[\"Index Model → Model B\u003cbr/\u003eQuery Model → Model A\u003cbr/\u003ePreprocess Method\"]\n    PersistenceAI[(Persistence)]\n    \n    AIClient --\u003e |\"original + metadata\"| StoreHandlerAI\n    StoreHandlerAI --\u003e StoreA_AI\n    StoreA_AI --\u003e ModelNode\n    ModelNode -.-\u003e PersistenceAI\n    class PersistenceAI optionalNode\n  end\n\n  subgraph db [ahnlich‑db]\n    direction TB\n    DBClient[\"DB Client\"]\n    StoreHandlerDB[\"Store Handler\"]\n    StoreA_DB[\"Store A\"]\n    PersistenceDB[(Persistence)]\n    \n    DBClient --\u003e |\"DB query\"| StoreHandlerDB\n    StoreHandlerDB --\u003e StoreA_DB\n    StoreA_DB -.-\u003e PersistenceDB\n    class PersistenceDB optionalNode\n  end\n\n  %% Interactions between services\n  StoreHandlerAI -.-\u003e |\"Set: vector + metadata\"| StoreHandlerDB\n  StoreHandlerAI -.-\u003e |\"GetSimN: vector\"| StoreHandlerDB\n  StoreHandlerDB -.-\u003e |\"TopN results\"| StoreHandlerAI\n\n  classDef optionalNode stroke-dasharray: 5 5, color: gray, stroke: gray;\n  class PersistenceAI,PersistenceDB optionalNode\n```\n\n\n## Usage\n\n`ahnlich-db`, `ahnlich-ai` and `ahnlich-cli` are packaged and released as [binaries](https://github.com/deven96/ahnlich/releases) for multiple platforms alongside [docker images](https://github.com/deven96?tab=packages\u0026repo_name=ahnlich)\n\nThe DB can be used without the AI proxy for more fine grained control of the generated vector embeddings as all clients support both\n\n### Docker Images.\n\n`Note`: \n1. Arguments and commands must be passed in quotes. E.G: `docker run \u003cimage_name\u003e \"ahnlich-db run --enable-tracing --port 8000\"`\n\n2. The CLI comes packaged into the docker images.\n\n---\n\n### Installation  \n\n#### Download Binaries  \n\nYou can download the Ahnlich binaries for `ai` and `db` from [GitHub Releases](https://github.com/deven96/ahnlich/releases).  \n\n- **`wget`:**  \n  ```bash  \n  wget https://github.com/deven96/ahnlich/releases/download/bin%2Fdb%2F0.0.0/aarch64-darwin-ahnlich-db.tar.gz  \n  ```  \n\n- **Extract the file:**  \n  ```bash  \n  tar -xvzf aarch64-darwin-ahnlich-db.tar.gz  \n  ```  \n\n- **Run the binary:**  \n  ```bash  \n  ./ahnlich-db  \n  ```  \n\nReplace `aarch64-darwin-ahnlich-db.tar.gz` with the appropriate file name for your architecture. For `ai`, download the corresponding `ai` binary, extract it, and run it using `./ahnlich-ai`.  \n\n---\n\n#### Using Docker  \n\nYou can pull the prebuilt Docker images for Ahnlich:  \n\n- **Ahnlich AI**:  \n  ```bash  \n  docker pull ghcr.io/deven96/ahnlich-ai:latest  \n  ```  \n\n- **Ahnlich DB**:  \n  ```bash  \n  docker pull ghcr.io/deven96/ahnlich-db:latest  \n  ```  \n\n---\n\n#### Example Docker Compose  \n\nBelow is an example `docker-compose.yaml` configuration to run both `ahnlich-db` and `ahnlich-ai` with tracing:  \n\n```yaml   \nservices:\n  ahnlich_db:\n    image: ghcr.io/deven96/ahnlich-db:latest\n    command: \u003e\n      \"ahnlich-db run --host 0.0.0.0 \\\n      --enable-tracing \\\n      --otel-endpoint http://jaeger:4317\"\n    ports:\n      - \"1369:1369\"\n\n  ahnlich_ai:\n    image: ghcr.io/deven96/ahnlich-ai:latest\n    command: \u003e\n      \"ahnlich-ai run --db-host ahnlich_db --host 0.0.0.0 \\\n      --supported-models all-minilm-l6-v2,resnet-50 \\\n      --enable-tracing \\\n      --otel-endpoint http://jaeger:4317\"\n    ports:\n      - \"1370:1370\"\n\n  # optional jaeger service whenever --enable-tracing and\n  # --otel-endpoint is used\n  jaeger:\n    image: jaegertracing/all-in-one:${JAEGER_VERSION:-latest}\n    ports:\n      - \"16686:16686\"\n      - \"1888:1888\" # pprof extension\n      - \"8888:8888\" # Prometheus metrics exposed by the collector\n      - \"8889:8889\" # Prometheus exporter metrics\n      - \"4317:4317\" # otlp grpc\n      - \"4318:4318\" # otlp http\n```\n\nBelow is an example `docker-compose.yaml` configuration with persistence:\n\n```yaml\n\nservices:\n  ahnlich_db:\n    image: ghcr.io/deven96/ahnlich-db:latest\n    command: \u003e\n      \"ahnlich-db run --host 0.0.0.0 \\\n      --enable-persistence --persist-location /root/.ahnlich/data/db.dat \\\n      --persistence-interval 300\"\n    ports:\n      - \"1369:1369\"\n    volumes:\n      - \"./data/:/root/.ahnlich/data\" # Persistence Location\n\n  ahnlich_ai:\n    image: ghcr.io/deven96/ahnlich-ai:latest\n    command: \u003e\n      \"ahnlich-ai run --db-host ahnlich_db --host 0.0.0.0 \\\n      --supported-models all-minilm-l6-v2,resnet-50 \\\n      --enable-persistence --persist-location /root/.ahnlich/data/ai.dat \\\n      --persistence-interval 300\"\n    ports:\n      - \"1370:1370\"\n    volumes:\n      - \"./ahnlich_ai_model_cache:/root/.ahnlich/models\" # Model cache storage\n      - \"./data/:/root/.ahnlich/data\" # Persistence Location\n\n```\n\nBelow is an example `docker-compose.yaml` configuration with health checks using the CLI in non-interactive mode:\n\n```yaml\n\nservices:\n  ahnlich_db:\n    image: ghcr.io/deven96/ahnlich-db:latest\n    command: \u003e\n      \"ahnlich-db run --host 0.0.0.0\"\n    ports:\n      - \"1369:1369\"\n    healthcheck:\n      test: [\"CMD-SHELL\", \"echo 'PING' | ahnlich-cli ahnlich --agent db --host 127.0.0.1 --port 1369 --no-interactive\"]\n      interval: 10s\n      timeout: 5s\n      retries: 3\n      start_period: 5s\n\n  ahnlich_ai:\n    image: ghcr.io/deven96/ahnlich-ai:latest\n    command: \u003e\n      \"ahnlich-ai run --db-host ahnlich_db --host 0.0.0.0 \\\n      --supported-models all-minilm-l6-v2\"\n    ports:\n      - \"1370:1370\"\n    depends_on:\n      ahnlich_db:\n        condition: service_healthy\n    healthcheck:\n      test: [\"CMD-SHELL\", \"echo 'PING' | ahnlich-cli ahnlich --agent ai --host 127.0.0.1 --port 1370 --no-interactive\"]\n      interval: 10s\n      timeout: 5s\n      retries: 3\n      start_period: 10s\n\n```\n\nThe `--no-interactive` flag allows the CLI to accept commands via stdin and exit immediately after processing, making it ideal for Docker health checks, CI/CD pipelines, and automated scripts.\n\n### Execution Providers (Ahnlich AI)\n\n- `CUDA`: Only supports \u003e= CUDAv12 and might need to `sudo apt install libcudnn9-dev-cuda-12`\n- `CoreML (Apple)`: Not advised for NLP models due to often large dimensionality.\n\n### Contributing\n\nView [contribution guide](CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeven96%2Fahnlich","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeven96%2Fahnlich","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeven96%2Fahnlich/lists"}