After it's built, you'll see many data files in the `.ragit/` directory. You can ask queries on the knowledge-base now.
NOTE: You can ask queries on an incomplete knowledge-base, too.
## 2. (Optional) Clone Knowledge-Bases from web
This is the key part. You can download knowledge-bases from the internet and extend your knowledge-base with those. You can also share your knowledge-base with others.
First, let's make a fresh directory. Run `mkdir playground; cd playground`.
```
playground
```
Before downloading knowledge-bases, we have to init a rag index. Run `rag init`.
```
playground
|
*-- .ragit/
|
*-- chunks/
|
*-- configs/
|
*-- files/
|
*-- prompts/
|
*-- index.json
|
*-- models.json
```
You'll see an empty rag index. Now we have to download knowledge-bases from the web. I have uploaded a few sample knowledge-bases for you. You can `rag clone` them, like `rag clone http://ragit.baehyunsol.com/sample/git`
- [git](http://ragit.baehyunsol.com/sample/git)
- [ragit](http://ragit.baehyunsol.com/sample/ragit)
- [rustc-dev-guide](http://ragit.baehyunsol.com/sample/rustc)
Let's clone all of them. You cannot clone them inside `playground/`, because you knowledge-bases cannot be nested. Please make sure to `cd ..;` before you clone them.
Run `cd ..; rag clone http://ragit.baehyunsol.com/sample/git; rag clone http://ragit.baehyunsol.com/sample/ragit; rag clone http://ragit.baehyunsol.com/sample/rustc;`
```
<cwd>
|
*-- playground
| |
| *-- .ragit/
| |
| *-- .. many files and directories
|
*-- git
| |
| *-- .ragit/
| |
| *-- .. many files and directories
|
*-- ragit
| |
| *-- .ragit/
| |
| *-- .. many files and directories
|
*-- rustc
|
*-- .ragit/
|
*-- .. many files and directories
```
Now we have 1 empty knowledge-base and 3 complete knowledge-bases. We're gonna use the empty knowledge-base as the main one. Let's extend the empty one (playground).
Run `cd playground`. `rag merge ../git --prefix=git`, `rag merge ../ragit --prefix=ragit` and `rag merge ../rustc --prefix=rustc`.