Open Fast Lookup

OFL: a deterministic, low-latency search standard for databases.

View on GitHub Read the Specification

A fast search standard for databases

Open Fast Lookup (OFL) is a deterministic, low-latency search standard and reference implementation, built by XPDevs.

OFL provides an open standard for deterministic, low-latency search over local files and structured records without relying on AI or remote services. Results are explainable, indexes are committed crash-safely with SHA-256 checksums, and hot queries are designed to answer in under 2 ms.

Deterministic results Sub-2ms hot queries No AI, no ML, no embeddings Local-first Apache-2.0 licensed Node >= 18

Features

Deterministic results

Search output is structured and repeatable: the same query over the same index always produces the same ranked results, with no opaque model in the loop.

Index-first architecture

Built for sub-2ms hot queries by keeping index segments hot and answering from prebuilt structures rather than scanning data at query time.

Local-first

No remote dependencies. Your data, your index and your queries stay on your machine, so OFL works fully offline.

No AI, no ML, no embeddings

Ranking is arithmetic, not inference. Every score can be traced back to the terms and index structures that produced it.

Structured SearchOutput

A single SearchOutput contract is shared by the library, the CLI and the daemon, so results are portable between all three modes.

Library, CLI and daemon

Use OFL as an ES module, drive it from the ofl command line tool, or keep indexes hot in memory behind a local Unix socket daemon.

Filesystem metadata search

Index files by their metadata (names, paths, sizes, types and timestamps), with configurable symlink, hidden-file and depth limits.

Structured records search

Index JSON and NDJSON records directly, so databases, exports and log-style data can be searched without a custom loader.

Crash-safe commits

Index writes are committed with SHA-256 checksums and verified with ofl verify, so a partially written index is detected rather than silently queried.

Multiple index types

Exact, prefix, range, bitmap and trigram index types are all supported, and the query planner combines them for each request.

Installation

git clone https://github.com/XPDevs/OFL.git
cd OFL
npm install

OFL is an ES module with zero runtime dependencies and requires Node >= 18. The package exposes ofl as a bin entry point and exports the core at src/core/index.js, plus ./cli and ./daemon.

Quick start

# Create a config file (ofl.json)
# Then build an index
ofl build --config ./ofl.json

# Search
ofl search --text "report" --json

# Run as daemon
ofl daemon start

Configuration

Create an ofl.json in your project root:

{
  "index_dir": ".ofl/index",
  "sources": [
    {
      "id": "my-files",
      "name": "My Files",
      "type": "filesystem-metadata",
      "root": "/path/to/search"
    }
  ],
  "security": {
    "follow_symlinks": false,
    "include_hidden": false,
    "max_depth": 50,
    "default_limit": 50
  }
}

CLI commands

CommandDescription
ofl searchSearch indexed data
ofl buildBuild or rebuild indexes
ofl verifyVerify index integrity
ofl infoShow source and index information
ofl daemonManage the local daemon
ofl benchRun benchmarks
ofl conformanceRun conformance tests

Library usage

import { createSearchOutput, normalizeQueryText, tokenizeText } from 'ofl';

Daemon

The daemon keeps indexes hot in memory and answers queries over a local Unix socket:

ofl daemon start
ofl daemon query --text "search term"
ofl daemon status
ofl daemon stop

Documentation

DocumentDescription
SpecificationThe OFL standard itself
ArchitectureHow the components fit together
Query ModelQuery grammar, terms and planning
Output ModelThe SearchOutput contract
BenchmarksLatency and throughput results
SecurityPath handling and query guard rules
Design DecisionsWhy the standard works the way it does
ContributingHow to get involved

Testing

npm test
npm run conformance
npm run bench

The test suite is split into unit, integration and conformance suites, covering the CLI, the daemon, every index type, connectors, checksum verification and the security guard.

Repository details

Repositorygithub.com/XPDevs/OFL
DescriptionA new fast search standard for databases
Full nameOpen Fast Lookup (OFL)
Version0.1.0, initial release
LanguageJavaScript (ESM), Node >= 18, zero runtime dependencies
LicenseApache-2.0
Related projectGateway, our end-user search engine, built alongside this standard

About XPDevs

OFL is developed by XPDevs. It provides an open standard for deterministic, low-latency search over local files and structured records without relying on AI or remote services.

For more information about OFL, or to discuss how our technology can support your needs, please contact us at xpdevs.github.io.com@gmail.com.