Latest commit

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🔍FreeKnowledge AI

GitHub LicensePyPI - FormatGitHub starsPyPI - LicensePyPIPyPI - Downloads书生·铺语大模型

😘FreeKnowledge在PyPI的总下载量已经突破 3k! ✨An agent that provides free and flexible access to search external knowledge!!(感谢上海人工智能实验室书生大模型实训营的支持)必须用Intern!!

1. 📖Introduction

Currently, there are only a few interfaces such as DuckDuckGO that can be used to obtain external knowledge for free. These interfaces are difficult to obtain complete external knowledge and are very cumbersome and cannot obtain external knowledge related to the original problem. Most of the interfaces with better effects are relatively expensive, such as Bocha, Google and other APIs. Therefore, we open-source a free and flexible external knowledge interface - FreeKnowledge AI

2. 😀Simple & Free

  • You only need to download the knowledge_AI dependency to use it, which is very convenient!!
pip install FreeKnowledge-AI==0.2.0
  • A simple example of acquiring external knowledge: Before using it, we recommend that you read the Flexible section to better understand the flexibility of FreeKnowledge AI .
fromFreeKnowledge_AIimportknowledge_center# 1.Initialize the knowledge agentcenter=knowledge_center.Center()
question="2024年上海工程技术大学研究生复试分数线"flag=False# Flag indicates whether a large model is needed, and the output content will be more beautiful and standard.mode="BAIDU"# Currently only supports "BAIDU" and "DUCKDUCKGO"。# 2.Respond to external knowledgeresults=center.get_response(question, flag, mode)
print(results)
  • Log of External knowledge obtained from the website:
  • Console Output:

3. ⚡Flexible

We allow passing in a variety of parameters to better control the output, including:

  • question: Question entered by the user (Required)。
  • flag: Whether to use a large model to extract the core content of crawled external knowledge (Default True)。
  • mode: "BAIDU", "DUCKDUCKGO" (Default "DUCKDUCKGO"),or "URL_SPECIFIC"。

    You need to use VPN when using "DUCKDUCKGO", but not "BAIDU". We recommend using "DUCKDUCKGO" because the crawled results are more accurate, but Baidu's response speed will be faster.

  • specific_url :This specifies the exact URL(s) to crawl directly. Example: "https://docs.python.org/3/tutorial/
  • model: You can choose the large model you want to use (Default "internlm/internlm2_5-7b-chat").
  • base_url: The base_url of the model (Default "https://api.siliconflow.cn/v1/chat/completions").
  • key: Pass in your own key。
  • max_web_results: Get the amount of crawled external knowledge (Default 5)。
  • save_format: Specify the format to save results. Set to "json" to automatically save results to a file named after your question (e.g., "your_question.json").

Report errors:

When you fail to obtain website content, don't worry, just wait a little longer, because some websites require verification. Another solution is to increase the number of retries and thread sleep time.

4. 📋Complete Example

fromFreeKnowledge_AIimportknowledge_centercenter=knowledge_center.Center()
question="2025年EMNLP会议的主题是什么?"flag=Truemode="DUCKDUCKGO"results=center.get_response(question, flag, mode, model="internlm/internlm2_5-7b-chat", base_url="https://api.siliconflow.cn/v1/chat/completions", key="xxx", max_web_results=2)
print(results) 

5. 📈 Evaluation

5.1 Benchmark:

We release the Academy Search dataset to serve as a unified academic-domain benchmark for search engine evaluation. All 200 queries are non-open-ended and difficult, collected exclusively from paper pages of top-tier conferences and journals, and uniformly stored in the dataset/ directory. Each query comes with a verifiable ground-truth answer on the source website and has been independently cross-checked by two master’s students in computer science. The dataset is further divided into two categories: fact-based judgment questions and fact-based short-answer question, and we will continue to expand the dataset to additional disciplines and open-source the updates. We evaluate the search engines by feeding their outputs to InternLM3-8B, which then uniformly compares each response against the verifiable ground-truth answer to produce a consistent.

5.2 characteristics:
  • non-open-ended;
  • difficult;
  • verifiable;
  • multi-categories;

Academic Domain Examples:

Example 1:
{
"query": "EMNLP 2024的投稿主题是否包括计算社会科学与文化分析?",
"domain": "学术",
"ground_truth": true,
"answer_type": "boolean"
}
Example 2:
{
"query": "ACL 2025主题轨道的核心内容是什么?",
"domain": "学术",
"ground_truth": "聚焦自然语言处理模型的泛化能力,包括如何增强模型在组合性、结构性、跨任务、跨语言、跨领域及鲁棒性等多维度的泛化能力,探究影响泛化的因素,评估泛化能力的有效方法,以及大语言模型在泛化方面的关键局限性等",
"answer_type": "entity"
}

Medical Domain Examples:

{
"query": "派安普利单抗注射液是否获得FDA批准用于治疗复发或转移性鼻咽癌?",
"domain": "医疗",
"ground_truth": true,
"answer_type": "boolean"
}
{
"query": "根据共识,儿童脓毒性休克液体复苏的首剂液体选择是什么?推荐剂量是多少?",
"domain": "医疗",
"ground_truth": "首剂液体选择等渗晶体液,剂量为20ml/kg,于5-10分钟内静脉推注",
"answer_type": "entity"
}

Note: Data in medical.json and academic.json !!

5.3 Result:

Medical Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)--Not evaluated
FreeKnowledge-AI (Free)138/20069.00%✅ Evaluated
BoCha API (Business)86/20043.00%✅ Evaluated
Exa API (Business)--Not evaluated

Academy Search Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)3/2001.5%✅ Evaluated
FreeKnowledge-AI (Free)82/20041.00%✅ Evaluated
BoCha API (Business)14/2007.00%✅ Evaluated
Exa API (Business)--Not evaluated

**Note: ** FreeKnowledge AI takes 15–20 times longer than both DuckDuckGo and BoCha Search, and BoCha Search costs about 15 RMB for 200 queries—much more expensive than Exa—and delivers significantly worse results.

6. 🛠️ MCP Integration (New!)

FreeKnowledge AI now supports MCP (Model Control Protocol) integration, allowing you to use its search capabilities directly from MCP-compatible clients like Claude, ChatGPT, and other agents.

Setup MCP Server

  1. Make sure you have the MCP client library installed:
pip install mcp
  1. Create a FreeKnowledgeMcp.json configuration file:
{
"mcpServers": {
"knowledge_search_server": {
"command": "python",
"args": ["path/to/your/FreeKnowledge_AI/MCP.py"],
"transport": "stdio"
}
}
}

Available MCP Tools

  • baidu_search_with_summary: Search using Baidu and summarize results with AI
  • duckduckgo_search_with_summary: Search using DuckDuckGo and summarize results with AI
  • url_specific_with_summary: Fetch and summarize content from a specific URL

7. 👇Citation

If you think this project is useful to you, please click star and cite this project。

