From fb0eadafc16fa0e0ef05e313ef49107654844626 Mon Sep 17 00:00:00 2001 From: pavanmantha Date: Tue, 26 Nov 2024 23:07:27 +0530 Subject: [PATCH 1/3] -deep evals base --- bootstraprag/templates/evaluations/deep_evals/main.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 bootstraprag/templates/evaluations/deep_evals/main.py diff --git a/bootstraprag/templates/evaluations/deep_evals/main.py b/bootstraprag/templates/evaluations/deep_evals/main.py new file mode 100644 index 0000000..e69de29 From 756b9f19782dc406c9c74ef467818abafc8816db Mon Sep 17 00:00:00 2001 From: pavanmantha Date: Thu, 28 Nov 2024 06:40:47 +0530 Subject: [PATCH 2/3] crewai agents for prompting --- .../templates/crewai-agents/__init__.py | 0 bootstraprag/templates/crewai-agents/main.py | 45 +++++++++++++++++++ .../templates/crewai-agents/requirements.txt | 2 + 3 files changed, 47 insertions(+) create mode 100644 bootstraprag/templates/crewai-agents/__init__.py create mode 100644 bootstraprag/templates/crewai-agents/main.py create mode 100644 bootstraprag/templates/crewai-agents/requirements.txt diff --git a/bootstraprag/templates/crewai-agents/__init__.py b/bootstraprag/templates/crewai-agents/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bootstraprag/templates/crewai-agents/main.py b/bootstraprag/templates/crewai-agents/main.py new file mode 100644 index 0000000..95198d7 --- /dev/null +++ b/bootstraprag/templates/crewai-agents/main.py @@ -0,0 +1,45 @@ +from crewai import Agent, Task, Crew, Process, LLM + +llm = LLM(model="ollama/llama3.2:latest", base_url="http://localhost:11434", temperature=0.8, timeout=300) + +# Define the Prompt Supervisor agent +prompt_supervisor = Agent( + role='Prompt Supervisor', + goal='Ensure all agent prompts are clear, effective, and aligned with users objectives.', + backstory=( + "As a Prompt Supervisor, you have a keen eye for detail and a deep understanding " + "of effective communication strategies. Your mission is to review and refine prompts " + "to maximize the performance of AI agents." + ), + llm=llm +) + +# Define a task for the Prompt Supervisor to review and enhance the Senior Researcher's prompt +prompt_supervisor_task = Task( + description=( + "Review the prompt provided to the {topic} Senior prompt supervisor, assessing its clarity, " + "effectiveness, and alignment with the project's objectives. Provide constructive feedback " + "and suggest improvements to enhance the agent's performance." + ), + expected_output=( + "A detailed evaluation of the original prompt, including specific suggestions for improvement " + "and a revised version of the prompt that optimizes clarity and effectiveness along with few shot of examples." + ), + agent=prompt_supervisor +) + + +def main(): + # Forming the crew and kicking off the process + crew = Crew( + agents=[prompt_supervisor], + tasks=[prompt_supervisor_task], + process=Process.sequential, + verbose=True + ) + result = crew.kickoff(inputs={'topic': 'Get Financial data for 2023'}) + print(result) + + +if __name__ == "__main__": + main() diff --git a/bootstraprag/templates/crewai-agents/requirements.txt b/bootstraprag/templates/crewai-agents/requirements.txt new file mode 100644 index 0000000..b9b1d3d --- /dev/null +++ b/bootstraprag/templates/crewai-agents/requirements.txt @@ -0,0 +1,2 @@ +crewai +crewai-tools \ No newline at end of file From a6e79b3b019b2567f2cac14073f9d9582682e3a5 Mon Sep 17 00:00:00 2001 From: pavanmantha Date: Thu, 28 Nov 2024 22:46:44 +0530 Subject: [PATCH 3/3] -skeleton code for adv RAG techniques like recursive retriever and sub question query --- .../llamaindex/rag_with_recursive_retriever/__init__.py | 0 .../llamaindex/rag_with_recursive_retriever/api_server.py | 0 .../templates/llamaindex/rag_with_recursive_retriever/readme.md | 0 .../recursive_retriever_agents_core.py | 0 .../llamaindex/rag_with_recursive_retriever/requirements.txt | 1 + .../llamaindex/rag_with_sub_question_query_engine/__init__.py | 0 .../llamaindex/rag_with_sub_question_query_engine/api_server.py | 0 .../llamaindex/rag_with_sub_question_query_engine/readme.md | 0 .../rag_with_sub_question_query_engine/requirements.txt | 1 + .../sub_question_query_engine.py | 0 10 files changed, 2 insertions(+) create mode 100644 bootstraprag/templates/llamaindex/rag_with_recursive_retriever/__init__.py create mode 100644 bootstraprag/templates/llamaindex/rag_with_recursive_retriever/api_server.py create mode 100644 bootstraprag/templates/llamaindex/rag_with_recursive_retriever/readme.md create mode 100644 bootstraprag/templates/llamaindex/rag_with_recursive_retriever/recursive_retriever_agents_core.py create mode 100644 bootstraprag/templates/llamaindex/rag_with_recursive_retriever/requirements.txt create mode 100644 bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/__init__.py create mode 100644 bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/api_server.py create mode 100644 bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/readme.md create mode 100644 bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/requirements.txt create mode 100644 bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/sub_question_query_engine.py diff --git a/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/__init__.py b/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/api_server.py b/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/api_server.py new file mode 100644 index 0000000..e69de29 diff --git a/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/readme.md b/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/recursive_retriever_agents_core.py b/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/recursive_retriever_agents_core.py new file mode 100644 index 0000000..e69de29 diff --git a/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/requirements.txt b/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/requirements.txt new file mode 100644 index 0000000..b130564 --- /dev/null +++ b/bootstraprag/templates/llamaindex/rag_with_recursive_retriever/requirements.txt @@ -0,0 +1 @@ +llamaindex \ No newline at end of file diff --git a/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/__init__.py b/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/api_server.py b/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/api_server.py new file mode 100644 index 0000000..e69de29 diff --git a/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/readme.md b/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/requirements.txt b/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/requirements.txt new file mode 100644 index 0000000..b130564 --- /dev/null +++ b/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/requirements.txt @@ -0,0 +1 @@ +llamaindex \ No newline at end of file diff --git a/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/sub_question_query_engine.py b/bootstraprag/templates/llamaindex/rag_with_sub_question_query_engine/sub_question_query_engine.py new file mode 100644 index 0000000..e69de29