Skip to content

Commit

Permalink
fix typos + update scripts with the new command line
Browse files Browse the repository at this point in the history
  • Loading branch information
Jalalx committed Jul 21, 2024
1 parent f35f09e commit 0b8ad01
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
## How to query information?
Simply use the `query` parameter to retrieve relevant informations. You can use the `--limit` parameter to indicate how many of most relevant entries you want to retrieve.
```
./kdb query "What is life meaning?" --limit 1
./kdb query "What is the meaning of life?" --limit 1
```
as you can see it doesn't return anything, because it doesn't have any knowledge yet.


## How to add knowledge?
You can use the `embed` paramter to pass a piece of knowledge to the database.
```
./kdb embed "Here is a sample piece of information that will be remembed forever!"
./kdb embed "Here is a sample piece of information to be remembered!"
```
There is a script in the `test_content` directory which you can use to add some sample knowledge.
```
Expand Down
2 changes: 1 addition & 1 deletion scripts/ask
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TOP_ANSWERS=3
PROMPT="Use the given context to answer the question. Don't do yapping. Also don't mention that you answer using the given context. If you don't know the answer according to the context, just say you don't know the answer. Do not make up answers. Context:\n"

# Get the context from the kdb command-line app
CONTEXT=$(kdb --query "$QUESTION" --top $TOP_ANSWERS)
CONTEXT=$(kdb query "$QUESTION" --limit $TOP_ANSWERS)

# Combine the prompt, context, and the question
combined_input="${PROMPT}${CONTEXT}\n\nQuestion: ${QUESTION}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/learn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ if [ $# -eq 0 ]; then
exit 1
fi

kdb --embed "$1"
kdb embed "$1"

echo "Embedding was successful!"
2 changes: 1 addition & 1 deletion test_content/train.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/bin/bash

while IFS= read -r line; do
kdb --embed "$line"
kdb embed "$line"
done < ./gk_training_data.txt

0 comments on commit 0b8ad01

Please sign in to comment.