? 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 ~ >