Skip to content

improvements | added new prompt | refactoring#8

Open
vedas-dixit wants to merge 1 commit into
mainfrom
minor-improvements
Open

improvements | added new prompt | refactoring#8
vedas-dixit wants to merge 1 commit into
mainfrom
minor-improvements

Conversation

@vedas-dixit
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings January 17, 2026 11:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the codebase by extracting tool imports into a centralized wrapper module, adds a new research prompt, and makes configuration adjustments. The changes aim to improve code organization and introduce a more structured prompt system.

Changes:

  • Created tools/tools_wrapper.py to centralize tool imports and exports
  • Added new KURAMA_RESEARCH_PROMPT prompt template for research agent behavior
  • Updated requirements.txt to include google-search-results package
  • Refactored agent.py to use centralized tools import and new prompt

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 8 comments.

File Description
tools/tools_wrapper.py New file that centralizes all tool imports into a single exportable list for cleaner imports
requirements.txt Added google-search-results dependency and fixed formatting issues
prompts/research_prompt.py Added new KURAMA_RESEARCH_PROMPT and Tools variable (unused) with instructions for research agent
agent.py Refactored to import tools from wrapper module, switched to KURAMA_RESEARCH_PROMPT, adjusted recursion limits

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread agent.py
from retriever import add_to_db,query_db
from prompts.research_prompt import KURAMA_RESEARCH_PROMPT_GENERIC, KURAMA_RESEARCH_PROMPT_DEEPRESEARCH
from tools.tools_wrapper import tools
from prompts.research_prompt import KURAMA_RESEARCH_PROMPT_GENERIC, KURAMA_RESEARCH_PROMPT_DEEPRESEARCH,KURAMA_RESEARCH_PROMPT
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after comma in the import statement. Python style guidelines (PEP 8) recommend adding a space after commas in import statements for better readability.

Suggested change
from prompts.research_prompt import KURAMA_RESEARCH_PROMPT_GENERIC, KURAMA_RESEARCH_PROMPT_DEEPRESEARCH,KURAMA_RESEARCH_PROMPT
from prompts.research_prompt import KURAMA_RESEARCH_PROMPT_GENERIC, KURAMA_RESEARCH_PROMPT_DEEPRESEARCH, KURAMA_RESEARCH_PROMPT

Copilot uses AI. Check for mistakes.
Comment thread agent.py

llm = ChatOllama(model="gpt-oss:120b-cloud", temperature=0.7)
recursion_limit = 100
llm = ChatOllama(model="gpt-oss:120b-cloud", temperature=0.7,verbose=True)
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after comma in the function call. Python style guidelines (PEP 8) recommend adding a space after commas in function arguments for better readability.

Suggested change
llm = ChatOllama(model="gpt-oss:120b-cloud", temperature=0.7,verbose=True)
llm = ChatOllama(model="gpt-oss:120b-cloud", temperature=0.7, verbose=True)

Copilot uses AI. Check for mistakes.
Comment thread tools/tools_wrapper.py
Comment on lines +21 to +37
smart_math,
duck_duck_go_search,
duck_duck_go_search_results,
searx_search,
add_to_db,
query_db,
asknews_search,
serp_search,
arxiv_search,
crossref_search,
unpaywall_lookup,
europe_pmc_search,
openlibrary_search,
get_current_date,
save_md_locally,
save_md_plus,
summarize_text
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation in the tools list. Lines 21-37 use varying levels of indentation (some lines have extra spaces at the beginning), which reduces code readability. The entire list should use consistent 4-space indentation.

Suggested change
smart_math,
duck_duck_go_search,
duck_duck_go_search_results,
searx_search,
add_to_db,
query_db,
asknews_search,
serp_search,
arxiv_search,
crossref_search,
unpaywall_lookup,
europe_pmc_search,
openlibrary_search,
get_current_date,
save_md_locally,
save_md_plus,
summarize_text
smart_math,
duck_duck_go_search,
duck_duck_go_search_results,
searx_search,
add_to_db,
query_db,
asknews_search,
serp_search,
arxiv_search,
crossref_search,
unpaywall_lookup,
europe_pmc_search,
openlibrary_search,
get_current_date,
save_md_locally,
save_md_plus,
summarize_text

Copilot uses AI. Check for mistakes.
Comment on lines +251 to +253
-> Internal reason before taking action
-> never process sensitive request that makes you search any negative things and abuse tool calling in terms of. "*add thinhs herr"
->
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This instruction is unclear and appears incomplete. The phrase "never process sensitive request that makes you search any negative things and abuse tool calling in terms of" lacks grammatical correctness and doesn't clearly define what behavior should be avoided. The instruction should be rewritten to clearly specify what types of requests should be rejected and why.

Suggested change
-> Internal reason before taking action
-> never process sensitive request that makes you search any negative things and abuse tool calling in terms of. "*add thinhs herr"
->
-> Internally reason through your plan before taking any action or calling any tool.
-> Do not fulfill or assist with requests involving hate, harassment, self-harm, explicit sexual content, illegal activities, or other clearly harmful behavior. If a user asks for such content, politely refuse and, when appropriate, offer safer alternatives or high-level harm-reduction information.
-> Do not abuse tools (for example, do not use them to search for or distribute harmful, unsafe, or disallowed content). Use tools only when they are necessary and in compliance with these safety rules.

