Symbol-level, incremental codebase indexer for semantic search and precedent retrieval.
Project description
Gloggur
Gloggur is a symbol-level, incremental codebase indexer for semantic search and precedent retrieval. It parses code into symbols, generates embeddings, stores them locally, and exposes a JSON-friendly CLI for integration with AI agents.
Features
- Tree-sitter parsing for multi-language symbol extraction
- Incremental indexing with SHA-256 hashing
- Pluggable embedding backends (local models, OpenAI, or Gemini)
- FAISS vector search with SQLite metadata
- Docstring audit with semantic similarity scoring
- JSON output for CLI automation
Installation
Preferred:
pipx install gloggur
Alternatives:
pip install gloggur
Optional:
pipx install "gloggur[openai]"
pipx install "gloggur[gemini]"
pipx install "gloggur[local]"
For local development worktrees, use the repo wrapper/bootstrap flow:
scripts/bootstrap_gloggur_env.sh
scripts/gloggur status --json
scripts/gloggur now runs a preflight check before launching the CLI:
- prefers
.venv/bin/pythonwhen healthy - otherwise falls back to system Python with repo-root
PYTHONPATH - returns structured
--jsonfailures withoperation=preflight
Quickstart
Index a repository:
gloggur index . --json
Search for similar symbols:
gloggur search "streaming parser" --top-k 5 --json
Stream results as line-delimited JSON:
gloggur search "streaming parser" --top-k 50 --json --stream
Inspect docstrings (semantic similarity scoring):
gloggur inspect . --json
gloggur inspect skips unchanged files by default. Use --force to reinspect everything.
Check status:
gloggur status --json
Enable save-triggered indexing (one-time setup):
gloggur watch init . --json
gloggur watch start --daemon --json
Check or stop watcher:
gloggur watch status --json
gloggur watch stop --json
Clear cache:
gloggur clear-cache --json
Cache compatibility is automatic:
- If cache schema changes, Gloggur rebuilds
.gloggur-cache/index.dbautomatically. - If embedding provider/model changes, the next
gloggur index ...run rebuilds cache and vectors automatically.
On-Save Indexing (Watch Mode)
Watch mode keeps the index updated in the background as files are saved.
- Filesystem events are debounced (
watch_debounce_ms, default300) to coalesce save bursts. - Content hashing avoids re-parsing/re-embedding unchanged files.
- Deleted/changed symbol vectors are removed before upsert to prevent stale search hits.
- Runtime state is written to
.gloggur-cache/watch_state.jsonby default.
Verification
Core behavior checks run in pytest (including smoke tests):
.venv/bin/pytest
Additional verification probes are available for provider/edge/performance checks:
# Run non-test verification phases (providers, edge cases, performance)
python scripts/run_suite.py
# Run specific phases
python scripts/run_provider_probe.py # Embedding providers
python scripts/run_edge_bench.py # Edge cases & performance
See docs/VERIFICATION.md for detailed documentation.
See docs/AGENT_INTEGRATION.md for agent integration guidance.
Configuration
Create .gloggur.yaml or .gloggur.json in your repository:
embedding_provider: gemini
local_embedding_model: microsoft/codebert-base
openai_embedding_model: text-embedding-3-large
gemini_embedding_model: gemini-embedding-001
cache_dir: .gloggur-cache
watch_enabled: false
watch_path: .
watch_debounce_ms: 300
watch_mode: daemon
watch_state_file: .gloggur-cache/watch_state.json
watch_pid_file: .gloggur-cache/watch.pid
watch_log_file: .gloggur-cache/watch.log
docstring_semantic_threshold: 0.2
docstring_semantic_max_chars: 4000
supported_extensions:
- .py
- .js
- .jsx
- .ts
- .tsx
- .rs
- .go
- .java
excluded_dirs:
- .git
- node_modules
- venv
- .venv
- .gloggur-cache
- dist
- build
- htmlcov
Environment variables:
GLOGGUR_EMBEDDING_PROVIDERGLOGGUR_LOCAL_MODELGLOGGUR_OPENAI_MODELOPENAI_API_KEYGLOGGUR_GEMINI_MODELGLOGGUR_GEMINI_API_KEYGLOGGUR_CACHE_DIRGLOGGUR_WATCH_ENABLEDGLOGGUR_WATCH_PATHGLOGGUR_WATCH_DEBOUNCE_MSGLOGGUR_WATCH_MODEGLOGGUR_DOCSTRING_SEMANTIC_MIN_CHARSGEMINI_API_KEY(orGOOGLE_API_KEY)
Output Schema
Search results are returned as JSON:
{
"query": "...",
"results": [
{
"symbol": "function_name",
"kind": "function",
"file": "path/to/file.py",
"line": 42,
"signature": "def function_name(arg1, arg2)",
"docstring": "...",
"similarity_score": 0.95,
"context": "surrounding code snippet"
}
],
"metadata": {
"total_results": 10,
"search_time_ms": 45
}
}
Development
scripts/bootstrap_gloggur_env.sh
scripts/gloggur status --json
.venv/bin/pytest
If bootstrap/preflight fails with --json, error payloads include:
error_code:missing_venv,missing_python,missing_package,broken_environmentmessageremediationstepsdetected_environmentdetails
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gloggur-0.1.0.tar.gz.
File metadata
- Download URL: gloggur-0.1.0.tar.gz
- Upload date:
- Size: 42.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2297ce67d2c83ad87bbd9171e4c807dc8e2faf255d4101b65f468e3167789ec5
|
|
| MD5 |
c1d7f17e65a61a2833e268aaa4bee642
|
|
| BLAKE2b-256 |
d8bec6b5fee6ece3d523d59af069fa2bc9eb8d1e8aefd0873d730fcc2dbeb647
|
Provenance
The following attestation bundles were made for gloggur-0.1.0.tar.gz:
Publisher:
publish.yml on asmundur/gloggur
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gloggur-0.1.0.tar.gz -
Subject digest:
2297ce67d2c83ad87bbd9171e4c807dc8e2faf255d4101b65f468e3167789ec5 - Sigstore transparency entry: 976738341
- Sigstore integration time:
-
Permalink:
asmundur/gloggur@bc686dc4cd53dccb1b83964952ae2390606dea9b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/asmundur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc686dc4cd53dccb1b83964952ae2390606dea9b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file gloggur-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gloggur-0.1.0-py3-none-any.whl
- Upload date:
- Size: 47.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c4377504a232f89ea2706f85de46cb45ee89b97b5b41667ccfb643ec80143b9
|
|
| MD5 |
94716d46f1f2e7ce0961c16f7553f82b
|
|
| BLAKE2b-256 |
452ecdab18cee2ebc969906e31e2bcf4f1fba53d17d137ce0fee486e26bb2737
|
Provenance
The following attestation bundles were made for gloggur-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on asmundur/gloggur
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gloggur-0.1.0-py3-none-any.whl -
Subject digest:
1c4377504a232f89ea2706f85de46cb45ee89b97b5b41667ccfb643ec80143b9 - Sigstore transparency entry: 976738362
- Sigstore integration time:
-
Permalink:
asmundur/gloggur@bc686dc4cd53dccb1b83964952ae2390606dea9b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/asmundur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc686dc4cd53dccb1b83964952ae2390606dea9b -
Trigger Event:
workflow_dispatch
-
Statement type: