Knowledge management - Experimental - CLI - Docs - Kiro
https://kiro.dev/docs/cli/experimental/knowledge-management/ • 367 KB fetched
Open original page
Knowledge management - Experimental - CLI - Docs - Kiro
Loading image... Product
* About Kiro
* IDE
* CLI
* Web
* Mobile
* Crew
* Pricing
* Downloads
For
* Enterprise
* Startups
* Students
Community
* Overview
* Ambassadors
* Discord
* Events
* Powers
* Shop
* Showcase
Resources
* Docs
* Blog
* Changelog
* FAQs
* Report a bug
* Suggest an idea
* Billing support
Social
*
*
*
*
*
*
*
English
Site Terms License Responsible AI Policy Legal Privacy Policy Cookie Preferences English
Loading image...
* Apps
* CLI
* Web
* Enterprise
* Pricing
* Docs
* Community
* Resources
SIGN IN DOWNLOADS
Loading image...
Get Started
Installation Authentication Your first project
Models
Overview Available models Reasoning effort
Features
How Kiro works Specs
Steering Hooks
MCP
Permissions Custom agents
Agent Skills Powers
Cloud sessions Compaction Kiroignore Checkpoints and rewind Built-in tools
Configuration scopes
IDE 1.x
What's new in 1.0
Setup & First Run Editor
Chat
Experimental
Troubleshooting 0.x reference
CLI
What's new in 3.0
Setup & First Run Terminal UI
Chat
Voice mode Headless mode ACP Auto complete Experimental
Knowledge management
Tangent mode
TODO lists
Thinking tool
Delegate
2.x reference
Crew
Quick start Installation Running 24/7 Chat
Agent Capabilities
Features
Interfaces
Apps
System & storage Configuration Security Troubleshooting
Web
Setup & First Run Identity Center Connect your repositories
Working with the agent
Autonomous mode Automations Memory Configuration Sync Sandbox
Mobile - Preview
Overview
Commands and Reference
CLI commands Slash commands Built-in tools Exit codes Settings
Billing
Overview Managing your subscription Upgrading your plan Downgrading your plan Cancelling your plan Purchasing add-on credits Managing your payments Managing usage notifications Managing your taxes Contacting billing support Deleting your account Related questions
Enterprise
Concepts Onboarding quickstart Connecting your identity provider
Deployment options Subscribe your team Manage subscriptions Governance
Monitor and track
Settings Managed updates Billing IAM Supported regions
Privacy and Security
Overview Data protection Code references Compliance validation Infrastructure security IAM permissions Firewalls, proxies, and data perimeters VPC endpoints (AWS PrivateLink)
Guides
Overview Language support
Learn by playing
Migration
Migrating from Q Developer Migrating from VSCode Upgrading from Q CLI
* Docs
*
* CLI
*
* Experimental
*
* Knowledge management
Copy page View as Markdown
Knowledge management
Copy page View as Markdown
The /knowledge command provides persistent knowledge base functionality for Kiro CLI, allowing you to store, search, and manage contextual information that persists across chat sessions.
Getting started
Enable knowledge feature
Knowledge management is experimental and must be enabled before use:
bash
kiro-cli settings chat.enableKnowledge true
Basic usage
Once enabled, use /knowledge commands within your chat session:
bash
/knowledge add --name myproject --path /path/to/project
/knowledge show
Commands
/knowledge show
Display all entries in your knowledge base with detailed information including creation dates, item counts, and persistence status. Also shows any active background indexing operations with progress and ETA.
This unified command provides a complete view of both your stored knowledge and ongoing operations.
bash
/knowledge show
/knowledge add
Add files or directories to your knowledge base. The system recursively indexes all supported files in directories.
Syntax:
bash
/knowledge add --name < name > --path < path > [ --include pattern ] [ --exclude pattern ] [ --index-type Fast | Best ]
Required Parameters:
* --name or -n : Descriptive name for the knowledge entry
* --path or -p : Path to file or directory to index
Examples:
bash
/knowledge add --name "project-docs" --path /path/to/documentation
/knowledge add -n "config-files" -p /path/to/config.json
/knowledge add --name "fast-search" --path /path/to/logs --index-type Fast
/knowledge add -n "semantic-search" -p /path/to/docs --index-type Best
Index types
Choose the indexing approach that best fits your needs:
Fast (Lexical - bm25)
Advantages:
* ✅ Lightning-fast indexing - processes files quickly
* ✅ Instant search - keyword-based with immediate results
* ✅ Low resource usage - minimal CPU and memory
* ✅ Perfect for logs, configs, and large codebases
Disadvantages:
* ❌ Less intelligent - requires exact keyword matches
Best (Semantic - all-minilm-l6-v2)
Advantages:
* ✅ Intelligent search - understands context and meaning
* ✅ Natural language queries - search with full sentences
* ✅ Finds related concepts - even without exact keywords
* ✅ Perfect for documentation and research
Disadvantages:
* ❌ Slower indexing - requires AI model processing
* ❌ Higher resource usage - more CPU and memory intensive
When to use each type
Use Case Recommended Type Why
Log files, error messages Fast Quick keyword searches, large volumes
Configuration files Fast Exact parameter/value lookups
Large codebases Fast Fast symbol and function searches
Documentation Best Natural language understanding
Research papers Best Concept-based searching
Mixed content Best Better overall search experience
Default behavior
If you don't specify --index-type , the system uses your configured default:
bash
# Set your preferred default
kiro-cli settings knowledge.indexType Fast # or Best
# This will use your default setting
/knowledge add "my-project" /path/to/project
Pattern filtering
Control which files are indexed using include and exclude patterns:
bash
/knowledge add "rust-code" /path/to/project --include "*.rs" --exclude "target/**"
/knowledge add "docs" /path/to/project --include "**/*.md" --include "**/*.txt" --exclude "node_modules/**"
Pattern Examples:
* *.rs - All Rust files recursively (equivalent to **/*.rs )
* **/*.py - All Python files recursively
* target/** - Everything in target directory
* node_modules/** - Everything in node_modules
Default Pattern Behavior:
When you don't specify patterns, the system uses configured defaults:
bash
kiro-cli settings knowledge.defaultIncludePatterns '["**/*.rs", "**/*.py"]'
kiro-cli settings knowledge.defaultExcludePatterns '["target/**", "__pycache__/**"]'
# Uses default patterns
/knowledge add "my-project" /path/to/project
# Overrides defaults
/knowledge add "docs-only" /path/to/project --include "**/*.md"
Supported file types
Text files: .txt, .log, .rtf, .tex, .rst
Markdown: .md, .markdown, .mdx
JSON: .json (treated as text for searchability)
Configuration: .ini, .conf, .cfg, .properties, .env
Data files: .csv, .tsv
Web formats: .svg (text-based)
Code files: .rs, .py, .js, .jsx, .ts, .tsx, .java, .c, .cpp, .h, .hpp, .go, .rb, .php, .swift, .kt, .kts, .cs, .sh, .bash, .zsh, .html, .htm, .xml, .css, .scss, .sass, .less, .sql, .yaml, .yml, .toml
Special files: Dockerfile, Makefile, LICENSE, CHANGELOG, README (files without extensions)
Note: Unsupported files are indexed without text content extraction.
/knowledge remove
Remove entries from your knowledge base by name, path, or context ID.
bash
/knowledge remove "project-docs" # Remove by name
/knowledge remove /path/to/old/project # Remove by path
/knowledge update
Update (re-index) an existing knowledge base entry with new content. Original include/exclude patterns are preserved.
bash
# Re-index a single entry
/knowledge update /path/to/updated/project
# Re-index every entry at once
/knowledge update
Run /knowledge update with no arguments to re-index every entry in your knowledge base at once, instead of updating one path at a time.
/knowledge clear
Remove all entries from your knowledge base. Requires confirmation and cannot be undone.
bash
/knowledge clear
You'll be prompted:
⚠️ This will remove ALL knowledge base entries. Are you sure? (y/N):
/knowledge cancel
Cancel background operations. Cancel specific operation by ID or all operations.
bash
/knowledge cancel abc12345 # Cancel specific operation
/knowledge cancel all # Cancel all operations
Configuration
Configure knowledge base behavior:
bash
# Maximum files per knowledge base
kiro-cli settings knowledge.maxFiles 10000
# Text chunk size for processing
kiro-cli settings knowledge.chunkSize 1024
# Overlap between chunks
kiro-cli settings knowledge.chunkOverlap 256
# Default index type
kiro-cli settings knowledge.indexType Fast
# Default include patterns
kiro-cli settings knowledge.defaultIncludePatterns '["**/*.rs", "**/*.md"]'
# Default exclude patterns
kiro-cli settings knowledge.defaultExcludePatterns '["target/**", "node_modules/**"]'
Agent-specific knowledge bases
Isolated knowledge storage
Each agent maintains its own isolated knowledge base, ensuring knowledge contexts are scoped to the specific agent you're working with. This provides better organization and prevents knowledge conflicts.
Folder structure
Knowledge bases are stored in your system's local data directory:
* macOS : ~/Library/Application Support/kiro-cli/knowledge_bases/
* Linux : ~/.local/share/kiro-cli/knowledge_bases/
* Windows : %LOCALAPPDATA%\kiro-cli\knowledge_bases\
knowledge_bases/
├── kiro_cli_default/ # Default agent
│ ├── contexts.json
│ ├── context-id-1/
│ │ ├── data.json
│ │ └── bm25_data.json
│ └── context-id-2/
│ └── data.json
├── my-custom-agent_<code>/ # Custom agent
│ ├── contexts.json
│ └── context-id-3/
│ └── data.json
└── another-agent_<code>/ # Another agent
├── contexts.json
└── context-id-4/
└── data.json
How agent isolation works
* Automatic Scoping : /knowledge commands operate on current agent's knowledge base
* No Cross-Agent Access : Agent A cannot access Agent B's knowledge
* Independent Configuration : Each agent has different settings and contexts
* Migration Support : Legacy knowledge bases migrate to default agent
Agent switching
When you switch agents, knowledge commands automatically work with that agent's knowledge base.
bash
# Working with default agent
/knowledge add /path/to/docs
# Switch to custom agent
kiro chat --agent my-custom-agent
# Creates separate knowledge base for my-custom-agent
/knowledge add /path/to/agent/docs
# Switch back to default
kiro chat
# Only sees original docs, not agent-specific docs
/knowledge show
Info
Knowledge base resources defined in an agent's configuration sync automatically on session init and agent swap, so agent-defined knowledge bases are indexed without manual intervention.
How it works
Indexing process
* Pattern Filtering : Files filtered by include/exclude patterns
* File Discovery : Recursive scan for supported file types
* Content Extraction : Text extracted from each file
* Chunking : Large files split into searchable chunks
* Background Processing : Asynchronous indexing
* Semantic Embedding : Content processed for semantic search
Search capabilities
Knowledge bases use semantic search:
* Natural language queries
* Results ranked by relevance, not just keywords
* Related concepts found even without exact word matches
Persistence
* Contexts survive across chat sessions and CLI restarts
* Persistence determined automatically by usage patterns
* Include/exclude patterns stored and reused during updates
Best practices
Organizing your knowledge base
* Use descriptive names: "api-documentation" not "docs"
* Group related files in directories before adding
* Use include/exclude patterns to focus on relevant files
* Regularly review and update outdated contexts
Effective searching
* Use natural language: "how to handle authentication errors using the knowledge tool"
* Be specific: "database connection configuration"
* Try different phrasings if initial searches don't work
* Prompt Kiro to use the tool: "find database connection configuration using your knowledge bases"
Managing large projects
* Add project directories rather than individual files
* Use patterns to avoid build artifacts: --exclude "target/**" --exclude "node_modules/**"
* Use /knowledge show to monitor indexing progress
* Consider breaking large projects into logical sub-directories
Pattern filtering best practices
* Be specific : Use precise patterns to avoid over-inclusion
* Exclude build artifacts : Always exclude target/** , node_modules/** , .git/**
* Include relevant extensions : Focus on file types you need
* Test patterns : Verify patterns match expected files before large operations
Limitations
File type support
* Binary files ignored during indexing
* Very large files may be chunked, potentially splitting related content
* Some specialized formats may not extract content optimally
Performance considerations
* Large directories may take significant time to index
* Background operations limited by concurrent processing
* Search performance varies by knowledge base size
* Pattern filtering improves performance for large directories
Storage and persistence
* No explicit storage size limits, but practical limits apply
* No automatic cleanup of old or unused contexts
* Clear operations are irreversible with no backup
Troubleshooting
Files not being indexed
* Check patterns : Ensure include patterns match your files
* Verify exclude patterns : Make sure they're not filtering desired files
* Check file types : Ensure files have supported extensions
* Monitor progress : Use /knowledge show to check indexing status
* Verify paths : Ensure paths exist and are accessible
* Check for errors : Look for error messages in CLI output
Search not finding expected results
* Wait for indexing : Use /knowledge show to ensure completion
* Try different queries : Use various phrasings and keywords
* Verify content : Confirm content was added with /knowledge show
* Check file types : Unsupported types won't have searchable content
Performance issues
* Check operations : Use /knowledge show for progress
* Cancel if needed : Use /knowledge cancel for problematic operations
* Add smaller chunks : Consider subdirectories instead of entire projects
* Use better patterns : Exclude unnecessary files
* Adjust settings : Lower maxFiles or chunkSize for better performance
Pattern issues
* Test patterns : Start simple, then add complexity
* Check syntax : Ensure glob patterns use correct syntax ( ** for recursive)
* Verify paths : Make sure patterns match actual file paths
* Use absolute patterns : Consider full paths for precision
Next steps
* Context Management
* Custom Agents
* Settings Configuration
* Experimental Features
Page updated: August 4, 2026
Experimental
Tangent mode
Links found on this page
- About Kiro [direct]
- IDE [direct]
- CLI [direct]
- Web [direct]
- Mobile [direct]
- Crew [direct]
- Pricing [direct]
- Downloads [direct]
- Enterprise [direct]
- Startups [direct]
- Students [direct]
- Overview [direct]
- Ambassadors [direct]
- Discord [direct]
- Events [direct]
- Powers [direct]
- Shop [direct]
- Showcase [direct]
- Docs [direct]
- Blog [direct]
- Changelog [direct]
- FAQs [direct]
- Report a bug [direct]
- Suggest an idea [direct]
- Billing support [direct]
- Site Terms [direct]
- License [direct]
- Responsible AI Policy [direct]
- Legal [direct]
- Privacy Policy [direct]
- Cookie Preferences [direct]
- Loading image... [direct]
- SIGN IN [direct]
- Installation [direct]
- Authentication [direct]
- Your first project [direct]
- Overview [direct]
- Available models [direct]
- Reasoning effort [direct]
- How Kiro works [direct]
- Specs [direct]
- Steering [direct]
- Hooks [direct]
- MCP [direct]
- Permissions [direct]
- Custom agents [direct]
- Agent Skills [direct]
- Powers [direct]
- Cloud sessions [direct]
- Compaction [direct]
- Kiroignore [direct]
- Checkpoints and rewind [direct]
- Built-in tools [direct]
- Configuration scopes [direct]
- What's new in 1.0 [direct]
- Setup & First Run [direct]
- Editor [direct]
- Chat [direct]
- Experimental [direct]
- Troubleshooting [direct]
- 0.x reference [direct]
- What's new in 3.0 [direct]
- Setup & First Run [direct]
- Terminal UI [direct]
- Chat [direct]
- Voice mode [direct]
- Headless mode [direct]
- ACP [direct]
- Auto complete [direct]
- Experimental [direct]
- Tangent mode [direct]
- TODO lists [direct]
- Thinking tool [direct]
- Delegate [direct]
- 2.x reference [direct]
- Quick start [direct]
- Installation [direct]
- Running 24/7 [direct]
- Chat [direct]
- Agent Capabilities [direct]