| Name | agent-search JSON |
| Version |
0.1.0
JSON |
| download |
| home_page | |
| Summary | AgentSearch: An open source framework and dataset for webscale local search. |
| upload_time | 2024-01-14 16:52:52 |
| maintainer | |
| docs_url | None |
| author | Owen Colegrove |
| requires_python | >=3.9,<3.12 |
| license | Apache-2.0 |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# AgentSearch: A framework for powering search agents and enabling customizable local search.

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.
## Features of AgentSearch
- **Search Agent Integration**: Effortlessly build a search agent by connecting any search-specialized LLM, such as [Sensei-7B](https://huggingface.co/SciPhi/Sensei-7B-V1), with a supported search engine.
- **Customizable Search**: Utilize the [AgentSearch dataset](https://huggingface.co/datasets/SciPhi/AgentSearch-V1) in conjunction with this framework to deploy a customizable local search engine.
- **API Endpoint Integration**: Seamlessly integrate with a variety of hosted provider APIs for diverse search solutions, offering ease of use and flexibility, including Bing, SERP API, and AgentSearch. Additionally, support is provided for LLMs from SciPhi, HuggingFace, OpenAI, Anthropic, and more.
## Quickstart Guide
### Installation
```bash
pip install agent-search
```
### Configuration
Get your free API key from [SciPhi](https://www.sciphi.ai/signup) and set it in your environment:
```bash
export SCIPHI_API_KEY=$MY_SCIPHI_API_KEY
```
### Usage
Call a pre-configured search agent endpoint:
```python
# 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:
```python
# 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:
```python
# 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", ...]
# }
```
## Community & Support
- **Engage with Us:** Join our [Discord community](https://discord.gg/mN4kWbsgRu) for discussions and updates.
- **Feedback & Inquiries:** Contact us via email for personalized support.
### Additional Notes
- Execute commands from the root directory of the AgentSearch project.
- User Guide coming soon!
Raw data
{
"_id": null,
"home_page": "",
"name": "agent-search",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<3.12",
"maintainer_email": "",
"keywords": "",
"author": "Owen Colegrove",
"author_email": "owen@sciphi.ai",
"download_url": "https://files.pythonhosted.org/packages/f6/94/1996dfd0ffd2a916b3cce3b8273cdd45b92e2c673cdc3d9b13b957e15f14/agent_search-0.1.0.tar.gz",
"platform": null,
"description": "# AgentSearch: A framework for powering search agents and enabling customizable local search.\n\n\n\nAgentSearch 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.\n\n## Features of AgentSearch\n\n- **Search Agent Integration**: Effortlessly build a search agent by connecting any search-specialized LLM, such as [Sensei-7B](https://huggingface.co/SciPhi/Sensei-7B-V1), with a supported search engine.\n- **Customizable Search**: Utilize the [AgentSearch dataset](https://huggingface.co/datasets/SciPhi/AgentSearch-V1) in conjunction with this framework to deploy a customizable local search engine.\n- **API Endpoint Integration**: Seamlessly integrate with a variety of hosted provider APIs for diverse search solutions, offering ease of use and flexibility, including Bing, SERP API, and AgentSearch. Additionally, support is provided for LLMs from SciPhi, HuggingFace, OpenAI, Anthropic, and more.\n\n## Quickstart Guide\n\n### Installation\n\n```bash\npip install agent-search\n```\n\n### Configuration\n\nGet your free API key from [SciPhi](https://www.sciphi.ai/signup) and set it in your environment:\n\n```bash\nexport SCIPHI_API_KEY=$MY_SCIPHI_API_KEY\n```\n\n### Usage\n\nCall a pre-configured search agent endpoint:\n\n```python\n# Requires SCIPHI_API_KEY in the environment\nfrom agent_search import SciPhi\n\nclient = SciPhi()\n\n# Search, then summarize result and generate related queries\nagent_summary = client.get_search_rag_response(query='latest news', search_provider='bing', llm_model='SciPhi/Sensei-7B-V1')\nprint(agent_summary)\n# { 'response': '...', 'other_queries': '...', 'search_results': '...' }\n```\n\nStandalone searches and from the AgentSearch search engine are supported:\n\n```python\n# Requires SCIPHI_API_KEY in the environment\nfrom agent_search import SciPhi\n\nclient = SciPhi()\n\n# Perform a search\nsearch_response = client.search(query='Quantum Field Theory', search_provider='agent-search')\n\nprint(search_response)\n# [{ 'score': '.89', 'url': 'https://...', 'metadata': {...} }]\n```\n\nCode your own custom search agent workflow:\n\n```python\n# Requires SCIPHI_API_KEY in the environment\nfrom agent_search import SciPhi\n\nclient = SciPhi()\n\n# Specify instructions for the task\ninstruction = \"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.\"\nquery = \"What is Fermat's Last Theorem?\"\n\n# construct search context\nsearch_response = client.search(query=query, search_provider='agent-search')\nsearch_context = \"\\n\\n\".join(\n f\"{idx + 1}. Title: {item['title']}\\nURL: {item['url']}\\nText: {item['text']}\"\n for idx, item in enumerate(search_response)\n).encode('utf-8')\n\n# Prefix to enforce a JSON response \njson_response_prefix = '{\"summary\":'\n\n# Prepare a prompt\nformatted_prompt = f\"### Instruction:{instruction}\\n\\nQuery:\\n{query}\\n\\nSearch Results:\\n${search_context}\\n\\nQuery:\\n{query}\\n### Response:\\n{json_response_prefix}\",\n\n# Generate a completion with Sensei-7B-V1\ncompletion = json_response_prefix + client.completion(formatted_prompt, llm_model_name=\"SciPhi/Sensei-7B-V1\")\n\nprint(completion)\n# {\n# \"summary\": \"\\nFermat's Last Theorem is a mathematical proposition first prop ... \",\n# \"other_queries\": [\"The role of elliptic curves in the proof of Fermat's Last Theorem\", ...]\n# }\n```\n\n## Community & Support\n\n- **Engage with Us:** Join our [Discord community](https://discord.gg/mN4kWbsgRu) for discussions and updates.\n- **Feedback & Inquiries:** Contact us via email for personalized support.\n\n### Additional Notes\n\n- Execute commands from the root directory of the AgentSearch project.\n- User Guide coming soon!\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "AgentSearch: An open source framework and dataset for webscale local search.",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "74b25470d8c34e99560f832b17ea98acb972c784d30f820ef441c0a275a53c5d",
"md5": "5ba225917977823640be7a4890b54840",
"sha256": "833ed6a56aedb506ef7408efafdcb42cae1614af87c3906c65ed0bf29fb46b1b"
},
"downloads": -1,
"filename": "agent_search-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5ba225917977823640be7a4890b54840",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<3.12",
"size": 21056,
"upload_time": "2024-01-14T16:52:50",
"upload_time_iso_8601": "2024-01-14T16:52:50.871050Z",
"url": "https://files.pythonhosted.org/packages/74/b2/5470d8c34e99560f832b17ea98acb972c784d30f820ef441c0a275a53c5d/agent_search-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f6941996dfd0ffd2a916b3cce3b8273cdd45b92e2c673cdc3d9b13b957e15f14",
"md5": "98e5273f8a2f673a4e0b73c916a5d6ad",
"sha256": "4f94c15b878088f06fc9e8b93356c6c25a63b977821ad9eb2490332d038499cc"
},
"downloads": -1,
"filename": "agent_search-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "98e5273f8a2f673a4e0b73c916a5d6ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<3.12",
"size": 18237,
"upload_time": "2024-01-14T16:52:52",
"upload_time_iso_8601": "2024-01-14T16:52:52.457584Z",
"url": "https://files.pythonhosted.org/packages/f6/94/1996dfd0ffd2a916b3cce3b8273cdd45b92e2c673cdc3d9b13b957e15f14/agent_search-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-14 16:52:52",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "agent-search"
}