? Ragbot.ai(以前命名為RBOT):Rajiv的開源AI增強大腦助手將大語言模型(LLMS)的力量與檢索增強發電(RAG)相結合。
ragbot.ai處理用戶提示以及自定義說明和策劃的數據集,從而實現了上下文感知的響應。由Openai的GPT和Anthropic的Claude ragbot.ai提供的LLMS提供支持,該技術結合了預訓練的密集檢索和順序到序列模型的力量,以生成更多的事實和信息性文本。
?自定義說明和策劃的數據集有助於ragbot.ai更好地理解上下文,從而產生個性化,更準確和相關的響應,從而超過了盒子LLM的功能。
由Rajiv Pant開發
代碼貢獻者和合作者
如何貢獻
歡迎您的代碼貢獻。請分配存儲庫,並提交您的改進請求。
介紹ragbot.ai:個性化的AI助手,由ragbot.ai撰寫
摘自博客文章:
作為AI助理,我提供了獨特的個性化和適應性水平,使我與Chatgpt Plus,Bing Chat和Google Bard的當前實現區分開來。通過使用包含自定義策劃數據集文件的文件夾,我可以迎合多種用例,例如個人生活,工作,教育和特定項目。這種自定義使我能夠以適合您獨特需求的方式來理解和支持您。
您可以使用策劃的數據集文件創建一個文件夾,其中包括個人信息,家庭詳細信息,旅行和食物偏好等。通過使用此信息,我可以作為您的個人生活助理,提供針對您特定背景的AI驅動建議和支持。
同樣,您可以開發另一個文件夾,其中包含與工作壽命相關的策劃數據集文件。這些文件可能包括有關您的工作,行業,同事,項目和其他與工作有關的信息的詳細信息。在這種情況下,我可以幫助您完成各種任務,例如起草電子郵件,日程安排會議,進行研究等,以提高您的效率和組織。
您還可以通過創建一個包含有關您的學術背景,感興趣的主題,課程和其他教育細節的信息的文件夾來定制我出於教育目的。在這個角色中,我可以提供個性化的教育支持,從幫助作業到解釋複雜的概念或推薦學習資源。
除上述用例外,我還可以量身定制以支持您在特定項目上。通過使用包含項目相關信息的策劃數據集文件創建一個文件夾,例如目標,團隊成員,截止日期和相關資源,我可以在整個項目生命週期中為您提供幫助,提供寶貴的見解和為每個獨特項目量身定制的支持。
我使用自定義的策劃數據集文件為不同需求創建不同的配置文件的能力使我與Chatgpt Plus,Bing Chat和Google Bard區分開。這種多功能性使我能夠在您生活的多個方面提供個性化的幫助,以確保我可以理解並滿足您的特定要求。
閱讀“安裝指南”以及“配置和個人化指南”。