Copilot uses AI. Check for mistakes.
Below are strict rules for you to follow:
Do's:
-> Internal reason before taking action
-> never process sensitive request that makes you search any negative things and abuse tool calling in terms of. "*add thinhs herr"
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line contains multiple issues: incomplete sentence structure, unclear meaning, and a spelling error. The text "never process sensitive request that makes you search any negative things and abuse tool calling in terms of. "*add thinhs herr"" is grammatically incorrect and contains the spelling error "thinhs" instead of "things". Additionally, the line ends with an incomplete thought and unexplained placeholder text.

Suggested change
-> never process sensitive request that makes you search any negative things and abuse tool calling in terms of. "*add thinhs herr"
-> Never process sensitive requests that require searching for harmful, abusive, or otherwise unsafe content, or that would constitute abuse of tool calling.

Copilot uses AI. Check for mistakes.
Do's:
-> Internal reason before taking action
-> never process sensitive request that makes you search any negative things and abuse tool calling in terms of. "*add thinhs herr"
->
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty list item with only "->" and no content. This appears to be an incomplete placeholder that should either be removed or completed with the intended rule.

Suggested change
->

Copilot uses AI. Check for mistakes.
Comment on lines +245 to +276
Tools = """
# Role
You are **Kurama Research Agent v1.3**, an autonomous research assistant built by Vedas Dixit.

Below are strict rules for you to follow:
Do's:
-> Internal reason before taking action
-> never process sensitive request that makes you search any negative things and abuse tool calling in terms of. "*add thinhs herr"
->
### Tools & When to Use Them
| Tool | Primary Use | Notes |
|------|-------------|-------|
| **query_db(query: str, top_k: int = 3)** | **Always run first** to recover prior facts. | If confidence ≥ “good enough”, avoid external search. |
| **add_to_db(text: str, metadata: dict = None)** | Store only verified, source-attributed insights. | No raw dumps; store distilled facts. |
| **wiki_search(query)** | Definitions, background, stable facts. | Prefer for non-time-sensitive info. |
| **duck_duck_go_search(query: str) -> str** | General web discovery, broad coverage. | Use if you need diverse sources. |
| **duck_duck_go_search_results(query: str) -> str** | Get multiple URLs for triangulation. | Use when you need citations. |
| **serp_search(query: str) -> str** | **Targeted Google-quality lookup** for specific gaps. | **Use sparingly**: only if a precise fact is missing or verification is required and other tools failed. |
| **asknews_search(query)** | News/events within last 6–12 months. | Prefer for timely topics. |
| **arxiv_search(query: str) -> str** | Scientific/technical sources. | Use for papers, methods, benchmarks. |
| **crossref_search(query: str) -> str** | Scholarly metadata by topic/keywords. | Use to discover DOIs, titles, years, and links. |
| **unpaywall_lookup(doi_and_email: str) -> str** | Find open-access links for a DOI. | Requires email inline (email=you@x.com) or env UNPAYWALL_EMAIL. |
| **europe_pmc_search(query: str) -> str** | Biomedical and life-science literature. | Use for bio/medical topics; returns IDs and links. |
| **openlibrary_search(query: str) -> str** | Books and editions. | Use for books/authors/editions metadata. |
| **smart_math(expression: str) -> float** | Numeric/logic. | Never guess numbers. |
| **get_current_date()** | Freshness checks. | Verify year before calling something “latest”. |
| **save_md_locally(content: str, filename: str = None) -> str** | Save concise or single-phase research reports. | **Mandatory** for every research session. Called after synthesis or summarization. |
| **save_md_plus(content: str, filename: str = None) -> str** | Progressive save tool for **detailed or comprehensive research**. | Use **only if** the user explicitly requests “detailed”, “in-depth”, “long-form”, “comprehensive”, “thesis-like”, or “step-by-step” research. Append each phase iteratively to build a long Markdown document. |
| **summarize_text(text: str) -> str** | Compress long sources. | Use before saving or adding to DB. |
| **searx_search(query)** | Privacy-respecting web search via SearxNG. | Use if you need a different perspective or if other search tools are insufficient. |
---
"""
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name "Tools" is assigned but never used or exported. This appears to be a prompt template that might have been intended to be used but is not referenced anywhere in the codebase. Consider either removing it or incorporating it into the active prompts.

Copilot uses AI. Check for mistakes.
Comment thread agent.py
from retriever import add_to_db,query_db
from prompts.research_prompt import KURAMA_RESEARCH_PROMPT_GENERIC, KURAMA_RESEARCH_PROMPT_DEEPRESEARCH
from tools.tools_wrapper import tools
from prompts.research_prompt import KURAMA_RESEARCH_PROMPT_GENERIC, KURAMA_RESEARCH_PROMPT_DEEPRESEARCH,KURAMA_RESEARCH_PROMPT
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'KURAMA_RESEARCH_PROMPT_GENERIC' is not used.
Import of 'KURAMA_RESEARCH_PROMPT_DEEPRESEARCH' is not used.

Suggested change
from prompts.research_prompt import KURAMA_RESEARCH_PROMPT_GENERIC, KURAMA_RESEARCH_PROMPT_DEEPRESEARCH,KURAMA_RESEARCH_PROMPT
from prompts.research_prompt import KURAMA_RESEARCH_PROMPT

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants