# klieo-embed-common

Shared Embedder trait + DummyEmbedder / FakeEmbedder for klieo memory backends.

Part of the [klieo](https://crates.io/crates/klieo) Rust agent framework.

## Features

- `Embedder` trait: single contract for all embedding providers used by klieo memory crates
- `DummyEmbedder` (zeros) and `FakeEmbedder` (deterministic random) for tests
- Internal crate: consumed by `klieo-memory-sqlite` and `klieo-memory-qdrant`

## Usage

Most callers don't depend on this crate directly — `MemorySqlite::open(path)`
and `MemoryQdrant::connect(url)` already bake in `DummyEmbedder` for
zero-config use. Reach for `klieo-embed-common` only when you implement
the `Embedder` trait yourself or need `FakeEmbedder` for tests.

```toml
[dependencies]
klieo-embed-common = "2"
```

```rust,no_run
use klieo_embed_common::{DummyEmbedder, Embedder};
use std::sync::Arc;

let embedder: Arc<dyn Embedder> = Arc::new(DummyEmbedder);
```

Pass the resulting `Arc<dyn Embedder>` to any memory backend's custom
constructor — e.g. `MemorySqlite::new(path, embedder)` or
`MemoryQdrant::new(QdrantConfig::new(url), embedder)` — when the
default `DummyEmbedder` baked into `::open` / `::connect` isn't what
you want.

## Status

`2.x` — stable.
See [`docs/SEMVER.md`](https://github.com/mohrimic/klieo/blob/main/docs/SEMVER.md).

## License

MIT — see [`LICENSE`](https://github.com/mohrimic/klieo/blob/main/LICENSE).