generate_prompt_template.py是一個python腳本,通過串聯自定義說明和策劃數據集為AI助手生成提示模板。它可以幫助用戶創建個性化和上下文感知的提示,以增強其AI驅動工具的有效性。
有關如何使用generate_prompt_template.py及其好處的詳細信息,請參閱《生成提示模板指南》。
rajivpant@rp-2023-mac-mini ragbot % ./ragbot --help
usage: ragbot.py [-h] [-ls] [-p PROMPT | -f PROMPT_FILE | -i | --stdin]
[-profile PROFILE] [-c [CUSTOM_INSTRUCTIONS ...]] [-nc]
[-d [CURATED_DATASET ...]] [-nd]
[-e {openai,anthropic,google}] [-m MODEL] [-t TEMPERATURE]
[-mt MAX_TOKENS] [-l LOAD]
Ragbot.AI is an augmented brain and asistant. Learn more at https://ragbot.ai
options:
-h, --help show this help message and exit
-ls, --list-saved List all the currently saved JSON files.
-p PROMPT, --prompt PROMPT
The user's input to generate a response for.
-f PROMPT_FILE, --prompt_file PROMPT_FILE
The file containing the user's input to generate a
response for.
-i, --interactive Enable interactive assistant chatbot mode.
--stdin Read the user's input from stdin.
-profile PROFILE, --profile PROFILE
Name of the profile to use.
-c [CUSTOM_INSTRUCTIONS ...], --custom_instructions [CUSTOM_INSTRUCTIONS ...]
Path to the prompt custom instructions file or folder.
Can accept multiple values.
-nc, --nocusom_instructions
Ignore all prompt custom instructions even if they are
specified.
-d [CURATED_DATASET ...], --curated_dataset [CURATED_DATASET ...]
Path to the prompt context curated dataset file or
folder. Can accept multiple values.
-nd, --nocurated_dataset
Ignore all prompt context curated dataset even if they
are specified.
-e {openai,anthropic,google}, --engine {openai,anthropic,google}
The engine to use for the chat.
-m MODEL, --model MODEL
The model to use for the chat. Defaults to engine's
default model.
-t TEMPERATURE, --temperature TEMPERATURE
The creativity of the response, with higher values
being more creative.
-mt MAX_TOKENS, --max_tokens MAX_TOKENS
The maximum number of tokens to generate in the
response.
-l LOAD, --load LOAD Load a previous interactive session from a file.
rajivpant@rp-2023-mac-mini ragbot % 要使用ragbot.ai,您可以提供包含多個策劃數據集文件的策劃的數據集文件和/或文件夾。您可以在https://github.com/rajivpant/ragbot/tree/main/main/example-curated-datasets上查看策劃數據集文件的示例
示例1:
rajivpant@RP-2021-MacBook-Pro ragbot % ./ragbot.py -d custom-instructions/ curated-datasets/public/ ../ragbot-private/curated-datasets/personal/ ../ragbot-private/curated-datasets/hearst -p " Write a short note in Rajiv's voice about Rajiv's job, coworkers, family members, and travel and food preferences for the person temporarily backfilling for his EA. "
curated datasets being used:
- custom-instructions/
- curated-datasets/public/travel-food.md
- curated-datasets/public/employment-history.md
- curated-datasets/public/about.md
- curated-datasets/public/biography.md
- ../ragbot-private/curated-datasets/personal/accounts.md
- ../ragbot-private/curated-datasets/personal/contact-info.md
- ../ragbot-private/curated-datasets/personal/personal-family.md
- ../ragbot-private/curated-datasets/hearst/hearst.md
Using AI engine openai with model gpt-4
[redacted in this example]示例2:
rajivpant@RP-2021-MacBook-Pro ragbot % ./ragbot.py -d custom-instructions/ curated-datasets/public/ -p " Write a short resume of Rajiv "
curated datasets being used:
- custom-instructions/
- curated-datasets/public/travel-food.md
- curated-datasets/public/employment-history.md
- curated-datasets/public/about.md
- curated-datasets/public/biography.md
Using AI engine openai with model gpt-4
[truncated in this example]示例3:
./ragbot.py -p "Tell me a story about a brave knight and a wise wizard." -d curated datasets/story_characters要在交互式模式下使用ragbot.ai,請在不提供通過命令行或輸入文件提示的情況下使用-i或--interactive標誌。在此模式下,您可以在每個響應後輸入後續提示。
例子:
./ragbot.py -i -d curated-datasets/story_characters在第一個示例中,ragbot.ai使用../ragbot-private/curated-datasets文件夾中的策劃數據集文件在Rajiv的語音中生成了簡短的說明。在第二個示例中,ragbot.ai提供了有關使用curated-datasets/software_development.txt策劃數據集文件的軟件開發實踐的信息。在第三個示例中,ragbot.ai講述了一個關於勇敢的騎士和一個明智的巫師的故事,並使用curated-datasets/story_characters文件夾中的策劃數據集文件。
rajivpant@RP-2021-MacBook-Pro ragbot % ./ragbot.py -d ragbot.py -p " if no curated dataset files are being used, then I want the code to show that. "
curated datasets being used:
- ragbot.py
Using AI engine openai with model gpt-4
To modify the code to show a message when no curated dataset files are being used, you can add an else statement after checking for the curated dataset files. Update the code in the `main()` function as follows:
```python
if curated_dataset_files:
print("curated datasets being used:")
for file in curated_dataset_files:
print(f" - {file}")
else:
print("No curated dataset files are being used.")
```
This will print "No curated dataset files are being used." when there are no curated dataset files detected.
rajivpant@RP-2021-MacBook-Pro ragbot %
要求它猜測我使用的一些策劃的數據集文件是
rajivpant@RP-2021-MacBook-Pro ragbot % find curated-datasets ../ragbot-private/curated-datasets -print | ./ragbot.py -d custom-instructions/ curated-datasets/public/ ../ragbot-private/curated-datasets/personal/ ../ragbot-private/curated-datasets/hearst/ -p " What do you guess these files are for? "
curated datasets being used:
- custom-instructions/
- curated-datasets/public/travel-food.md
- curated-datasets/public/employment-history.md
- curated-datasets/public/about.md
- curated-datasets/public/biography.md
- ../ragbot-private/curated-datasets/personal/accounts.md
- ../ragbot-private/curated-datasets/personal/contact-info.md
- ../ragbot-private/curated-datasets/personal/personal-family.md
- ../ragbot-private/curated-datasets/hearst/hearst.md
Using AI engine openai with model gpt-4
These files appear to be related to the curated-datasets of an AI system, likely for generating text or providing assistance based on the provided information. The files seem to be divided into two categories: public and private.
Public files:
- curated-datasets/public/travel-food.md: Rajiv's travel and food preferences
- curated-datasets/public/employment-history.md: Rajiv's employment history
- curated-datasets/public/about.md: General information about Rajiv
- curated-datasets/public/biography.md: Biography of Rajiv
Private files (stored in a separate private folder):
- curated-datasets/personal/accounts.md: Semi-private personal account information, such as frequent flyer numbers or loyalty programs. Does not contain any confidential or sensitive information.
- curated-datasets/personal/contact-info.md: Personal contact information, such as phone numbers and email addresses. Does not contain any confidential or sensitive information.
- curated-datasets/personal/personal-family.md: Personal and family information, such as family members and relationships. Does not contain any confidential or sensitive information.
Hearst-specific files:
- curated-datasets/hearst/hearst.md: Non-confidential, publicly available information related to the Hearst corporation, including Rajiv's role there
Overall, these files seem to contain various information about a person, their preferences, and professional background, likely used to tailor the AI system's responses and assistance.
rajivpant@RP-2021-MacBook-Pro ragbot % 詢問有關項目的技術問題
❗️在當前版本的ragbot.ai中,-stdin和 - prompt選項是相互排斥的,因此以下示例不再效法。在將來對此讀取文件文件的更新中,我將舉一個替代示例來獲得類似的結果。
alexredmon@ar-macbook ~/s/scribe > cat docker-compose.yml | ragbot --stdin -p " which services will be exposed on which ports by running all services in the following docker-compose.yml file? "
In the given docker-compose.yml file, the following services are exposed on their respective ports:
1. "scribe" service: - Exposed on port 80 - Exposed on port 9009 (mapped to internal port 9009)
2. "scribe-feature" service: - Exposed on port 80
3. "scribe-redis" service: - Exposed on port 6379 (mapped to internal port 6379)
alexredmon@ar-macbook ~/s/scribe >將擬人引擎與Claude Instant Model一起使用
rajivpant@RP-2021-MacBook-Pro ragbot % ./ragbot.py -e anthropic -m " claude-instant-v1 " -p " Tell me 5 fun things to do in NYC. "
No curated dataset files are being used.
Using AI engine anthropic with model claude-instant-v1
Here are 5 fun things to do in NYC:
1. Visit Central Park. Walk the paths, rent a paddle boat, visit the zoo, catch a Shakespeare in the Park performance.
2. Catch a Broadway show. New York is the center of the theater world with some of the greatest plays and musicals on Broadway and off Broadway.
3. Go to the top of the Empire State Building. Take in the panoramic views of all of NYC from one of its most famous landmarks.
4. Shop and dine in SoHo and the West Village. Explore trendy boutique shops and dig into meals at charming sidewalk cafes.
5. Take a free walking tour. There are numerous companies that offer guided walking tours of various NYC neighborhoods, covering history, culture, architecture and more.
rajivpant@RP-2021-MacBook-Pro ragbot % 隨機創造力
❗️在當前版本的ragbot.ai中,-stdin和 - prompt選項是相互排斥的,因此以下示例不再效法。在將來對此讀取文件文件的更新中,我將舉一個替代示例來獲得類似的結果。
alexredmon@ar-macbook ~ > cat names.csv
rajiv,
jim,
dennis,
alexandria
alexredmon@ar-macbook ~ > catnames.csv | ragbot.py --stdin -p "Generate a creative nickname for each of the following people"
rajiv, Rajiv Razzle-Dazzle
jim, Jolly JimJam
dennis, Daring Denmaster
alexandria, All-Star Alexi
alexredmon@ar-macbook ~ >