Skip to content

Commit 039c262

Browse files
committed
[gobby-cli-#170] docs: prepare gcode FalkorDB release
1 parent adfdf89 commit 039c262

9 files changed

Lines changed: 105 additions & 99 deletions

File tree

CHANGELOG.md

Lines changed: 33 additions & 35 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cargo build --workspace --no-default-features
1111
cargo test --workspace --no-default-features
1212
```
1313

14-
The `rust-toolchain.toml` ensures you have the right toolchain and components (clippy, rustfmt) installed automatically. The `--no-default-features` flag skips the gcode `embeddings` feature which requires cmake.
14+
The `rust-toolchain.toml` ensures you have the right toolchain and components (clippy, rustfmt) installed automatically. CI uses `--no-default-features`; keep that build clean even when a crate has no default feature set.
1515

1616
## Development
1717

@@ -41,17 +41,17 @@ All PRs must pass CI (fmt, clippy, tests) before merging.
4141

4242
```
4343
crates/
44-
gcode/ — AST-aware code search (heavy: tree-sitter, SQLite, opt-level=3)
44+
gcode/ — AST-aware code search (heavy: tree-sitter, PostgreSQL, opt-level=3)
4545
src/
4646
main.rs — CLI entry point, command dispatch
4747
config.rs — Runtime context resolution, service configs
48-
db.rs — SQLite connection helpers
48+
db.rs — PostgreSQL hub connection helpers
4949
models.rs — Data types: Symbol, IndexedFile, SearchResult, etc.
5050
secrets.rs — Fernet decryption for Gobby secrets
51-
neo4j.rs — Neo4j HTTP client for graph queries
51+
falkor.rs — FalkorDB client for graph queries
5252
commands/ — Subcommand handlers (init, index, search, graph, etc.)
5353
index/ — Indexing pipeline (walker, parser, chunker, hasher, indexer)
54-
search/ — Search pipeline (FTS5, semantic, graph_boost, RRF)
54+
search/ — Search pipeline (pg_search BM25, semantic, graph_boost, RRF)
5555
gsqz/ — Output compressor (tiny: regex, opt-level="z")
5656
src/
5757
main.rs — CLI entry point, command execution, ANSI stripping

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ cargo install gobby-hooks
8585
```
8686

8787
`gcode` graph and semantic features are configured at runtime. There are no
88-
Cargo feature flags for FalkorDB, Qdrant, or embeddings support.
88+
Cargo feature flags for FalkorDB, Qdrant, or embeddings support. Gobby-managed
89+
projects read FalkorDB settings from `databases.falkordb.*`; daemon-independent
90+
setups can use `GOBBY_FALKORDB_HOST`, `GOBBY_FALKORDB_PORT`, and
91+
`GOBBY_FALKORDB_PASSWORD`.
8992

9093
`gcode` 0.8.0+ uses the migrated Gobby PostgreSQL hub. It reads
9194
`~/.gobby/bootstrap.yaml`, requires `hub_backend: postgres`, and resolves the

crates/gcode/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ cargo install gobby-code
9090
```
9191

9292
Graph and semantic features are configured at runtime. You do not need Cargo
93-
feature flags to enable FalkorDB, Qdrant, or embeddings support.
93+
feature flags to enable FalkorDB, Qdrant, or embeddings support. Gobby-managed
94+
projects read FalkorDB settings from `databases.falkordb.*`; daemon-independent
95+
setups can use `GOBBY_FALKORDB_HOST`, `GOBBY_FALKORDB_PORT`, and
96+
`GOBBY_FALKORDB_PASSWORD`.
9497

9598
Runtime indexing/search requires a migrated Gobby PostgreSQL hub. gcode reads
9699
`~/.gobby/bootstrap.yaml`, requires `hub_backend: postgres`, and resolves the

docs/guides/gcode-development-guide.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CLI (main.rs, clap)
1212
→ commands/{search,symbols,graph,index,status,init}.rs
1313
→ search/ pipeline (pg_search BM25 + optional semantic + optional graph sources → RRF)
1414
→ index/ pipeline (walker → parser → chunker → hasher → indexer)
15-
neo4j (HTTP Cypher queries)
15+
falkor (FalkorDB graph queries)
1616
→ db (PostgreSQL hub connections)
1717
→ output (JSON/text formatting)
1818
```
@@ -93,13 +93,13 @@ tell users to finish `gobby postgres migrate-from-sqlite` and cut over.
9393

9494
### Service Configuration
9595

96-
Resolution order per service (Neo4j, Qdrant, embeddings):
96+
Resolution order per service (FalkorDB, Qdrant, embeddings):
9797

9898
| Priority | Source | Example |
9999
|----------|--------|---------|
100-
| 1 (highest) | Environment variables | `GOBBY_NEO4J_URL`, `GOBBY_QDRANT_URL`, `GOBBY_EMBEDDING_URL` |
101-
| 2 | `config_store` table in PostgreSQL | `databases.neo4j.url`, `databases.qdrant.url`, `embeddings.api_base` |
102-
| 3 (lowest) | Hardcoded defaults | Neo4j `http://localhost:8474` / `neo4j`; embeddings model `nomic-embed-text` once an API base exists |
100+
| 1 (highest) | Environment variables | `GOBBY_FALKORDB_HOST`, `GOBBY_FALKORDB_PORT`, `GOBBY_FALKORDB_PASSWORD`, `GOBBY_QDRANT_URL`, `GOBBY_EMBEDDING_URL` |
101+
| 2 | `config_store` table in PostgreSQL | `databases.falkordb.host`, `databases.falkordb.port`, `databases.falkordb.requirepass`, `databases.qdrant.url`, `embeddings.api_base` |
102+
| 3 (lowest) | Hardcoded defaults | FalkorDB port `16379` and graph name `gobby_code` once a host is configured; embeddings model `nomic-embed-text` once an API base exists |
103103

104104
Config values are JSON-encoded in `config_store` — strings have surrounding quotes stripped. Secret patterns like `$secret:NAME` are resolved via `secrets.rs` (Fernet decryption using machine_id + salt, 600K PBKDF2 iterations).
105105

@@ -161,7 +161,7 @@ pass before call targets are finalized:
161161
- Unmatched calls stay `unresolved`
162162
- Import-bound external calls are marked `external` and retain their source module
163163

164-
This keeps external package calls out of the local call graph and improves Neo4j
164+
This keeps external package calls out of the local call graph and improves FalkorDB
165165
correctness for `callers`, `usages`, `blast-radius`, and graph-backed search.
166166

167167
### Language Support (languages.rs)
@@ -189,7 +189,7 @@ Files are split into overlapping chunks for BM25 content search:
189189

190190
1. **Hash comparison**: SHA-256 content hash per file, stored in `code_indexed_files`
191191
2. **Stale detection**: Compare current hashes against stored hashes; files with changed hashes are re-indexed.
192-
3. **Orphan cleanup**: Files in the DB that no longer exist on disk have their hub rows deleted. External cleanup (Neo4j/Qdrant) is handled by the daemon's reconcile/sync workers.
192+
3. **Orphan cleanup**: Files in the DB that no longer exist on disk have their hub rows deleted. External cleanup (FalkorDB/Qdrant) is handled by the daemon's reconcile/sync workers.
193193
4. **Per-file transactions**: PostgreSQL writes (delete old data, upsert symbols, upsert file, upsert content chunks, upsert imports/calls) are wrapped in a single transaction to prevent half-indexed files on crash.
194194
5. **External sync flags**: Changed files are written with `graph_synced=false`, `vectors_synced=false`, and `graph_sync_attempted_at=NULL` so the daemon can regenerate graph and vector projections.
195195

@@ -232,15 +232,15 @@ The runtime schema validator requires these tables before gcode starts index/sea
232232

233233
### Graph Lifecycle RPCs
234234

235-
Read-side graph queries still go straight to Neo4j. Graph lifecycle operations
235+
Read-side graph queries still go straight to FalkorDB. Graph lifecycle operations
236236
are daemon-backed orchestration commands instead:
237237

238238
- `gcode graph clear``POST /api/code-index/graph/clear?project_id=...`
239239
- `gcode graph rebuild``POST /api/code-index/graph/rebuild?project_id=...`
240240

241241
These commands use the current resolved `Context.project_id`, require a daemon
242242
URL, and fail hard on transport errors, non-2xx responses, or invalid JSON
243-
success bodies. They do not talk to Neo4j directly.
243+
success bodies. They do not talk to FalkorDB directly.
244244

245245
### UUID5 Parity
246246

@@ -264,11 +264,11 @@ Source 2: Semantic (Qdrant vector search)
264264
→ POST to Qdrant /collections/{name}/points/search
265265
→ returns (symbol_id, score) pairs
266266
267-
Source 3: Graph Boost (Neo4j)
267+
Source 3: Graph Boost (FalkorDB)
268268
→ find_callers + find_usages for query term
269269
→ returns symbol IDs that are connected in the call/import graph
270270
271-
Source 4: Graph Expand (Neo4j)
271+
Source 4: Graph Expand (FalkorDB)
272272
→ seed from top FTS + semantic hits
273273
→ expand through callees first, then callers
274274
@@ -293,7 +293,7 @@ score(symbol) = Σ 1/(K + rank) for each source containing the symbol
293293

294294
### Symbol Resolution
295295

296-
After RRF merge, ALL symbol IDs are resolved against PostgreSQL before computing `total`. This ensures `total` reflects the count of actually-resolvable symbols (stale Qdrant/Neo4j entries are silently skipped). Offset/limit pagination is applied after resolution.
296+
After RRF merge, ALL symbol IDs are resolved against PostgreSQL before computing `total`. This ensures `total` reflects the count of actually-resolvable symbols (stale Qdrant/FalkorDB entries are silently skipped). Offset/limit pagination is applied after resolution.
297297

298298
The `total` for hybrid search is a best-effort estimate bounded by `fetch_limit`
299299
per source — exact counts aren't feasible because RRF merges results from
@@ -320,7 +320,7 @@ All search/graph commands return a `PagedResponse` envelope:
320320

321321
- `--offset N` skips the first N results
322322
- `--limit N` caps results per page (default: 10)
323-
- `hint` is populated when Neo4j is unavailable (graph commands only)
323+
- `hint` is populated when FalkorDB is unavailable (graph commands only)
324324
- Text mode shows a pagination footer: `-- 10 of 47 results (use --offset 10 for more)`
325325

326326
## Database Schema
@@ -361,7 +361,7 @@ Gobby repository migrations/baseline; gcode only validates and uses the tables.
361361
| symbol_count | INTEGER | |
362362
| byte_size | INTEGER | |
363363
| indexed_at | TIMESTAMPTZ | Cast to text for CLI output |
364-
| graph_synced | BOOLEAN | `false` means Neo4j sync pending |
364+
| graph_synced | BOOLEAN | `false` means FalkorDB sync pending |
365365
| vectors_synced | BOOLEAN | `false` means Qdrant sync pending |
366366

367367
**`code_imports`** — Import relations (daemon migration v183, Gobby mode only)
@@ -407,7 +407,7 @@ UNIQUE constraint on `(project_id, source_file, target_module)`.
407407

408408
**`config_store`** — Key-value configuration (Gobby mode only)
409409

410-
## Neo4j Graph Model
410+
## FalkorDB Graph Model
411411

412412
### Nodes
413413

@@ -436,13 +436,13 @@ Count queries use the same patterns with `RETURN count(...)` for accurate pagina
436436

437437
**File:** `src/search/fts.rs` (`resolve_graph_symbol`), `src/commands/graph.rs` (`resolve_symbol`)
438438

439-
All graph commands resolve user input to an actual symbol name before querying Neo4j. Resolution order:
439+
All graph commands resolve user input to an actual symbol name before querying FalkorDB. Resolution order:
440440

441441
1. **Exact match**`SELECT ... FROM code_symbols WHERE id/name/qualified_name = $1`
442442
2. **LIKE match**`WHERE name LIKE $pattern OR qualified_name LIKE $pattern`
443443
3. **BM25 search**`search_symbols_fts()` across names, signatures, docstrings, summaries
444444

445-
Single match → used directly. Multiple matches → fail closed with alternatives shown on stderr. No match → error message, no Neo4j query issued.
445+
Single match → used directly. Multiple matches → fail closed with alternatives shown on stderr. No match → error message, no FalkorDB query issued.
446446

447447
## Semantic Search Integration
448448

@@ -472,7 +472,7 @@ Each external service degrades independently:
472472

473473
| Service | When Unavailable | Impact |
474474
|---------|-----------------|--------|
475-
| Neo4j | No config or connection refused | Graph commands return `[]` with hint; search loses graph boost |
475+
| FalkorDB | No config or connection refused | Graph commands return `[]` with hint; search loses graph boost |
476476
| Qdrant | No URL configured | Search loses semantic source; BM25 still works |
477477
| Embeddings API | No API base, auth failure, or request error | Semantic search disabled for that query |
478478
| Daemon | Not running | Normal index/search still work; graph lifecycle RPCs fail and external sync waits for the daemon |

docs/guides/gcode-user-guide.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cargo install gobby-code
1313
```
1414

1515
Graph and semantic features are configured at runtime. You do not need Cargo
16-
feature flags to enable Neo4j, Qdrant, or embeddings support.
16+
feature flags to enable FalkorDB, Qdrant, or embeddings support.
1717

1818
Runtime indexing/search requires Gobby's PostgreSQL hub bootstrap. gcode reads
1919
`~/.gobby/bootstrap.yaml`, requires `hub_backend: postgres`, and connects
@@ -80,7 +80,7 @@ gcode offers four search modes for different use cases.
8080
### Hybrid Search (`gcode search`)
8181

8282
The default. Combines pg_search BM25 text matching with optional semantic similarity,
83-
graph boost, and graph expansion using Reciprocal Rank Fusion. If Neo4j,
83+
graph boost, and graph expansion using Reciprocal Rank Fusion. If FalkorDB,
8484
Qdrant, or the embeddings endpoint are unavailable, `gcode search` falls back
8585
to the sources that are configured.
8686

@@ -141,7 +141,7 @@ pg_search BM25 search across file content chunks — covers source bodies, comme
141141

142142
```bash
143143
gcode search-content "TODO: refactor"
144-
gcode search-content "GOBBY_NEO4J_URL" --path "*.py"
144+
gcode search-content "GOBBY_FALKORDB_HOST" --path "*.py"
145145
gcode search-content "primary-color" --language css
146146
```
147147

@@ -201,10 +201,10 @@ Useful for understanding project structure at a glance.
201201

202202
## Dependency Graph
203203

204-
Read-side graph commands require Neo4j. Gobby-managed projects usually provide this
205-
automatically, and daemon-independent projects can opt in with `GOBBY_NEO4J_URL` and
206-
`GOBBY_NEO4J_AUTH`. Without Neo4j, graph read commands return empty results
207-
gracefully.
204+
Read-side graph commands require FalkorDB. Gobby-managed projects usually provide this
205+
automatically, and daemon-independent projects can opt in with `GOBBY_FALKORDB_HOST`,
206+
`GOBBY_FALKORDB_PORT`, and `GOBBY_FALKORDB_PASSWORD`. Without FalkorDB, graph read
207+
commands return empty results gracefully.
208208

209209
All read-side graph commands resolve fuzzy input — you don't need the exact symbol name. Resolution tries exact match, then substring match, then BM25 search across names, signatures, and docstrings. When multiple matches are found, the best is used and alternatives are shown on stderr.
210210

@@ -320,7 +320,7 @@ gcode index --files src/config.rs src/main.rs
320320

321321
`gcode index` writes symbols, files, chunks, imports, and calls to the
322322
PostgreSQL hub. It marks graph/vector sync flags dirty; the Gobby daemon handles
323-
Neo4j graph edges and Qdrant vector sync asynchronously when it is running.
323+
FalkorDB graph edges and Qdrant vector sync asynchronously when it is running.
324324
BM25 search (`search-text`, `search-content`) works as soon as the transaction
325325
commits; graph and semantic search improve once the external stores sync.
326326

@@ -331,7 +331,7 @@ gcode invalidate
331331
gcode index
332332
```
333333

334-
In Gobby mode, `invalidate` also notifies the daemon to clean up Neo4j graph nodes and Qdrant vectors for the project. Use `--force` to skip the confirmation prompt.
334+
In Gobby mode, `invalidate` also notifies the daemon to clean up FalkorDB graph nodes and Qdrant vectors for the project. Use `--force` to skip the confirmation prompt.
335335

336336
Graph projection lifecycle is separate:
337337

@@ -348,7 +348,7 @@ gcode is daemon-independent but not database-independent:
348348
- Database: PostgreSQL hub from `~/.gobby/bootstrap.yaml`
349349
- Required bootstrap: `hub_backend: postgres` plus supported `database_url_ref` or `database_url`
350350
- Identity: `.gobby/project.json`, `.gobby/gcode.json`, isolated root, linked worktree, or generated identity from `gcode init`
351-
- Optional services: Neo4j, Qdrant, and embeddings via env vars or PostgreSQL `config_store`
351+
- Optional services: FalkorDB, Qdrant, and embeddings via env vars or PostgreSQL `config_store`
352352

353353
Graph commands and semantic search become available when the required services are configured.
354354

@@ -363,11 +363,11 @@ Both cases are reported by `gcode init`'s status line (`isolated`, `linked-workt
363363

364364
## Configuration
365365

366-
gcode resolves configuration in this order:
366+
gcode resolves graph/vector configuration in this order:
367367

368-
1. **Environment variables**`GOBBY_NEO4J_URL`, `GOBBY_NEO4J_AUTH`, `GOBBY_QDRANT_URL`, `GOBBY_PORT`
369-
2. **config_store table** — Key-value pairs in the PostgreSQL hub (`databases.neo4j.*`, `databases.qdrant.*`, `embeddings.*`)
370-
3. **Hardcoded defaults**Neo4j at `http://localhost:8474`, database `neo4j` (only when `config_store` exists)
368+
1. **Environment variables**`GOBBY_FALKORDB_HOST`, `GOBBY_FALKORDB_PORT`, `GOBBY_FALKORDB_PASSWORD`, `GOBBY_QDRANT_URL`
369+
2. **config_store table** — Key-value pairs in the PostgreSQL hub (`databases.falkordb.host`, `databases.falkordb.port`, `databases.falkordb.requirepass`, `databases.qdrant.*`, `embeddings.*`)
370+
3. **Hardcoded defaults**FalkorDB port `16379` and graph name `gobby_code` once a host is configured; no default FalkorDB host is assumed
371371

372372
Semantic search uses the same precedence rules:
373373
1. **Environment variables**`GOBBY_EMBEDDING_URL`, `GOBBY_EMBEDDING_MODEL`, `GOBBY_EMBEDDING_API_KEY`
@@ -486,10 +486,11 @@ gcode projects
486486

487487
If you get "No symbol matching 'X' found", the input didn't resolve to any indexed symbol. Try a different term or check what's indexed with `gcode search-text "X"`.
488488

489-
If results are empty but the symbol exists, this is expected when Neo4j is not configured. In Gobby mode, check that Neo4j is running and configured:
489+
If results are empty but the symbol exists, this is expected when FalkorDB is not configured. In Gobby mode, check that FalkorDB is running and configured:
490490

491491
```bash
492-
echo $GOBBY_NEO4J_URL
492+
echo $GOBBY_FALKORDB_HOST
493+
echo $GOBBY_FALKORDB_PORT
493494
gcode status
494495
```
495496

docs/plans/completed/standalone-schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
gcode currently cannot run without gobby having set up the database first. It has zero `CREATE TABLE` logic — writes silently fail, reads return empty when tables are missing. This plan adds self-initializing schema creation so gcode works fully standalone (FTS5 search, no external deps) while seamlessly integrating when gobby is installed (shared `~/.gobby/gobby-hub.db`).
66

7-
**Value ladder:** gcode standalone = fast FTS search. With gobby = adds Qdrant semantic search, Neo4j graph, AI summaries.
7+
**Value ladder:** gcode standalone = fast FTS search. With gobby = adds Qdrant semantic search, FalkorDB graph, AI summaries.
88

99
## Implementation
1010

0 commit comments

Comments
 (0)