Add skill definition
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -22,7 +22,7 @@ wheels/
|
|||||||
|
|
||||||
# Virtual environments
|
# Virtual environments
|
||||||
venv/
|
venv/
|
||||||
.venv/
|
.venv*/
|
||||||
env/
|
env/
|
||||||
.env/
|
.env/
|
||||||
|
|
||||||
|
|||||||
55
README.md
55
README.md
@ -78,61 +78,6 @@ await search_knowledge({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
## Auto-Start on Boot
|
|
||||||
|
|
||||||
### Option 1: Systemd Service
|
|
||||||
|
|
||||||
Create `/etc/systemd/system/knowledge-rag.service`:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[Unit]
|
|
||||||
Description=Knowledge Base RAG MCP Server
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=ernie
|
|
||||||
WorkingDirectory=/home/ernie/knowledge-base
|
|
||||||
Environment="VAULT_PATH=/home/ernie/knowledge"
|
|
||||||
Environment="PATH=/home/ernie/.local/bin:/usr/bin:/bin"
|
|
||||||
ExecStart=/home/ernie/knowledge-base/.venv/bin/python -m knowledge_rag.server
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
```
|
|
||||||
|
|
||||||
Then enable:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable knowledge-rag.service
|
|
||||||
sudo systemctl start knowledge-rag.service
|
|
||||||
```
|
|
||||||
|
|
||||||
### Option 2: tmux/screen
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Start in tmux
|
|
||||||
tmux new -s knowledge-rag
|
|
||||||
source .venv/bin/activate
|
|
||||||
VAULT_PATH=./knowledge python -m knowledge_rag.server
|
|
||||||
# Detach: Ctrl+b, then d
|
|
||||||
```
|
|
||||||
|
|
||||||
### Option 3: rc.local or startup script
|
|
||||||
|
|
||||||
Add to your `~/.bashrc` or startup script:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Only start if not already running
|
|
||||||
if ! pgrep -f "knowledge_rag.server" > /dev/null; then
|
|
||||||
cd ~/knowledge-base
|
|
||||||
source .venv/bin/activate
|
|
||||||
VAULT_PATH=./knowledge nohup python -m knowledge_rag.server > /tmp/knowledge-rag.log 2>&1 &
|
|
||||||
fi
|
|
||||||
```
|
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
25
opencode_skill.md
Normal file
25
opencode_skill.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
name: knowledge-rag-usage
|
||||||
|
description: Use the knowledge-rag MCP server for building/using a growing knowledge base
|
||||||
|
---
|
||||||
|
|
||||||
|
## What I do
|
||||||
|
|
||||||
|
Provide guidelines on the use and building of the knowledge base.
|
||||||
|
|
||||||
|
## When to use me
|
||||||
|
|
||||||
|
- When you need to see if there is available knowledge to help complete the task
|
||||||
|
- Use the `search_knowledge` tool to get this knowledge
|
||||||
|
- When you need to add what you have learned to the knowledge base
|
||||||
|
- Add the knowledge in the form of a markdown file to `~/knowledge-base/knowledge` directory
|
||||||
|
- Index the knowledge with the `index_knowledge` with the `force=false` parameter so that it is available for searching
|
||||||
|
|
||||||
|
## Guidelines
|
||||||
|
|
||||||
|
- Upon the start of any task, you must check the knowledge base to see if there is existing information on the subject
|
||||||
|
- Upon completion of any task, you must add any useful knowledge learned to the knowledge base
|
||||||
|
- Any time you are corrected, you must add the correction to the knowledge base so that no mistake happens twice
|
||||||
|
- When adding new knowledge to the knowledge base, try to keep related knowledge to the same files
|
||||||
|
- Create new files only when no existing file contains information on that topic
|
||||||
|
- New knowledge must be brief. Use as little words possible to express the knowledge
|
||||||
Reference in New Issue
Block a user