Skip to main content

AI-native Contextual Code Engine

Project description

OpenACE

AI-native Contextual Code Engine. Rust core with Python bindings, exposing a CLI, Python SDK, and MCP server for Claude Code / Codex CLI.

OpenACE combines multi-signal retrieval (BM25 full-text + vector kNN + exact match + graph expansion + AST chunk search) with Reciprocal Rank Fusion to deliver high-quality code search across Python, TypeScript, JavaScript, Rust, Go, and Java.

Quick Start

pip install "openace[mcp,openai]"

# Index a project
openace index /path/to/project --embedding siliconflow

# Search
openace search "user authentication" -p /path/to/project --embedding siliconflow

# Start MCP server
openace serve /path/to/project --embedding siliconflow

Use with Claude Code

Add to your project's .mcp.json:

{
  "mcpServers": {
    "openace": {
      "command": "openace",
      "args": ["serve", ".", "--embedding", "siliconflow"],
      "env": {
        "OPENACE_EMBEDDING_API_KEY": "your-api-key"
      }
    }
  }
}

Or use uvx for zero-install (once published to PyPI):

{
  "mcpServers": {
    "openace": {
      "command": "uvx",
      "args": ["openace", "serve", ".", "--embedding", "siliconflow"],
      "env": {
        "OPENACE_EMBEDDING_API_KEY": "your-api-key"
      }
    }
  }
}

Use with Codex CLI

codex mcp add openace -- uvx openace serve . --embedding siliconflow

Custom API Providers

OpenACE supports any OpenAI-compatible embedding/reranking API. Configure via CLI flags or environment variables:

{
  "mcpServers": {
    "openace": {
      "command": "openace",
      "args": [
        "serve", ".",
        "--embedding", "openai",
        "--reranker", "siliconflow"
      ],
      "env": {
        "OPENACE_EMBEDDING_API_KEY": "your-embedding-key",
        "OPENACE_EMBEDDING_BASE_URL": "https://api.your-provider.com/v1",
        "OPENACE_RERANKER_API_KEY": "your-reranker-key",
        "OPENACE_RERANKER_BASE_URL": "https://api.your-reranker.com/v1"
      }
    }
  }
}

Environment Variables

Variable Description
OPENACE_EMBEDDING_API_KEY API key for embedding provider
OPENACE_EMBEDDING_BASE_URL Custom base URL for embedding API
OPENACE_EMBEDDING_DIM Override embedding vector dimension
OPENACE_RERANKER_API_KEY API key for reranker provider
OPENACE_RERANKER_BASE_URL Custom base URL for reranker API
OPENACE_EMBEDDING Default embedding provider for serve
OPENACE_RERANKER Default reranker for serve

Embedding Providers

Name Model Requires
siliconflow Qwen/Qwen3-Embedding-8B (1024-dim) openace[openai] + API key
openai text-embedding-3-small openace[openai] + API key
local all-MiniLM-L6-v2 (384-dim) openace[onnx]
none BM25 only, no vector search (default)

Reranker Providers

Name Backend Requires
auto Matches embedding provider (default)
siliconflow Qwen/Qwen3-Reranker-8B openace[openai] + API key
cohere Cohere Rerank openace[rerank-cohere] + API key
cross_encoder Local cross-encoder model openace[rerank-local]
rule_based Heuristic (no API needed) (built-in)

MCP Tools

semantic_search

Search for code by natural language query. Returns file-level results with code snippets, match signals, and file outlines.

find_symbol

Look up symbols by exact name. Returns definitions with file path, line range, and signature.

get_file_outline

Get all symbols defined in a file. Returns a structural overview with symbol kinds, names, and line ranges.

Python SDK

from openace import Engine

engine = Engine("/path/to/project")
engine.index()

# Semantic search
results = engine.search("parse XML", limit=10)
for r in results:
    print(f"{r.file_path}:{r.line_range[0]} {r.name} ({r.kind})")

# Exact lookup
symbols = engine.find_symbol("MyClass")

# File outline
outline = engine.get_file_outline("src/main.py")

Installation

# Default install (includes MCP server, OpenAI/SiliconFlow embedding & reranking)
pip install openace

# With local ONNX embedding (no API key needed)
pip install "openace[onnx]"

# With Cohere reranker
pip install "openace[rerank-cohere]"

# Development
pip install -e ".[dev]"

Architecture

Source files --> Scanner --> Parser (tree-sitter) --> Indexer --> Storage
                                                                   |
                                                     SQLite (graph/relations)
                                                     Tantivy (BM25 full-text)
                                                     usearch (vector kNN)
                                                                   |
Query --> CLI/SDK/MCP --> Retrieval (BM25 + vector + exact + graph + chunk)
                              |
                          RRF Fusion --> Reranker --> Results
  • Rust core handles all performance-critical operations (parsing, indexing, storage, retrieval)
  • Python layer provides the SDK, CLI, MCP server, and pluggable embedding/reranking providers
  • tree-sitter for multi-language AST parsing
  • Triple-backend storage: SQLite for graph/relations, Tantivy for BM25, usearch for HNSW vector search
  • CJK bigram tokenization in BM25 for Chinese/Japanese/Korean query support

Supported Languages

Python, TypeScript, JavaScript, Rust, Go, Java.

Building from Source

Requires Rust >= 1.85.0 and Python >= 3.10.

git clone https://github.com/Kosthi/OpenACE.git
cd OpenACE
pip install maturin
maturin develop --release
pip install -e ".[dev]"

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

openace-0.1.3-cp312-cp312-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.12Windows x86-64

openace-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

openace-0.1.3-cp312-cp312-macosx_11_0_arm64.whl (4.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

openace-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file openace-0.1.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: openace-0.1.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openace-0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0dd0d390305a8b41c35e4a2e41f5dbe8147ae642514528cb6e33fef9fcd1b1ff
MD5 e0aa5d5ab3318024358c5a3a928b70a0
BLAKE2b-256 ae785bf1c8ed093828ab1bbe071256e75323afde0f99dfb4ac953bd759d9e5cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for openace-0.1.3-cp312-cp312-win_amd64.whl:

Publisher: release.yml on Kosthi/OpenACE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openace-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for openace-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0efc80bda2301199d9d8e336d6e64f8e5f1b367fbfc1a490b5a5b4f8fd43deac
MD5 a22209897f3435418df0fde6ae8cccb3
BLAKE2b-256 bd6c366f72ad51a40bf3e248f071e460adda26f1664392d0dfb6871bd809afe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for openace-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: release.yml on Kosthi/OpenACE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openace-0.1.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openace-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3d2457d6e84d0244e07bfae3c9dcdedfcb40876cc872c11bd763c46eecce46d
MD5 4351b54eb5e375597498c6443d0244d3
BLAKE2b-256 4101dc6e88056252cc72e8bc349e700f08e8312d4e2a86a7a980680fa31f3788

See more details on using hashes here.

Provenance

The following attestation bundles were made for openace-0.1.3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on Kosthi/OpenACE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openace-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for openace-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6064ed5a41209d2b3c21e91189d0ac3e39510bb26a2317730952c40937d1feaf
MD5 307b85b6fc85dac61dd2712015bef0fb
BLAKE2b-256 b6d582d1283e4abf2f92bb3b621b606c7b5372c7b2100dea0071843de2a3012e

See more details on using hashes here.

Provenance

The following attestation bundles were made for openace-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: release.yml on Kosthi/OpenACE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page