@misc{Wu2024FreeKnowledge_AI,
title={FreeKnowledge_AI: An agent that provides free and flexible access to external knowledge, author={Yuhang Wu and Wenzheng Wang and Henghua Zhang}, year={2025}, url=[{<url id="cuqmhcd43355nsg2o9dg" type="url" status="parsed" title="GitHub -VovyH/FreeKnowledge_AI" wc="6723">https://github.com/VovyH/FreeKnowledge_AI</url>}](https://github.com/VovyH/FreeKnowledge_AI/),}

8. License

Apache 2.0 — see the LICENSE file for details.

About

[2025AIAgent / 2025InternLab]An agent that provides free and flexible access to Search external knowledge.

Resources

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Latest commit

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🔍FreeKnowledge AI

GitHub LicensePyPI - FormatGitHub starsPyPI - LicensePyPIPyPI - Downloads书生·铺语大模型

😘FreeKnowledge在PyPI的总下载量已经突破 3k! ✨An agent that provides free and flexible access to search external knowledge!!(感谢上海人工智能实验室书生大模型实训营的支持)必须用Intern!!

1. 📖Introduction

Currently, there are only a few interfaces such as DuckDuckGO that can be used to obtain external knowledge for free. These interfaces are difficult to obtain complete external knowledge and are very cumbersome and cannot obtain external knowledge related to the original problem. Most of the interfaces with better effects are relatively expensive, such as Bocha, Google and other APIs. Therefore, we open-source a free and flexible external knowledge interface - FreeKnowledge AI

2. 😀Simple & Free

  • You only need to download the knowledge_AI dependency to use it, which is very convenient!!
pip install FreeKnowledge-AI==0.2.0
  • A simple example of acquiring external knowledge: Before using it, we recommend that you read the Flexible section to better understand the flexibility of FreeKnowledge AI .
fromFreeKnowledge_AIimportknowledge_center# 1.Initialize the knowledge agentcenter=knowledge_center.Center()
question="2024年上海工程技术大学研究生复试分数线"flag=False# Flag indicates whether a large model is needed, and the output content will be more beautiful and standard.mode="BAIDU"# Currently only supports "BAIDU" and "DUCKDUCKGO"。# 2.Respond to external knowledgeresults=center.get_response(question, flag, mode)
print(results)
  • Log of External knowledge obtained from the website:
  • Console Output:

3. ⚡Flexible

We allow passing in a variety of parameters to better control the output, including:

  • question: Question entered by the user (Required)。
  • flag: Whether to use a large model to extract the core content of crawled external knowledge (Default True)。
  • mode: "BAIDU", "DUCKDUCKGO" (Default "DUCKDUCKGO"),or "URL_SPECIFIC"。

    You need to use VPN when using "DUCKDUCKGO", but not "BAIDU". We recommend using "DUCKDUCKGO" because the crawled results are more accurate, but Baidu's response speed will be faster.

  • specific_url :This specifies the exact URL(s) to crawl directly. Example: "https://docs.python.org/3/tutorial/
  • model: You can choose the large model you want to use (Default "internlm/internlm2_5-7b-chat").
  • base_url: The base_url of the model (Default "https://api.siliconflow.cn/v1/chat/completions").
  • key: Pass in your own key。
  • max_web_results: Get the amount of crawled external knowledge (Default 5)。
  • save_format: Specify the format to save results. Set to "json" to automatically save results to a file named after your question (e.g., "your_question.json").

Report errors:

When you fail to obtain website content, don't worry, just wait a little longer, because some websites require verification. Another solution is to increase the number of retries and thread sleep time.

4. 📋Complete Example

fromFreeKnowledge_AIimportknowledge_centercenter=knowledge_center.Center()
question="2025年EMNLP会议的主题是什么?"flag=Truemode="DUCKDUCKGO"results=center.get_response(question, flag, mode, model="internlm/internlm2_5-7b-chat", base_url="https://api.siliconflow.cn/v1/chat/completions", key="xxx", max_web_results=2)
print(results) 

5. 📈 Evaluation

5.1 Benchmark:

We release the Academy Search dataset to serve as a unified academic-domain benchmark for search engine evaluation. All 200 queries are non-open-ended and difficult, collected exclusively from paper pages of top-tier conferences and journals, and uniformly stored in the dataset/ directory. Each query comes with a verifiable ground-truth answer on the source website and has been independently cross-checked by two master’s students in computer science. The dataset is further divided into two categories: fact-based judgment questions and fact-based short-answer question, and we will continue to expand the dataset to additional disciplines and open-source the updates. We evaluate the search engines by feeding their outputs to InternLM3-8B, which then uniformly compares each response against the verifiable ground-truth answer to produce a consistent.

5.2 characteristics:
  • non-open-ended;
  • difficult;
  • verifiable;
  • multi-categories;

Academic Domain Examples:

Example 1:
{
"query": "EMNLP 2024的投稿主题是否包括计算社会科学与文化分析?",
"domain": "学术",
"ground_truth": true,
"answer_type": "boolean"
}
Example 2:
{
"query": "ACL 2025主题轨道的核心内容是什么?",
"domain": "学术",
"ground_truth": "聚焦自然语言处理模型的泛化能力,包括如何增强模型在组合性、结构性、跨任务、跨语言、跨领域及鲁棒性等多维度的泛化能力,探究影响泛化的因素,评估泛化能力的有效方法,以及大语言模型在泛化方面的关键局限性等",
"answer_type": "entity"
}

Medical Domain Examples:

{
"query": "派安普利单抗注射液是否获得FDA批准用于治疗复发或转移性鼻咽癌?",
"domain": "医疗",
"ground_truth": true,
"answer_type": "boolean"
}
{
"query": "根据共识,儿童脓毒性休克液体复苏的首剂液体选择是什么?推荐剂量是多少?",
"domain": "医疗",
"ground_truth": "首剂液体选择等渗晶体液,剂量为20ml/kg,于5-10分钟内静脉推注",
"answer_type": "entity"
}

Note: Data in medical.json and academic.json !!

5.3 Result:

Medical Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)--Not evaluated
FreeKnowledge-AI (Free)138/20069.00%✅ Evaluated
BoCha API (Business)86/20043.00%✅ Evaluated
Exa API (Business)--Not evaluated

Academy Search Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)3/2001.5%✅ Evaluated
FreeKnowledge-AI (Free)82/20041.00%✅ Evaluated
BoCha API (Business)14/2007.00%✅ Evaluated
Exa API (Business)--Not evaluated

**Note: ** FreeKnowledge AI takes 15–20 times longer than both DuckDuckGo and BoCha Search, and BoCha Search costs about 15 RMB for 200 queries—much more expensive than Exa—and delivers significantly worse results.

6. 🛠️ MCP Integration (New!)

FreeKnowledge AI now supports MCP (Model Control Protocol) integration, allowing you to use its search capabilities directly from MCP-compatible clients like Claude, ChatGPT, and other agents.

Setup MCP Server

  1. Make sure you have the MCP client library installed:
pip install mcp
  1. Create a FreeKnowledgeMcp.json configuration file:
{
"mcpServers": {
"knowledge_search_server": {
"command": "python",
"args": ["path/to/your/FreeKnowledge_AI/MCP.py"],
"transport": "stdio"
}
}
}

Available MCP Tools

  • baidu_search_with_summary: Search using Baidu and summarize results with AI
  • duckduckgo_search_with_summary: Search using DuckDuckGo and summarize results with AI
  • url_specific_with_summary: Fetch and summarize content from a specific URL

7. 👇Citation

If you think this project is useful to you, please click star and cite this project。

@misc{Wu2024FreeKnowledge_AI,
title={FreeKnowledge_AI: An agent that provides free and flexible access to external knowledge, author={Yuhang Wu and Wenzheng Wang and Henghua Zhang}, year={2025}, url=[{<url id="cuqmhcd43355nsg2o9dg" type="url" status="parsed" title="GitHub -VovyH/FreeKnowledge_AI" wc="6723">https://github.com/VovyH/FreeKnowledge_AI</url>}](https://github.com/VovyH/FreeKnowledge_AI/),}

8. License

Apache 2.0 — see the LICENSE file for details.

About

[2025AIAgent / 2025InternLab]An agent that provides free and flexible access to Search external knowledge.

Resources

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🔍FreeKnowledge AI

GitHub LicensePyPI - FormatGitHub starsPyPI - LicensePyPIPyPI - Downloads书生·铺语大模型

😘FreeKnowledge在PyPI的总下载量已经突破 3k! ✨An agent that provides free and flexible access to search external knowledge!!(感谢上海人工智能实验室书生大模型实训营的支持)必须用Intern!!

1. 📖Introduction

Currently, there are only a few interfaces such as DuckDuckGO that can be used to obtain external knowledge for free. These interfaces are difficult to obtain complete external knowledge and are very cumbersome and cannot obtain external knowledge related to the original problem. Most of the interfaces with better effects are relatively expensive, such as Bocha, Google and other APIs. Therefore, we open-source a free and flexible external knowledge interface - FreeKnowledge AI

2. 😀Simple & Free

  • You only need to download the knowledge_AI dependency to use it, which is very convenient!!
pip install FreeKnowledge-AI==0.2.0
  • A simple example of acquiring external knowledge: Before using it, we recommend that you read the Flexible section to better understand the flexibility of FreeKnowledge AI .
fromFreeKnowledge_AIimportknowledge_center# 1.Initialize the knowledge agentcenter=knowledge_center.Center()
question="2024年上海工程技术大学研究生复试分数线"flag=False# Flag indicates whether a large model is needed, and the output content will be more beautiful and standard.mode="BAIDU"# Currently only supports "BAIDU" and "DUCKDUCKGO"。# 2.Respond to external knowledgeresults=center.get_response(question, flag, mode)
print(results)
  • Log of External knowledge obtained from the website:
  • Console Output:

3. ⚡Flexible

We allow passing in a variety of parameters to better control the output, including:

  • question: Question entered by the user (Required)。
  • flag: Whether to use a large model to extract the core content of crawled external knowledge (Default True)。
  • mode: "BAIDU", "DUCKDUCKGO" (Default "DUCKDUCKGO"),or "URL_SPECIFIC"。

    You need to use VPN when using "DUCKDUCKGO", but not "BAIDU". We recommend using "DUCKDUCKGO" because the crawled results are more accurate, but Baidu's response speed will be faster.

  • specific_url :This specifies the exact URL(s) to crawl directly. Example: "https://docs.python.org/3/tutorial/
  • model: You can choose the large model you want to use (Default "internlm/internlm2_5-7b-chat").
  • base_url: The base_url of the model (Default "https://api.siliconflow.cn/v1/chat/completions").
  • key: Pass in your own key。
  • max_web_results: Get the amount of crawled external knowledge (Default 5)。
  • save_format: Specify the format to save results. Set to "json" to automatically save results to a file named after your question (e.g., "your_question.json").

Report errors:

When you fail to obtain website content, don't worry, just wait a little longer, because some websites require verification. Another solution is to increase the number of retries and thread sleep time.

4. 📋Complete Example

fromFreeKnowledge_AIimportknowledge_centercenter=knowledge_center.Center()
question="2025年EMNLP会议的主题是什么?"flag=Truemode="DUCKDUCKGO"results=center.get_response(question, flag, mode, model="internlm/internlm2_5-7b-chat", base_url="https://api.siliconflow.cn/v1/chat/completions", key="xxx", max_web_results=2)
print(results) 

5. 📈 Evaluation

5.1 Benchmark:

We release the Academy Search dataset to serve as a unified academic-domain benchmark for search engine evaluation. All 200 queries are non-open-ended and difficult, collected exclusively from paper pages of top-tier conferences and journals, and uniformly stored in the dataset/ directory. Each query comes with a verifiable ground-truth answer on the source website and has been independently cross-checked by two master’s students in computer science. The dataset is further divided into two categories: fact-based judgment questions and fact-based short-answer question, and we will continue to expand the dataset to additional disciplines and open-source the updates. We evaluate the search engines by feeding their outputs to InternLM3-8B, which then uniformly compares each response against the verifiable ground-truth answer to produce a consistent.

5.2 characteristics:
  • non-open-ended;
  • difficult;
  • verifiable;
  • multi-categories;

Academic Domain Examples:

Example 1:
{
"query": "EMNLP 2024的投稿主题是否包括计算社会科学与文化分析?",
"domain": "学术",
"ground_truth": true,
"answer_type": "boolean"
}
Example 2:
{
"query": "ACL 2025主题轨道的核心内容是什么?",
"domain": "学术",
"ground_truth": "聚焦自然语言处理模型的泛化能力,包括如何增强模型在组合性、结构性、跨任务、跨语言、跨领域及鲁棒性等多维度的泛化能力,探究影响泛化的因素,评估泛化能力的有效方法,以及大语言模型在泛化方面的关键局限性等",
"answer_type": "entity"
}

Medical Domain Examples:

{
"query": "派安普利单抗注射液是否获得FDA批准用于治疗复发或转移性鼻咽癌?",
"domain": "医疗",
"ground_truth": true,
"answer_type": "boolean"
}
{
"query": "根据共识,儿童脓毒性休克液体复苏的首剂液体选择是什么?推荐剂量是多少?",
"domain": "医疗",
"ground_truth": "首剂液体选择等渗晶体液,剂量为20ml/kg,于5-10分钟内静脉推注",
"answer_type": "entity"
}

Note: Data in medical.json and academic.json !!

5.3 Result:

Medical Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)--Not evaluated
FreeKnowledge-AI (Free)138/20069.00%✅ Evaluated
BoCha API (Business)86/20043.00%✅ Evaluated
Exa API (Business)--Not evaluated

Academy Search Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)3/2001.5%✅ Evaluated
FreeKnowledge-AI (Free)82/20041.00%✅ Evaluated
BoCha API (Business)14/2007.00%✅ Evaluated
Exa API (Business)--Not evaluated

**Note: ** FreeKnowledge AI takes 15–20 times longer than both DuckDuckGo and BoCha Search, and BoCha Search costs about 15 RMB for 200 queries—much more expensive than Exa—and delivers significantly worse results.

6. 🛠️ MCP Integration (New!)

FreeKnowledge AI now supports MCP (Model Control Protocol) integration, allowing you to use its search capabilities directly from MCP-compatible clients like Claude, ChatGPT, and other agents.

Setup MCP Server

  1. Make sure you have the MCP client library installed:
pip install mcp
  1. Create a FreeKnowledgeMcp.json configuration file:
{
"mcpServers": {
"knowledge_search_server": {
"command": "python",
"args": ["path/to/your/FreeKnowledge_AI/MCP.py"],
"transport": "stdio"
}
}
}

Available MCP Tools

  • baidu_search_with_summary: Search using Baidu and summarize results with AI
  • duckduckgo_search_with_summary: Search using DuckDuckGo and summarize results with AI
  • url_specific_with_summary: Fetch and summarize content from a specific URL

7. 👇Citation

If you think this project is useful to you, please click star and cite this project。

@misc{Wu2024FreeKnowledge_AI,
title={FreeKnowledge_AI: An agent that provides free and flexible access to external knowledge, author={Yuhang Wu and Wenzheng Wang and Henghua Zhang}, year={2025}, url=[{<url id="cuqmhcd43355nsg2o9dg" type="url" status="parsed" title="GitHub -VovyH/FreeKnowledge_AI" wc="6723">https://github.com/VovyH/FreeKnowledge_AI</url>}](https://github.com/VovyH/FreeKnowledge_AI/),}

8. License

Apache 2.0 — see the LICENSE file for details.

About

[2025AIAgent / 2025InternLab]An agent that provides free and flexible access to Search external knowledge.

Resources

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🔍FreeKnowledge AI

GitHub LicensePyPI - FormatGitHub starsPyPI - LicensePyPIPyPI - Downloads书生·铺语大模型

😘FreeKnowledge在PyPI的总下载量已经突破 3k! ✨An agent that provides free and flexible access to search external knowledge!!(感谢上海人工智能实验室书生大模型实训营的支持)必须用Intern!!

1. 📖Introduction

Currently, there are only a few interfaces such as DuckDuckGO that can be used to obtain external knowledge for free. These interfaces are difficult to obtain complete external knowledge and are very cumbersome and cannot obtain external knowledge related to the original problem. Most of the interfaces with better effects are relatively expensive, such as Bocha, Google and other APIs. Therefore, we open-source a free and flexible external knowledge interface - FreeKnowledge AI

2. 😀Simple & Free

  • You only need to download the knowledge_AI dependency to use it, which is very convenient!!
pip install FreeKnowledge-AI==0.2.0
  • A simple example of acquiring external knowledge: Before using it, we recommend that you read the Flexible section to better understand the flexibility of FreeKnowledge AI .
fromFreeKnowledge_AIimportknowledge_center# 1.Initialize the knowledge agentcenter=knowledge_center.Center()
question="2024年上海工程技术大学研究生复试分数线"flag=False# Flag indicates whether a large model is needed, and the output content will be more beautiful and standard.mode="BAIDU"# Currently only supports "BAIDU" and "DUCKDUCKGO"。# 2.Respond to external knowledgeresults=center.get_response(question, flag, mode)
print(results)
  • Log of External knowledge obtained from the website:
  • Console Output:

3. ⚡Flexible

We allow passing in a variety of parameters to better control the output, including:

  • question: Question entered by the user (Required)。
  • flag: Whether to use a large model to extract the core content of crawled external knowledge (Default True)。
  • mode: "BAIDU", "DUCKDUCKGO" (Default "DUCKDUCKGO"),or "URL_SPECIFIC"。

    You need to use VPN when using "DUCKDUCKGO", but not "BAIDU". We recommend using "DUCKDUCKGO" because the crawled results are more accurate, but Baidu's response speed will be faster.

  • specific_url :This specifies the exact URL(s) to crawl directly. Example: "https://docs.python.org/3/tutorial/
  • model: You can choose the large model you want to use (Default "internlm/internlm2_5-7b-chat").
  • base_url: The base_url of the model (Default "https://api.siliconflow.cn/v1/chat/completions").
  • key: Pass in your own key。
  • max_web_results: Get the amount of crawled external knowledge (Default 5)。
  • save_format: Specify the format to save results. Set to "json" to automatically save results to a file named after your question (e.g., "your_question.json").

Report errors:

When you fail to obtain website content, don't worry, just wait a little longer, because some websites require verification. Another solution is to increase the number of retries and thread sleep time.

4. 📋Complete Example

fromFreeKnowledge_AIimportknowledge_centercenter=knowledge_center.Center()
question="2025年EMNLP会议的主题是什么?"flag=Truemode="DUCKDUCKGO"results=center.get_response(question, flag, mode, model="internlm/internlm2_5-7b-chat", base_url="https://api.siliconflow.cn/v1/chat/completions", key="xxx", max_web_results=2)
print(results) 

5. 📈 Evaluation

5.1 Benchmark:

We release the Academy Search dataset to serve as a unified academic-domain benchmark for search engine evaluation. All 200 queries are non-open-ended and difficult, collected exclusively from paper pages of top-tier conferences and journals, and uniformly stored in the dataset/ directory. Each query comes with a verifiable ground-truth answer on the source website and has been independently cross-checked by two master’s students in computer science. The dataset is further divided into two categories: fact-based judgment questions and fact-based short-answer question, and we will continue to expand the dataset to additional disciplines and open-source the updates. We evaluate the search engines by feeding their outputs to InternLM3-8B, which then uniformly compares each response against the verifiable ground-truth answer to produce a consistent.

5.2 characteristics:
  • non-open-ended;
  • difficult;
  • verifiable;
  • multi-categories;

Academic Domain Examples:

Example 1:
{
"query": "EMNLP 2024的投稿主题是否包括计算社会科学与文化分析?",
"domain": "学术",
"ground_truth": true,
"answer_type": "boolean"
}
Example 2:
{
"query": "ACL 2025主题轨道的核心内容是什么?",
"domain": "学术",
"ground_truth": "聚焦自然语言处理模型的泛化能力,包括如何增强模型在组合性、结构性、跨任务、跨语言、跨领域及鲁棒性等多维度的泛化能力,探究影响泛化的因素,评估泛化能力的有效方法,以及大语言模型在泛化方面的关键局限性等",
"answer_type": "entity"
}

Medical Domain Examples:

{
"query": "派安普利单抗注射液是否获得FDA批准用于治疗复发或转移性鼻咽癌?",
"domain": "医疗",
"ground_truth": true,
"answer_type": "boolean"
}
{
"query": "根据共识,儿童脓毒性休克液体复苏的首剂液体选择是什么?推荐剂量是多少?",
"domain": "医疗",
"ground_truth": "首剂液体选择等渗晶体液,剂量为20ml/kg,于5-10分钟内静脉推注",
"answer_type": "entity"
}

Note: Data in medical.json and academic.json !!

5.3 Result:

Medical Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)--Not evaluated
FreeKnowledge-AI (Free)138/20069.00%✅ Evaluated
BoCha API (Business)86/20043.00%✅ Evaluated
Exa API (Business)--Not evaluated

Academy Search Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)3/2001.5%✅ Evaluated
FreeKnowledge-AI (Free)82/20041.00%✅ Evaluated
BoCha API (Business)14/2007.00%✅ Evaluated
Exa API (Business)--Not evaluated

**Note: ** FreeKnowledge AI takes 15–20 times longer than both DuckDuckGo and BoCha Search, and BoCha Search costs about 15 RMB for 200 queries—much more expensive than Exa—and delivers significantly worse results.

6. 🛠️ MCP Integration (New!)

FreeKnowledge AI now supports MCP (Model Control Protocol) integration, allowing you to use its search capabilities directly from MCP-compatible clients like Claude, ChatGPT, and other agents.

Setup MCP Server

  1. Make sure you have the MCP client library installed:
pip install mcp
  1. Create a FreeKnowledgeMcp.json configuration file:
{
"mcpServers": {
"knowledge_search_server": {
"command": "python",
"args": ["path/to/your/FreeKnowledge_AI/MCP.py"],
"transport": "stdio"
}
}
}

Available MCP Tools

  • baidu_search_with_summary: Search using Baidu and summarize results with AI
  • duckduckgo_search_with_summary: Search using DuckDuckGo and summarize results with AI
  • url_specific_with_summary: Fetch and summarize content from a specific URL

7. 👇Citation

If you think this project is useful to you, please click star and cite this project。

@misc{Wu2024FreeKnowledge_AI,
title={FreeKnowledge_AI: An agent that provides free and flexible access to external knowledge, author={Yuhang Wu and Wenzheng Wang and Henghua Zhang}, year={2025}, url=[{<url id="cuqmhcd43355nsg2o9dg" type="url" status="parsed" title="GitHub -VovyH/FreeKnowledge_AI" wc="6723">https://github.com/VovyH/FreeKnowledge_AI</url>}](https://github.com/VovyH/FreeKnowledge_AI/),}

8. License

Apache 2.0 — see the LICENSE file for details.

About

[2025AIAgent / 2025InternLab]An agent that provides free and flexible access to Search external knowledge.

Resources

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Latest commit

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🔍FreeKnowledge AI

GitHub LicensePyPI - FormatGitHub starsPyPI - LicensePyPIPyPI - Downloads书生·铺语大模型

😘FreeKnowledge在PyPI的总下载量已经突破 3k! ✨An agent that provides free and flexible access to search external knowledge!!(感谢上海人工智能实验室书生大模型实训营的支持)必须用Intern!!

1. 📖Introduction

Currently, there are only a few interfaces such as DuckDuckGO that can be used to obtain external knowledge for free. These interfaces are difficult to obtain complete external knowledge and are very cumbersome and cannot obtain external knowledge related to the original problem. Most of the interfaces with better effects are relatively expensive, such as Bocha, Google and other APIs. Therefore, we open-source a free and flexible external knowledge interface - FreeKnowledge AI

2. 😀Simple & Free

  • You only need to download the knowledge_AI dependency to use it, which is very convenient!!
pip install FreeKnowledge-AI==0.2.0
  • A simple example of acquiring external knowledge: Before using it, we recommend that you read the Flexible section to better understand the flexibility of FreeKnowledge AI .
fromFreeKnowledge_AIimportknowledge_center# 1.Initialize the knowledge agentcenter=knowledge_center.Center()
question="2024年上海工程技术大学研究生复试分数线"flag=False# Flag indicates whether a large model is needed, and the output content will be more beautiful and standard.mode="BAIDU"# Currently only supports "BAIDU" and "DUCKDUCKGO"。# 2.Respond to external knowledgeresults=center.get_response(question, flag, mode)
print(results)
  • Log of External knowledge obtained from the website:
  • Console Output:

3. ⚡Flexible

We allow passing in a variety of parameters to better control the output, including:

  • question: Question entered by the user (Required)。
  • flag: Whether to use a large model to extract the core content of crawled external knowledge (Default True)。
  • mode: "BAIDU", "DUCKDUCKGO" (Default "DUCKDUCKGO"),or "URL_SPECIFIC"。

    You need to use VPN when using "DUCKDUCKGO", but not "BAIDU". We recommend using "DUCKDUCKGO" because the crawled results are more accurate, but Baidu's response speed will be faster.

  • specific_url :This specifies the exact URL(s) to crawl directly. Example: "https://docs.python.org/3/tutorial/
  • model: You can choose the large model you want to use (Default "internlm/internlm2_5-7b-chat").
  • base_url: The base_url of the model (Default "https://api.siliconflow.cn/v1/chat/completions").
  • key: Pass in your own key。
  • max_web_results: Get the amount of crawled external knowledge (Default 5)。
  • save_format: Specify the format to save results. Set to "json" to automatically save results to a file named after your question (e.g., "your_question.json").

Report errors:

When you fail to obtain website content, don't worry, just wait a little longer, because some websites require verification. Another solution is to increase the number of retries and thread sleep time.

4. 📋Complete Example

fromFreeKnowledge_AIimportknowledge_centercenter=knowledge_center.Center()
question="2025年EMNLP会议的主题是什么?"flag=Truemode="DUCKDUCKGO"results=center.get_response(question, flag, mode, model="internlm/internlm2_5-7b-chat", base_url="https://api.siliconflow.cn/v1/chat/completions", key="xxx", max_web_results=2)
print(results) 

5. 📈 Evaluation

5.1 Benchmark:

We release the Academy Search dataset to serve as a unified academic-domain benchmark for search engine evaluation. All 200 queries are non-open-ended and difficult, collected exclusively from paper pages of top-tier conferences and journals, and uniformly stored in the dataset/ directory. Each query comes with a verifiable ground-truth answer on the source website and has been independently cross-checked by two master’s students in computer science. The dataset is further divided into two categories: fact-based judgment questions and fact-based short-answer question, and we will continue to expand the dataset to additional disciplines and open-source the updates. We evaluate the search engines by feeding their outputs to InternLM3-8B, which then uniformly compares each response against the verifiable ground-truth answer to produce a consistent.

5.2 characteristics:
  • non-open-ended;
  • difficult;
  • verifiable;
  • multi-categories;

Academic Domain Examples:

Example 1:
{
"query": "EMNLP 2024的投稿主题是否包括计算社会科学与文化分析?",
"domain": "学术",
"ground_truth": true,
"answer_type": "boolean"
}
Example 2:
{
"query": "ACL 2025主题轨道的核心内容是什么?",
"domain": "学术",
"ground_truth": "聚焦自然语言处理模型的泛化能力,包括如何增强模型在组合性、结构性、跨任务、跨语言、跨领域及鲁棒性等多维度的泛化能力,探究影响泛化的因素,评估泛化能力的有效方法,以及大语言模型在泛化方面的关键局限性等",
"answer_type": "entity"
}

Medical Domain Examples:

{
"query": "派安普利单抗注射液是否获得FDA批准用于治疗复发或转移性鼻咽癌?",
"domain": "医疗",
"ground_truth": true,
"answer_type": "boolean"
}
{
"query": "根据共识,儿童脓毒性休克液体复苏的首剂液体选择是什么?推荐剂量是多少?",
"domain": "医疗",
"ground_truth": "首剂液体选择等渗晶体液,剂量为20ml/kg,于5-10分钟内静脉推注",
"answer_type": "entity"
}

Note: Data in medical.json and academic.json !!

5.3 Result:

Medical Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)--Not evaluated
FreeKnowledge-AI (Free)138/20069.00%✅ Evaluated
BoCha API (Business)86/20043.00%✅ Evaluated
Exa API (Business)--Not evaluated

Academy Search Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)3/2001.5%✅ Evaluated
FreeKnowledge-AI (Free)82/20041.00%✅ Evaluated
BoCha API (Business)14/2007.00%✅ Evaluated
Exa API (Business)--Not evaluated

**Note: ** FreeKnowledge AI takes 15–20 times longer than both DuckDuckGo and BoCha Search, and BoCha Search costs about 15 RMB for 200 queries—much more expensive than Exa—and delivers significantly worse results.

6. 🛠️ MCP Integration (New!)

FreeKnowledge AI now supports MCP (Model Control Protocol) integration, allowing you to use its search capabilities directly from MCP-compatible clients like Claude, ChatGPT, and other agents.

Setup MCP Server

  1. Make sure you have the MCP client library installed:
pip install mcp
  1. Create a FreeKnowledgeMcp.json configuration file:
{
"mcpServers": {
"knowledge_search_server": {
"command": "python",
"args": ["path/to/your/FreeKnowledge_AI/MCP.py"],
"transport": "stdio"
}
}
}

Available MCP Tools

  • baidu_search_with_summary: Search using Baidu and summarize results with AI
  • duckduckgo_search_with_summary: Search using DuckDuckGo and summarize results with AI
  • url_specific_with_summary: Fetch and summarize content from a specific URL

7. 👇Citation

If you think this project is useful to you, please click star and cite this project。

@misc{Wu2024FreeKnowledge_AI,
title={FreeKnowledge_AI: An agent that provides free and flexible access to external knowledge, author={Yuhang Wu and Wenzheng Wang and Henghua Zhang}, year={2025}, url=[{<url id="cuqmhcd43355nsg2o9dg" type="url" status="parsed" title="GitHub -VovyH/FreeKnowledge_AI" wc="6723">https://github.com/VovyH/FreeKnowledge_AI</url>}](https://github.com/VovyH/FreeKnowledge_AI/),}

8. License

Apache 2.0 — see the LICENSE file for details.

About

[2025AIAgent / 2025InternLab]An agent that provides free and flexible access to Search external knowledge.

Resources

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🔍FreeKnowledge AI

GitHub LicensePyPI - FormatGitHub starsPyPI - LicensePyPIPyPI - Downloads书生·铺语大模型

😘FreeKnowledge在PyPI的总下载量已经突破 3k! ✨An agent that provides free and flexible access to search external knowledge!!(感谢上海人工智能实验室书生大模型实训营的支持)必须用Intern!!

1. 📖Introduction

Currently, there are only a few interfaces such as DuckDuckGO that can be used to obtain external knowledge for free. These interfaces are difficult to obtain complete external knowledge and are very cumbersome and cannot obtain external knowledge related to the original problem. Most of the interfaces with better effects are relatively expensive, such as Bocha, Google and other APIs. Therefore, we open-source a free and flexible external knowledge interface - FreeKnowledge AI

2. 😀Simple & Free

  • You only need to download the knowledge_AI dependency to use it, which is very convenient!!
pip install FreeKnowledge-AI==0.2.0
  • A simple example of acquiring external knowledge: Before using it, we recommend that you read the Flexible section to better understand the flexibility of FreeKnowledge AI .
fromFreeKnowledge_AIimportknowledge_center# 1.Initialize the knowledge agentcenter=knowledge_center.Center()
question="2024年上海工程技术大学研究生复试分数线"flag=False# Flag indicates whether a large model is needed, and the output content will be more beautiful and standard.mode="BAIDU"# Currently only supports "BAIDU" and "DUCKDUCKGO"。# 2.Respond to external knowledgeresults=center.get_response(question, flag, mode)
print(results)
  • Log of External knowledge obtained from the website:
  • Console Output:

3. ⚡Flexible

We allow passing in a variety of parameters to better control the output, including:

  • question: Question entered by the user (Required)。
  • flag: Whether to use a large model to extract the core content of crawled external knowledge (Default True)。
  • mode: "BAIDU", "DUCKDUCKGO" (Default "DUCKDUCKGO"),or "URL_SPECIFIC"。

    You need to use VPN when using "DUCKDUCKGO", but not "BAIDU". We recommend using "DUCKDUCKGO" because the crawled results are more accurate, but Baidu's response speed will be faster.

  • specific_url :This specifies the exact URL(s) to crawl directly. Example: "https://docs.python.org/3/tutorial/
  • model: You can choose the large model you want to use (Default "internlm/internlm2_5-7b-chat").
  • base_url: The base_url of the model (Default "https://api.siliconflow.cn/v1/chat/completions").
  • key: Pass in your own key。
  • max_web_results: Get the amount of crawled external knowledge (Default 5)。
  • save_format: Specify the format to save results. Set to "json" to automatically save results to a file named after your question (e.g., "your_question.json").

Report errors:

When you fail to obtain website content, don't worry, just wait a little longer, because some websites require verification. Another solution is to increase the number of retries and thread sleep time.

4. 📋Complete Example

fromFreeKnowledge_AIimportknowledge_centercenter=knowledge_center.Center()
question="2025年EMNLP会议的主题是什么?"flag=Truemode="DUCKDUCKGO"results=center.get_response(question, flag, mode, model="internlm/internlm2_5-7b-chat", base_url="https://api.siliconflow.cn/v1/chat/completions", key="xxx", max_web_results=2)
print(results) 

5. 📈 Evaluation

5.1 Benchmark:

We release the Academy Search dataset to serve as a unified academic-domain benchmark for search engine evaluation. All 200 queries are non-open-ended and difficult, collected exclusively from paper pages of top-tier conferences and journals, and uniformly stored in the dataset/ directory. Each query comes with a verifiable ground-truth answer on the source website and has been independently cross-checked by two master’s students in computer science. The dataset is further divided into two categories: fact-based judgment questions and fact-based short-answer question, and we will continue to expand the dataset to additional disciplines and open-source the updates. We evaluate the search engines by feeding their outputs to InternLM3-8B, which then uniformly compares each response against the verifiable ground-truth answer to produce a consistent.

5.2 characteristics:
  • non-open-ended;
  • difficult;
  • verifiable;
  • multi-categories;

Academic Domain Examples:

Example 1:
{
"query": "EMNLP 2024的投稿主题是否包括计算社会科学与文化分析?",
"domain": "学术",
"ground_truth": true,
"answer_type": "boolean"
}
Example 2:
{
"query": "ACL 2025主题轨道的核心内容是什么?",
"domain": "学术",
"ground_truth": "聚焦自然语言处理模型的泛化能力,包括如何增强模型在组合性、结构性、跨任务、跨语言、跨领域及鲁棒性等多维度的泛化能力,探究影响泛化的因素,评估泛化能力的有效方法,以及大语言模型在泛化方面的关键局限性等",
"answer_type": "entity"
}

Medical Domain Examples:

{
"query": "派安普利单抗注射液是否获得FDA批准用于治疗复发或转移性鼻咽癌?",
"domain": "医疗",
"ground_truth": true,
"answer_type": "boolean"
}
{
"query": "根据共识,儿童脓毒性休克液体复苏的首剂液体选择是什么?推荐剂量是多少?",
"domain": "医疗",
"ground_truth": "首剂液体选择等渗晶体液,剂量为20ml/kg,于5-10分钟内静脉推注",
"answer_type": "entity"
}

Note: Data in medical.json and academic.json !!

5.3 Result:

Medical Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)--Not evaluated
FreeKnowledge-AI (Free)138/20069.00%✅ Evaluated
BoCha API (Business)86/20043.00%✅ Evaluated
Exa API (Business)--Not evaluated

Academy Search Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)3/2001.5%✅ Evaluated
FreeKnowledge-AI (Free)82/20041.00%✅ Evaluated
BoCha API (Business)14/2007.00%✅ Evaluated
Exa API (Business)--Not evaluated

**Note: ** FreeKnowledge AI takes 15–20 times longer than both DuckDuckGo and BoCha Search, and BoCha Search costs about 15 RMB for 200 queries—much more expensive than Exa—and delivers significantly worse results.

6. 🛠️ MCP Integration (New!)

FreeKnowledge AI now supports MCP (Model Control Protocol) integration, allowing you to use its search capabilities directly from MCP-compatible clients like Claude, ChatGPT, and other agents.

Setup MCP Server

  1. Make sure you have the MCP client library installed:
pip install mcp
  1. Create a FreeKnowledgeMcp.json configuration file:
{
"mcpServers": {
"knowledge_search_server": {
"command": "python",
"args": ["path/to/your/FreeKnowledge_AI/MCP.py"],
"transport": "stdio"
}
}
}

Available MCP Tools

  • baidu_search_with_summary: Search using Baidu and summarize results with AI
  • duckduckgo_search_with_summary: Search using DuckDuckGo and summarize results with AI
  • url_specific_with_summary: Fetch and summarize content from a specific URL

7. 👇Citation

If you think this project is useful to you, please click star and cite this project。

@misc{Wu2024FreeKnowledge_AI,
title={FreeKnowledge_AI: An agent that provides free and flexible access to external knowledge, author={Yuhang Wu and Wenzheng Wang and Henghua Zhang}, year={2025}, url=[{<url id="cuqmhcd43355nsg2o9dg" type="url" status="parsed" title="GitHub -VovyH/FreeKnowledge_AI" wc="6723">https://github.com/VovyH/FreeKnowledge_AI</url>}](https://github.com/VovyH/FreeKnowledge_AI/),}

8. License

Apache 2.0 — see the LICENSE file for details.

About

[2025AIAgent / 2025InternLab]An agent that provides free and flexible access to Search external knowledge.

Resources

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🔍FreeKnowledge AI

GitHub LicensePyPI - FormatGitHub starsPyPI - LicensePyPIPyPI - Downloads书生·铺语大模型

😘FreeKnowledge在PyPI的总下载量已经突破 3k! ✨An agent that provides free and flexible access to search external knowledge!!(感谢上海人工智能实验室书生大模型实训营的支持)必须用Intern!!

1. 📖Introduction

Currently, there are only a few interfaces such as DuckDuckGO that can be used to obtain external knowledge for free. These interfaces are difficult to obtain complete external knowledge and are very cumbersome and cannot obtain external knowledge related to the original problem. Most of the interfaces with better effects are relatively expensive, such as Bocha, Google and other APIs. Therefore, we open-source a free and flexible external knowledge interface - FreeKnowledge AI

2. 😀Simple & Free

  • You only need to download the knowledge_AI dependency to use it, which is very convenient!!
pip install FreeKnowledge-AI==0.2.0
  • A simple example of acquiring external knowledge: Before using it, we recommend that you read the Flexible section to better understand the flexibility of FreeKnowledge AI .
fromFreeKnowledge_AIimportknowledge_center# 1.Initialize the knowledge agentcenter=knowledge_center.Center()
question="2024年上海工程技术大学研究生复试分数线"flag=False# Flag indicates whether a large model is needed, and the output content will be more beautiful and standard.mode="BAIDU"# Currently only supports "BAIDU" and "DUCKDUCKGO"。# 2.Respond to external knowledgeresults=center.get_response(question, flag, mode)
print(results)
  • Log of External knowledge obtained from the website:
  • Console Output:

3. ⚡Flexible

We allow passing in a variety of parameters to better control the output, including:

  • question: Question entered by the user (Required)。
  • flag: Whether to use a large model to extract the core content of crawled external knowledge (Default True)。
  • mode: "BAIDU", "DUCKDUCKGO" (Default "DUCKDUCKGO"),or "URL_SPECIFIC"。

    You need to use VPN when using "DUCKDUCKGO", but not "BAIDU". We recommend using "DUCKDUCKGO" because the crawled results are more accurate, but Baidu's response speed will be faster.

  • specific_url :This specifies the exact URL(s) to crawl directly. Example: "https://docs.python.org/3/tutorial/
  • model: You can choose the large model you want to use (Default "internlm/internlm2_5-7b-chat").
  • base_url: The base_url of the model (Default "https://api.siliconflow.cn/v1/chat/completions").
  • key: Pass in your own key。
  • max_web_results: Get the amount of crawled external knowledge (Default 5)。
  • save_format: Specify the format to save results. Set to "json" to automatically save results to a file named after your question (e.g., "your_question.json").

Report errors:

When you fail to obtain website content, don't worry, just wait a little longer, because some websites require verification. Another solution is to increase the number of retries and thread sleep time.

4. 📋Complete Example

fromFreeKnowledge_AIimportknowledge_centercenter=knowledge_center.Center()
question="2025年EMNLP会议的主题是什么?"flag=Truemode="DUCKDUCKGO"results=center.get_response(question, flag, mode, model="internlm/internlm2_5-7b-chat", base_url="https://api.siliconflow.cn/v1/chat/completions", key="xxx", max_web_results=2)
print(results) 

5. 📈 Evaluation

5.1 Benchmark:

We release the Academy Search dataset to serve as a unified academic-domain benchmark for search engine evaluation. All 200 queries are non-open-ended and difficult, collected exclusively from paper pages of top-tier conferences and journals, and uniformly stored in the dataset/ directory. Each query comes with a verifiable ground-truth answer on the source website and has been independently cross-checked by two master’s students in computer science. The dataset is further divided into two categories: fact-based judgment questions and fact-based short-answer question, and we will continue to expand the dataset to additional disciplines and open-source the updates. We evaluate the search engines by feeding their outputs to InternLM3-8B, which then uniformly compares each response against the verifiable ground-truth answer to produce a consistent.

5.2 characteristics:
  • non-open-ended;
  • difficult;
  • verifiable;
  • multi-categories;

Academic Domain Examples:

Example 1:
{
"query": "EMNLP 2024的投稿主题是否包括计算社会科学与文化分析?",
"domain": "学术",
"ground_truth": true,
"answer_type": "boolean"
}
Example 2:
{
"query": "ACL 2025主题轨道的核心内容是什么?",
"domain": "学术",
"ground_truth": "聚焦自然语言处理模型的泛化能力,包括如何增强模型在组合性、结构性、跨任务、跨语言、跨领域及鲁棒性等多维度的泛化能力,探究影响泛化的因素,评估泛化能力的有效方法,以及大语言模型在泛化方面的关键局限性等",
"answer_type": "entity"
}

Medical Domain Examples:

{
"query": "派安普利单抗注射液是否获得FDA批准用于治疗复发或转移性鼻咽癌?",
"domain": "医疗",
"ground_truth": true,
"answer_type": "boolean"
}
{
"query": "根据共识,儿童脓毒性休克液体复苏的首剂液体选择是什么?推荐剂量是多少?",
"domain": "医疗",
"ground_truth": "首剂液体选择等渗晶体液,剂量为20ml/kg,于5-10分钟内静脉推注",
"answer_type": "entity"
}

Note: Data in medical.json and academic.json !!

5.3 Result:

Medical Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)--Not evaluated
FreeKnowledge-AI (Free)138/20069.00%✅ Evaluated
BoCha API (Business)86/20043.00%✅ Evaluated
Exa API (Business)--Not evaluated

Academy Search Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)3/2001.5%✅ Evaluated
FreeKnowledge-AI (Free)82/20041.00%✅ Evaluated
BoCha API (Business)14/2007.00%✅ Evaluated
Exa API (Business)--Not evaluated

**Note: ** FreeKnowledge AI takes 15–20 times longer than both DuckDuckGo and BoCha Search, and BoCha Search costs about 15 RMB for 200 queries—much more expensive than Exa—and delivers significantly worse results.

6. 🛠️ MCP Integration (New!)

FreeKnowledge AI now supports MCP (Model Control Protocol) integration, allowing you to use its search capabilities directly from MCP-compatible clients like Claude, ChatGPT, and other agents.

Setup MCP Server

  1. Make sure you have the MCP client library installed:
pip install mcp
  1. Create a FreeKnowledgeMcp.json configuration file:
{
"mcpServers": {
"knowledge_search_server": {
"command": "python",
"args": ["path/to/your/FreeKnowledge_AI/MCP.py"],
"transport": "stdio"
}
}
}

Available MCP Tools

  • baidu_search_with_summary: Search using Baidu and summarize results with AI
  • duckduckgo_search_with_summary: Search using DuckDuckGo and summarize results with AI
  • url_specific_with_summary: Fetch and summarize content from a specific URL

7. 👇Citation

If you think this project is useful to you, please click star and cite this project。

@misc{Wu2024FreeKnowledge_AI,
title={FreeKnowledge_AI: An agent that provides free and flexible access to external knowledge, author={Yuhang Wu and Wenzheng Wang and Henghua Zhang}, year={2025}, url=[{<url id="cuqmhcd43355nsg2o9dg" type="url" status="parsed" title="GitHub -VovyH/FreeKnowledge_AI" wc="6723">https://github.com/VovyH/FreeKnowledge_AI</url>}](https://github.com/VovyH/FreeKnowledge_AI/),}

8. License

Apache 2.0 — see the LICENSE file for details.

About

[2025AIAgent / 2025InternLab]An agent that provides free and flexible access to Search external knowledge.

Resources

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Latest commit

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🔍FreeKnowledge AI

GitHub LicensePyPI - FormatGitHub starsPyPI - LicensePyPIPyPI - Downloads书生·铺语大模型

😘FreeKnowledge在PyPI的总下载量已经突破 3k! ✨An agent that provides free and flexible access to search external knowledge!!(感谢上海人工智能实验室书生大模型实训营的支持)必须用Intern!!

1. 📖Introduction

Currently, there are only a few interfaces such as DuckDuckGO that can be used to obtain external knowledge for free. These interfaces are difficult to obtain complete external knowledge and are very cumbersome and cannot obtain external knowledge related to the original problem. Most of the interfaces with better effects are relatively expensive, such as Bocha, Google and other APIs. Therefore, we open-source a free and flexible external knowledge interface - FreeKnowledge AI

2. 😀Simple & Free

  • You only need to download the knowledge_AI dependency to use it, which is very convenient!!
pip install FreeKnowledge-AI==0.2.0
  • A simple example of acquiring external knowledge: Before using it, we recommend that you read the Flexible section to better understand the flexibility of FreeKnowledge AI .
fromFreeKnowledge_AIimportknowledge_center# 1.Initialize the knowledge agentcenter=knowledge_center.Center()
question="2024年上海工程技术大学研究生复试分数线"flag=False# Flag indicates whether a large model is needed, and the output content will be more beautiful and standard.mode="BAIDU"# Currently only supports "BAIDU" and "DUCKDUCKGO"。# 2.Respond to external knowledgeresults=center.get_response(question, flag, mode)
print(results)
  • Log of External knowledge obtained from the website:
  • Console Output:

3. ⚡Flexible

We allow passing in a variety of parameters to better control the output, including:

  • question: Question entered by the user (Required)。
  • flag: Whether to use a large model to extract the core content of crawled external knowledge (Default True)。
  • mode: "BAIDU", "DUCKDUCKGO" (Default "DUCKDUCKGO"),or "URL_SPECIFIC"。

    You need to use VPN when using "DUCKDUCKGO", but not "BAIDU". We recommend using "DUCKDUCKGO" because the crawled results are more accurate, but Baidu's response speed will be faster.

  • specific_url :This specifies the exact URL(s) to crawl directly. Example: "https://docs.python.org/3/tutorial/
  • model: You can choose the large model you want to use (Default "internlm/internlm2_5-7b-chat").
  • base_url: The base_url of the model (Default "https://api.siliconflow.cn/v1/chat/completions").
  • key: Pass in your own key。
  • max_web_results: Get the amount of crawled external knowledge (Default 5)。
  • save_format: Specify the format to save results. Set to "json" to automatically save results to a file named after your question (e.g., "your_question.json").

Report errors:

When you fail to obtain website content, don't worry, just wait a little longer, because some websites require verification. Another solution is to increase the number of retries and thread sleep time.

4. 📋Complete Example

fromFreeKnowledge_AIimportknowledge_centercenter=knowledge_center.Center()
question="2025年EMNLP会议的主题是什么?"flag=Truemode="DUCKDUCKGO"results=center.get_response(question, flag, mode, model="internlm/internlm2_5-7b-chat", base_url="https://api.siliconflow.cn/v1/chat/completions", key="xxx", max_web_results=2)
print(results) 

5. 📈 Evaluation

5.1 Benchmark:

We release the Academy Search dataset to serve as a unified academic-domain benchmark for search engine evaluation. All 200 queries are non-open-ended and difficult, collected exclusively from paper pages of top-tier conferences and journals, and uniformly stored in the dataset/ directory. Each query comes with a verifiable ground-truth answer on the source website and has been independently cross-checked by two master’s students in computer science. The dataset is further divided into two categories: fact-based judgment questions and fact-based short-answer question, and we will continue to expand the dataset to additional disciplines and open-source the updates. We evaluate the search engines by feeding their outputs to InternLM3-8B, which then uniformly compares each response against the verifiable ground-truth answer to produce a consistent.

5.2 characteristics:
  • non-open-ended;
  • difficult;
  • verifiable;
  • multi-categories;

Academic Domain Examples:

Example 1:
{
"query": "EMNLP 2024的投稿主题是否包括计算社会科学与文化分析?",
"domain": "学术",
"ground_truth": true,
"answer_type": "boolean"
}
Example 2:
{
"query": "ACL 2025主题轨道的核心内容是什么?",
"domain": "学术",
"ground_truth": "聚焦自然语言处理模型的泛化能力,包括如何增强模型在组合性、结构性、跨任务、跨语言、跨领域及鲁棒性等多维度的泛化能力,探究影响泛化的因素,评估泛化能力的有效方法,以及大语言模型在泛化方面的关键局限性等",
"answer_type": "entity"
}

Medical Domain Examples:

{
"query": "派安普利单抗注射液是否获得FDA批准用于治疗复发或转移性鼻咽癌?",
"domain": "医疗",
"ground_truth": true,
"answer_type": "boolean"
}
{
"query": "根据共识,儿童脓毒性休克液体复苏的首剂液体选择是什么?推荐剂量是多少?",
"domain": "医疗",
"ground_truth": "首剂液体选择等渗晶体液,剂量为20ml/kg,于5-10分钟内静脉推注",
"answer_type": "entity"
}

Note: Data in medical.json and academic.json !!

5.3 Result:

Medical Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)--Not evaluated
FreeKnowledge-AI (Free)138/20069.00%✅ Evaluated
BoCha API (Business)86/20043.00%✅ Evaluated
Exa API (Business)--Not evaluated

Academy Search Dataset:

MethodCorrect AnswersAccuracyStatus
DuckDuckGO API (Free)3/2001.5%✅ Evaluated
FreeKnowledge-AI (Free)82/20041.00%✅ Evaluated
BoCha API (Business)14/2007.00%✅ Evaluated
Exa API (Business)--Not evaluated

**Note: ** FreeKnowledge AI takes 15–20 times longer than both DuckDuckGo and BoCha Search, and BoCha Search costs about 15 RMB for 200 queries—much more expensive than Exa—and delivers significantly worse results.

6. 🛠️ MCP Integration (New!)

FreeKnowledge AI now supports MCP (Model Control Protocol) integration, allowing you to use its search capabilities directly from MCP-compatible clients like Claude, ChatGPT, and other agents.

Setup MCP Server

  1. Make sure you have the MCP client library installed:
pip install mcp
  1. Create a FreeKnowledgeMcp.json configuration file:
{
"mcpServers": {
"knowledge_search_server": {
"command": "python",
"args": ["path/to/your/FreeKnowledge_AI/MCP.py"],
"transport": "stdio"
}
}
}

Available MCP Tools

  • baidu_search_with_summary: Search using Baidu and summarize results with AI
  • duckduckgo_search_with_summary: Search using DuckDuckGo and summarize results with AI
  • url_specific_with_summary: Fetch and summarize content from a specific URL

7. 👇Citation

If you think this project is useful to you, please click star and cite this project。

@misc{Wu2024FreeKnowledge_AI,
title={FreeKnowledge_AI: An agent that provides free and flexible access to external knowledge, author={Yuhang Wu and Wenzheng Wang and Henghua Zhang}, year={2025}, url=[{<url id="cuqmhcd43355nsg2o9dg" type="url" status="parsed" title="GitHub -VovyH/FreeKnowledge_AI" wc="6723">https://github.com/VovyH/FreeKnowledge_AI</url>}](https://github.com/VovyH/FreeKnowledge_AI/),}

8. License

Apache 2.0 — see the LICENSE file for details.

About

[2025AIAgent / 2025InternLab]An agent that provides free and flexible access to Search external knowledge.

Resources

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages