TIP
This guide shows you how to use lovrabet kb to create, view, update, and search your personal knowledge base within the current app. Once that's done, the Agent can draw on these business rules, SOPs, and fixed notes whenever a search hits them.
Prerequisites
| Item | Requirement | How to check |
|---|---|---|
| Lovrabet Runtime CLI | lovrabet runs locally | lovrabet --help |
| AccessKey | Your account has access to the target app | lovrabet auth status |
| Target app | You know the app name or appcode | lovrabet app list |
| Knowledge content file | A local UTF-8 text or Markdown file | e.g. ./approval.md |
WARNING
A personal knowledge base only holds knowledge the current user writes in the current app. lovrabet kb search searches both the company knowledge and personal knowledge visible to you, telling them apart with scope.
Sign in and pick your app
lovrabet auth login --access-key <ACCESS_KEY>
lovrabet auth statuslovrabet app list
lovrabet app use <应用名称>If you'd rather not set a default app, append --appcode <APP_CODE> to each command instead.
Create a personal knowledge base entry
Start by writing the rules you want to store into a local file. Both create and update read the body from a file — passing inline content in the command is not supported.
# 订单审批规则
- 金额超过 50000 元,需要主管审批。
- 加急订单必须填写加急原因。
- 缺少客户编号时,不允许进入审批。Preview the create request
lovrabet kb create --title "订单审批规则" --file ./approval.md --dry-runCheck that appCode, title, and the file body in the preview look right, then run the actual create.
Create the entry
lovrabet kb create --title "订单审批规则" --file ./approval.md --format compressOn success, the output includes fields such as id, title, version, ragStatus, ragErrorMessage, and updateTime. Note down the id — you'll need it for updates and detail lookups.
View and update personal knowledge
List your entries
lovrabet kb list --format compressBy default, the list shows each entry's id, title, version, ragStatus, and update time.
View an entry's body
lovrabet kb detail --id <条目ID> --format compressThe detail command returns the full body, version, creation time, update time, and RAG status. Reading the detail before an update helps you avoid overwriting the wrong entry.
Update an entry from a file
lovrabet kb update --id <条目ID> --file ./approval-v2.md --dry-run
lovrabet kb update --id <条目ID> --file ./approval-v2.md --format compressWhen you omit --title, the CLI reads the current entry first and keeps the original title. Pass a new title explicitly when you want to change it.
lovrabet kb update --id <条目ID> --title "新版订单审批规则" --file ./approval-v2.md --format compressWARNING
lovrabet kb currently has no delete command. To delete a knowledge entry, use the product UI.
Search the knowledge base
Search by business question
lovrabet kb search --query "订单审批" --topk 5 --format compressThe result returns the hit count and hits. Each hit contains scope, docId, score, weightedScore, content, and metadata. scope distinguishes company knowledge from personal knowledge.
| Field | Meaning |
|---|---|
PERSONAL | Personal knowledge written by the current user |
COMPANY | Company knowledge visible to the current user |
score | Raw similarity score |
weightedScore | Weighted ranking score |
Check the RAG status
A successful create or update only means the entry has been written. To confirm the Agent can actually retrieve it, keep an eye on ragStatus and search hits.
| ragStatus | What to do |
|---|---|
PENDING | Waiting to sync. Check the detail or search again later. |
PARSING | Parsing the file. Check again later. |
INDEXING | Building the index. Check again later. |
READY | Searchable. Verify hits with kb search. |
FAILED | Check ragErrorMessage, fix the document, and update again. |
DISABLED | RAG search is disabled in this environment. You can only confirm the entry is saved. |
lovrabet kb detail --id <条目ID> --format compress
lovrabet kb search --query "刚写入的关键词" --topk 5 --format compressSave knowledge in an Agent conversation
To save knowledge during a Lovrabet Runtime Agent conversation, state the title and body clearly first. The Agent writes to the personal knowledge base only when the content is unambiguous.
把下面这条规则保存到知识库,标题叫「订单审批规则」:
金额超过 50000 元,需要主管审批;加急订单必须填写加急原因。| Agent behavior | What you see |
|---|---|
| Confirms the title and body | Title and body come from your explicit input or content already confirmed in the conversation |
| Calls the knowledge write capability | Creates or updates personal knowledge in the current app |
| Opens the detail after a successful write | If a kbId is returned, the page opens the corresponding knowledge entry |
| Searches knowledge | The Agent can search company and personal knowledge by question |
WARNING
Never store AccessKeys, cookies, account passwords, customer PII, or throwaway debug details in a knowledge base. Knowledge bases are for stable rules, SOPs, field definitions, query conditions, and reusable cases.
Final checklist
[ ] You have written an entry with
lovrabet kb createorlovrabet kb update.[ ] You ran
lovrabet kb detail --id <entry ID>and saw the correct title, body, and version.[ ]
ragStatusisREADY, or you've confirmed the environment is in a waiting, failed, or disabled state.[ ] You found the keywords you just wrote with
lovrabet kb search.[ ] If the Agent needs to use the knowledge, you verified with the same business question that its answer reflects it.
FAQ
"Authentication required"
No AccessKey is configured locally, or the current environment can't read the configuration. Sign in first.
lovrabet auth login --access-key <ACCESS_KEY>
lovrabet auth status"App code is required"
The command couldn't resolve the target app. Set a default app first, or append --appcode <APP_CODE> explicitly.
lovrabet app list
lovrabet app use <应用名称>"File not found"
The file --file points to doesn't exist or isn't a regular file. Check the path and retry. Both create and update require a local file.
Search returns no hits
Check ragStatus in the entry detail first. If it is still PENDING, PARSING, or INDEXING, search again later. If it's FAILED, fix the document based on ragErrorMessage and update again.
Can I delete knowledge entries with the CLI?
No. lovrabet kb currently supports only list, detail, create, update, and search. Handle deletion in the product UI.