Goal: Help an agent install and run ELF locally with minimal back-and-forth.
Read this when: You need a practical local setup flow from an existing repository checkout.
Inputs: This repository checkout plus access to local Postgres, Qdrant, and provider credentials.
Depends on: Makefile.toml, elf.example.toml, and docs/guide/getting_started.md.
Verification: ELF services start, required dependencies are reachable, and the local workflow can continue.
This guide is written for AI agents helping a human operator install and run ELF locally with minimal back-and-forth. It assumes you have access to this repository checkout.
ELF is a Rust workspace that typically runs:
elf-api: HTTP API service.elf-worker: background worker that indexes notes into Qdrant.elf-mcp(optional): an MCP server that forwards toelf-api.elf-eval(optional): an evaluation tool for retrieval quality.
ELF requires:
- Postgres with
pgvector(source of truth). - Qdrant (derived index; safe to rebuild).
Important: The ELF config has no implicit defaults. All required config fields must be explicitly present in your TOML.
Ask the owner for:
- Postgres DSN for the target database (for example
postgres://user:pass@host:5432/elf). - Qdrant endpoints:
- REST base URL (default Qdrant REST:
http://127.0.0.1:6333). - gRPC base URL (default Qdrant gRPC:
http://127.0.0.1:6334).
- REST base URL (default Qdrant REST:
- Provider choices:
- Embedding provider config.
- Rerank provider config.
- LLM extractor provider config (required by config; only needed at runtime if the operator uses
add_eventor other LLM-backed features).
- Whether
elf-apishould bind only to loopback, and whether to enable API/admin auth tokens.
If the owner cannot provide provider endpoints/keys yet, you can still run a local-only development setup for embedding and rerank by setting:
providers.embedding.provider_id = "local"providers.rerank.provider_id = "local"
Then set search.expansion.mode = "off" to avoid LLM-backed query expansion. The extractor config must still be present and non-empty, but should not be used in this mode.
The machine must have:
- Rust toolchain (pinned by
rust-toolchain.toml). psqlavailable on PATH.- Running Postgres instance with
pgvectorinstalled/enabled. - Running Qdrant instance.
For the repository harness scripts:
curljqorjaqtaplo
- Copy the template:
cp elf.example.toml elf.toml- Edit
elf.toml:
- Set
[storage.postgres].dsnto your Postgres DSN. - Set
[storage.qdrant].urlto your Qdrant gRPC base URL. - Set
[storage.qdrant].collectionto a collection name (for examplemem_notes_v2). - Ensure
[chunking].tokenizer_repois a non-empty Hugging Face tokenizer repo name (for examplegpt2). - Fill all
[providers.*]blocks. Keys must be non-empty strings. - Set
security.auth_modeexplicitly:- Use
"off"only for local loopback development. - Use
"static_keys"with non-emptysecurity.auth_keysfor authenticated access (Authorization: Bearer <token>).
- Use
- Initialize Postgres schema:
psql "<dsn from elf.toml>" -f sql/init.sql- Initialize the Qdrant collection (REST):
export ELF_QDRANT_HTTP_URL="http://127.0.0.1:6333"
export ELF_QDRANT_COLLECTION="mem_notes_v2"
export ELF_QDRANT_VECTOR_DIM="4096"
./qdrant/init.shNotes:
- Qdrant REST and gRPC ports often differ. The
ELF_QDRANT_HTTP_URLabove must be the REST base URL. storage.qdrant.urlinelf.tomlmust be the gRPC base URL.- The Qdrant vector dimension must match the embedding dimension configured in
elf.toml.
Start each in a separate terminal:
cargo run -p elf-worker -- -c elf.toml
cargo run -p elf-api -- -c elf.tomlOptional:
cargo run -p elf-mcp -- -c elf.tomlcurl -fsS http://127.0.0.1:51892/healthAdjust the port to match service.http_bind.
The context misranking harness creates and drops a dedicated database and Qdrant collection. It requires:
ELF_PG_DSN(a base DSN that typically ends with/postgres)ELF_QDRANT_GRPC_URL(Qdrant gRPC base URL)ELF_QDRANT_HTTP_URL(Qdrant REST base URL)
Example:
ELF_PG_DSN="postgres://postgres:postgres@127.0.0.1:51888/postgres" \
ELF_QDRANT_GRPC_URL="http://127.0.0.1:51890" \
ELF_QDRANT_HTTP_URL="http://127.0.0.1:51889" \
cargo make e2e- Config parse errors:
- ELF config has no implicit defaults. Fix missing fields in the TOML (the error message will name the missing field).
- API never becomes healthy:
- Check the API log and confirm Postgres and Qdrant are reachable.
- Qdrant collection errors:
- Confirm the REST URL is correct, and rerun
./qdrant/init.sh.
- Confirm the REST URL is correct, and rerun