Skip to main content

Local-first codebase intelligence with semantic search, multi-hop research, and 12-language AST support

Project description

Sia Code

v0.2 - Local-first codebase search with semantic understanding and multi-hop code discovery.

Features

  • Semantic Search - Natural language queries with OpenAI embeddings (auto-fallback to lexical)
  • Multi-Hop Research - Automatically discover code relationships and call graphs
  • 12 Languages - Python, JS/TS, Go, Rust, Java, C/C++, C#, Ruby, PHP (full AST support)
  • Interactive Mode - Live search with result navigation and export
  • Watch Mode - Auto-reindex on file changes
  • Portable - Single .mv2 file storage, no database required

Installation

# From PyPI (recommended)
pip install sia-code

# Or with uv
uv tool install sia-code

# Or from source
uv tool install git+https://github.com/DxTa/sia-code.git

# Try without installing (ephemeral run)
uvx sia-code --version
uvx sia-code search "authentication logic"

# Verify installation
sia-code --version

Quick Start

# Initialize and index
sia-code init
sia-code index .

# Search
sia-code search "authentication logic"           # Semantic search
sia-code search --regex "def.*login"             # Regex search

# Multi-hop research (discover relationships)
sia-code research "how does the API handle errors?"

# Check index health
sia-code status

Commands

Command Description
sia-code init Initialize index in current directory
sia-code index . Index codebase (first time)
sia-code index --update Re-index only changed files (10x faster)
sia-code index --clean Full rebuild from scratch
sia-code index --watch Auto-reindex on file changes
sia-code search "query" Semantic or regex search
sia-code research "question" Multi-hop code discovery with --graph
sia-code interactive Live search mode with result navigation
sia-code status Index health and staleness metrics
sia-code compact Remove stale chunks when index grows
sia-code config show View configuration

Configuration

Semantic search requires OpenAI API key (optional):

export OPENAI_API_KEY=sk-your-key-here
sia-code init
sia-code index .

Without API key: Searches automatically fallback to lexical/regex mode. No crashes.

Edit config at .sia-code/config.json to:

  • Change embedding model (openai-small, openai-large, bge-small)
  • Exclude patterns (node_modules/, __pycache__/, etc.)
  • Adjust chunk sizes

View config: sia-code config show

Output Formats

sia-code search "query" --format json            # JSON output
sia-code search "query" --format table           # Rich table
sia-code search "query" --format csv             # CSV for Excel
sia-code search "query" --output results.json    # Save to file

Supported Languages

Full AST Support (12): Python, JavaScript, TypeScript, JSX, TSX, Go, Rust, Java, C, C++, C#, Ruby, PHP

Recognized: Kotlin, Groovy, Swift, Bash, Vue, Svelte, and more (indexed as text)

Troubleshooting

Issue Solution
No API key warning Normal - searches fallback to lexical mode
Index growing large Run sia-code compact to remove stale chunks
Slow indexing Use sia-code index --update for incremental
Stale search results Run sia-code index --clean to rebuild

How It Works

  1. Parse - Tree-sitter generates AST for each file
  2. Chunk - cAST algorithm creates semantic chunks (functions, classes)
  3. Embed - Optional OpenAI embeddings for semantic search
  4. Store - Single portable .mv2 file with Memvid
  5. Search - Hybrid BM25 + vector similarity

Links

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 Distribution

sia_code-0.2.3.tar.gz (41.5 kB view details)

Uploaded Source

Built Distribution

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

sia_code-0.2.3-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file sia_code-0.2.3.tar.gz.

File metadata

  • Download URL: sia_code-0.2.3.tar.gz
  • Upload date:
  • Size: 41.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sia_code-0.2.3.tar.gz
Algorithm Hash digest
SHA256 1cb23966d24feac5ec093eefff22be6d79418e44e681ed369c9c6db7315713f8
MD5 9d6480eed6635cc05a9cf1bbf886a5cb
BLAKE2b-256 0aa6875ad04406e272f6510f5c1601652edd41184e8a71d66769d507104cff14

See more details on using hashes here.

Provenance

The following attestation bundles were made for sia_code-0.2.3.tar.gz:

Publisher: release.yml on DxTa/sia-code

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

File details

Details for the file sia_code-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: sia_code-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sia_code-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d35e5aa8fc5ded937b6b6cc94344af6ac4bded7f41a075b9754a445184d35611
MD5 1ad5266a1e7c78e42bbd84639767549b
BLAKE2b-256 5c0eaae67dd4de1b46b3624645c4400905726d81085807114cb1b343c716bdfd

See more details on using hashes here.

Provenance

The following attestation bundles were made for sia_code-0.2.3-py3-none-any.whl:

Publisher: release.yml on DxTa/sia-code

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