Constructdocs
section · guides

Query the knowledge base

Hybrid file + SQL + semantic retrieval over your project state.

2 min read·guides / cookbook / query-the-knowledge-base

Construct's knowledge layer is a hybrid store: BM25 + cosine vector search over indexed markdown chunks stored in a local SQLite file and an optional vector index. All operations work offline.

Ask a question

construct ask "what is the retry policy for the embed daemon?"

Runs hybrid retrieval over indexed observations, artifacts, and doc chunks. Returns an answer with cited sources and relevance scores.

Useful flags:

FlagEffect
--jsonOutput raw retrieval hits as JSON
--top=NReturn top N chunks (default: 5)

Search by keyword

construct search "storage backend"

Runs file, SQL, and semantic retrieval over core project state. Returns matching observations, docs, and snapshots with snippet previews.

View knowledge trends

construct knowledge trends

Shows recurring patterns across stored observations: which roles are most active, which categories recur most, and which observations have been retrieved most often.

Rebuild the knowledge index

construct knowledge index

Re-indexes all observations, artifacts, and snapshots from the local store. Run after bulk ingest operations or after manually editing .construct/knowledge/ files.

Ingest a document

construct ingest report.pdf
construct ingest ./meeting-notes/ --target=knowledge/decisions

Converts PDFs, DOCX, XLSX, and plain text into indexed markdown artifacts under .construct/knowledge/. The --sync flag also writes chunks into the vector index immediately.

FlagEffect
--target=MODEDestination lane: knowledge/internal, knowledge/external, knowledge/decisions, knowledge/how-tos, knowledge/reference
--out-dir=DIROverride output directory
--syncWrite chunks to vector index after conversion

Drop a recently downloaded file

construct drop

Ingests the most recent file dropped into ~/Downloads, Desktop, Documents, or iCloud Drive. Useful for quickly indexing a PDF or spreadsheet without specifying its full path.

FlagEffect
--listShow recent droppable files instead of ingesting
--index NPick the Nth file from the list
--since 1hLimit to files modified within the last hour

Inspect storage state

construct storage

Shows SQL and vector index status: row counts, last sync time, index size, and any sync errors.

construct storage --sync

Forces a full re-sync of file-state into SQL and vector storage.