Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
AgentSearch is a framework for powering search agents by seamlessly integrating LLM technologies from various providers with different search engines. This integration enables search agents to perform a wide range of functions through Retrieval-Augmented Generation (RAG), including summarizing search results, generating new queries, and retrieving detailed downstream results.
pip install agent-search
Get your free API key from SciPhi and set it in your environment:
export SCIPHI_API_KEY=$MY_SCIPHI_API_KEY
Call a pre-configured search agent endpoint:
# Requires SCIPHI_API_KEY in the environment
from agent_search import SciPhi
client = SciPhi()
# Search, then summarize result and generate related queries
agent_summary = client.get_search_rag_response(query='latest news', search_provider='bing', llm_model='SciPhi/Sensei-7B-V1')
print(agent_summary)
# { 'response': '...', 'other_queries': '...', 'search_results': '...' }
Standalone searches and from the AgentSearch search engine are supported:
# Requires SCIPHI_API_KEY in the environment
from agent_search import SciPhi
client = SciPhi()
# Perform a search
search_response = client.search(query='Quantum Field Theory', search_provider='agent-search')
print(search_response)
# [{ 'score': '.89', 'url': 'https://...', 'metadata': {...} }]
Code your own custom search agent workflow:
# Requires SCIPHI_API_KEY in the environment
from agent_search import SciPhi
client = SciPhi()
# Specify instructions for the task
instruction = "Your task is to perform retrieval augmented generation (RAG) over the given query and search results. Return your answer in a json format that includes a summary of the search results and a list of related queries."
query = "What is Fermat's Last Theorem?"
# construct search context
search_response = client.search(query=query, search_provider='agent-search')
search_context = "\n\n".join(
f"{idx + 1}. Title: {item['title']}\nURL: {item['url']}\nText: {item['text']}"
for idx, item in enumerate(search_response)
).encode('utf-8')
# Prefix to enforce a JSON response
json_response_prefix = '{"summary":'
# Prepare a prompt
formatted_prompt = f"### Instruction:{instruction}\n\nQuery:\n{query}\n\nSearch Results:\n${search_context}\n\nQuery:\n{query}\n### Response:\n{json_response_prefix}",
# Generate a completion with Sensei-7B-V1
completion = json_response_prefix + client.completion(formatted_prompt, llm_model_name="SciPhi/Sensei-7B-V1")
print(completion)
# {
# "summary": "\nFermat's Last Theorem is a mathematical proposition first prop ... ",
# "other_queries": ["The role of elliptic curves in the proof of Fermat's Last Theorem", ...]
# }
FAQs
AgentSearch: An open source framework and dataset for webscale local search.
We found that agent-search demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.