Knowledge Commands
Manage knowledge bases, trigger ingestion, and run ad-hoc queries directly from the CLI.
Overview
compozy knowledge [command]
Apply Resources
Create or update knowledge bases, embedders, and vector databases from YAML.
Ingest Documents
Run ingestion jobs with progress logging and idempotent hashing.
Query Context
Test retrieval parameters before binding knowledge to workflows.
Subcommands
list
– List knowledge bases with pagination.get
– Fetch a single knowledge base in YAML or JSON format.apply
– Create or update knowledge resources; respects ETag concurrency.delete
– Remove a knowledge base and associated vectors.ingest
– Trigger ingestion for the specified knowledge base.query
– Execute dense retrieval against a knowledge base.
compozy knowledge list
compozy knowledge list --project ./examples/knowledge/quickstart-markdown-glob
Flag | Description | Default |
---|---|---|
--project | Path to a project directory. | Current directory |
--page-size | Number of results per page. | 20 |
--format | Output format (table , json ). | table |
compozy knowledge get
compozy knowledge get quickstart_docs --format yaml
- Supports strong ETag concurrency using the
etag
field in responses. - Combine with
--output
to write definitions to disk.
compozy knowledge apply
compozy knowledge apply --file compozy.yaml
- Applies embedders, vector DBs, and knowledge bases in a single pass.
- Use
--dry-run
to preview changes without persisting them. - Matches the API semantics of
PUT /knowledge-bases/{kb_id}
.
compozy knowledge delete
compozy knowledge delete quickstart_docs --force
- Removal cascades to vector rows only; external blob stores remain untouched.
- Requires confirmation unless
--force
is provided.
compozy knowledge ingest
compozy knowledge ingest --id quickstart_docs --project examples/knowledge/quickstart-markdown-glob
- Idempotent: unchanged chunks are skipped automatically.
- Use
--batch-size
to overrideconfig.knowledge.embedder_batch_size
for a single run. - With
--verbose
, structured logs show chunk counts and failures sourced fromlogger.FromContext(ctx)
.
compozy knowledge query
compozy knowledge query --id quickstart_docs \
--text "What is the support SLA?" \
--top_k 3 \
--min_score 0.25 \
--output json
- Returns scored matches, metadata, and ETags for auditing.
- Combine with
jq
to inspect chunk IDs and source paths.
End-to-End Walkthroughs
Quickstart Markdown Glob
Zero-dependency walkthrough using the filesystem vector store.
pgvector Basic
Run ingestion and queries backed by the pgvector adapter.
CLI Query Debugging
Use the query command to validate retrieval parameters.
Best Practices
For additional automation patterns, see the Knowledge Ingestion guide.
Configuration Commands
The `compozy config` command group provides comprehensive tools for managing, validating, and diagnosing your Compozy configuration. These commands ensure your setup is correct, optimized, and ready for production deployment.
Workflow Commands
The workflow command group provides comprehensive workflow management capabilities including listing, inspecting, and executing workflows. These commands form the core of workflow orchestration in Compozy.