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.2.tar.gz (41.2 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.2-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sia_code-0.2.2.tar.gz
  • Upload date:
  • Size: 41.2 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.2.tar.gz
Algorithm Hash digest
SHA256 6358c36c0b70cc7b619b7a268f7c8813286d6be3b172d6ec621224b0cf569453
MD5 c430959937bd9d8a19cf812506b41589
BLAKE2b-256 e676c7de88aa6ae8a94685f824bb236e76d9603278253e6414bd6115483b38f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sia_code-0.2.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: sia_code-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 41.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6d1443ba46ea175cb7649a738553fd8a346a232518f490022125c6729baad85
MD5 c2dd00ec0473bc0bf8c47a8ba39b4555
BLAKE2b-256 0363e99bfe4d30566859b108ce38d19a4a87869282b4c5c3bf68f385fc1ae243

See more details on using hashes here.

Provenance

The following attestation bundles were made for sia_code-0.2.2-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