Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

semtools

> 开发工具
Open source

Semantic search and document parsing tools for the command line

1.8K stars0 likes2 views
WebsiteGitHub

About

Semantic search and document parsing tools for the command line

SemTools

Semantic search and document parsing tools for the command line

A high-performance CLI tool for document processing and semantic search, built with Rust for speed and reliability.

  • semtools parse - Parse documents (PDF, DOCX, etc.) using, by default, the LlamaParse API into markdown format
  • semtools search - Local semantic keyword search using multilingual embeddings with cosine similarity matching and per-line context matching
  • semtools ask - AI agent with search and read tools for answering questions over document collections (defaults to OpenAI, but see the config section to learn more about connecting to any OpenAI-Compatible API)
  • semtools workspace - Workspace management for accelerating search over large collections

NOTE: By default, parse uses LlamaParse as a backend. Get your API key today for free at https://cloud.llamaindex.ai. search and workspace remain local-only. ask requires an OpenAI API key.

Key Features

  • Fast semantic search using model2vec embeddings from minishlab/potion-multilingual-128M
  • Reliable document parsing with caching and error handling
  • Unix-friendly design with proper stdin/stdout handling
  • Configurable distance thresholds and returned chunk sizes
  • Multi-format support for parsing documents (PDF, DOCX, PPTX, etc.)
  • Concurrent processing for better parsing performance
  • Workspace management for efficient document retrieval over large collections

Installation

Prerequisites:

  • For the parse subcommand: LlamaIndex Cloud API key
  • For the ask subcommand: OpenAI API key

Install:

You can install semtools via npm:

bash
npm i -g @llamaindex/semtools

Or via cargo:

bash
# install entire crate
cargo install semtools

# install only select features
cargo install semtools --no-default-features --features=parse

Note: Installing from npm builds the Rust binaries locally during install if a prebuilt binary is not available, which requires Rust and Cargo to be available in your environment. Install from rustup if needed: https://www.rust-lang.org/tools/install.

Quick Start

Basic Usage:

…

Advanced Usage:

…

Using Workspaces:

…

CLI Help

bash
$ semtools parse --help
A CLI tool for parsing documents using various backends

Usage: semtools parse [OPTIONS] <FILES>...

Arguments:
  <FILES>...  Files to parse

Options:
  -c, --config <CONFIG>    Path to the config file. Defaults to ~/.semtools_config.json
  -b, --backend <BACKEND>  The backend type to use for parsing. Defaults to `llama-parse` [default: llama-parse]
  -v, --verbose            Verbose output while parsing
  -h, --help               Print help
…
bash
$ semtools workspace --help
Manage semtools workspaces

Usage: semtools workspace [OPTIONS] <COMMAND>

Commands:
  use     Use or create a workspace (prints export command to run)
  status  Show active workspace and basic stats
  prune   Remove stale or missing files from store
  help    Print this message or the help of the given subcommand(s)

Options:
  -j, --json  Output results in JSON format
  -h, --help  Print help
…

Configuration

SemTools uses a unified configuration file at ~/.semtools_config.json that contains settings for all CLI tools. You can also specify a custom config file path using the -c or --config flag on any command.

Unified Configuration File

Create a ~/.semtools_config.json file with settings for the tools you use. All sections are optional - if not specified, sensible defaults will be used. (They parse_kwargs section is passed directly to LlamaParse, see docs for available options.)

json
{
  "parse": {
    "api_key": "your_llama_cloud_api_key_here",
    "num_ongoing_requests": 10,
    "base_url": "https://api.cloud.llamaindex.ai",
    "parse_kwargs": {
      "tier": "agentic",
      "version": "latest",
      "disable_cache": false
    },
    "check_interval": 5,
    "max_timeout": 3600,
    "max_retries": 10,
    "retry_delay_ms": 1000,
    "backoff_multiplier": 2.0
  },
  "ask": {
    "api_key": "your_openai_api_key_here",
    "base_url": null,
    "model": "gpt-4o-mini",
    "max_iterations": 20,
    "api_mode": "responses",  // Can be responses or chat
  }
}

Find out more about parsing configuration on the dedicated documentation page.

See example_semtools_config.json in the repository for a complete example.

Environment Variables

As an alternative or supplement to the config file, you can set API keys via environment variables:

bash
# For parse tool
export LLAMA_CLOUD_API_KEY="your_llama_cloud_api_key_here"

# For ask tool
export OPENAI_API_KEY="your_openai_api_key_here"

Configuration Priority

Configuration values are resolved in the following priority order (highest to lowest):

  1. CLI arguments (e.g., --api-key, --model, --base-url)
  2. Config file (~/.semtools_config.json or custom path via -c)
  3. Environment variables (LLAMA_CLOUD_API_KEY, OPENAI_API_KEY)
  4. Built-in defaults

This allows you to set common defaults in the config file while overriding them on a per-command basis when needed.

Subcommand-Specific Configuration

Parse Subcommand

The parse subcommand requires a LlamaParse API key. Get your free API key at https://cloud.llamaindex.ai.

Configuration options:

  • api_key: Your LlamaParse API key
  • base_url: API endpoint (default: "https://api.cloud.llamaindex.ai")
  • num_ongoing_requests: Number of concurrent requests (default: 10)
  • parse_kwargs: Additional parsing parameters
  • check_interval, max_timeout, max_retries, retry_delay_ms, backoff_multiplier: Retry and timeout settings

Ask Subcommand

The ask subcommand requires an OpenAI API key for the agent's LLM.

Configuration options:

  • api_key: Your OpenAI API key
  • base_url: Custom OpenAI-compatible API endpoint (optional, for using other providers)
  • model: LLM model to use (default: "gpt-4o-mini")
  • max_iterations: Maximum agent loop iterations (default: 10)

You can also override these per-command:

bash
semtools ask "What is this about?" docs/*.txt --model gpt-4o --api-key sk-...

Agent Use Case Examples

  • Using Semtools with Coding Agents
  • Using Semtools with MCP

Future Work

  • More parsing backends (something local-only would be great!)
  • Improved search algorithms
  • Built-in agentic search
  • Persistence for speedups on repeat searches on the same files

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • LlamaIndex/LlamaParse for document parsing capabilities
  • model2vec-rsfor fast embedding generation
  • minishlab/potion-multilingual-128M for an amazing default static embedding model
  • simsimd for efficient similarity computation

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustcliembeddingsparserrust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具