{"id":5025,"date":"2024-08-25T07:15:31","date_gmt":"2024-08-24T23:15:31","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=5025"},"modified":"2025-07-14T00:37:36","modified_gmt":"2025-07-13T16:37:36","slug":"cognee-2","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/de\/cognee-2\/","title":{"rendered":"cognee\uff1a\u57fa\u4e8e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u7684RAG\u5f00\u6e90\u6846\u67b6\uff0c\u6838\u5fc3prompts\u5b66\u4e60"},"content":{"rendered":"<p>Cognee\u662f\u4e00\u4e2a\u4e13\u4e3aAI\u5e94\u7528\u548cAI\u4ee3\u7406\u8bbe\u8ba1\u7684\u53ef\u9760\u6570\u636e\u5c42\u89e3\u51b3\u65b9\u6848\u3002\u65e8\u5728\u52a0\u8f7d\u548c\u6784\u5efaLLM(\u5927\u578b\u8bed\u8a00\u6a21\u578b)\u4e0a\u4e0b\u6587\uff0c\u901a\u8fc7\u77e5\u8bc6\u56fe\u8c31\u548c\u5411\u91cf\u5b58\u50a8\u521b\u5efa\u51c6\u786e\u548c\u53ef\u89e3\u91ca\u7684AI\u89e3\u51b3\u65b9\u6848\u3002\u8be5\u6846\u67b6\u6709\u5229\u4e8e\u6210\u672c\u8282\u7ea6\u3001\u53ef\u89e3\u91ca\u6027\u5f3a\u548c\u7528\u6237\u53ef\u5f15\u5bfc\u63a7\u5236\uff0c\u9002\u5408\u79d1\u7814\u548c\u6559\u80b2\u7528\u9014\u3002\u5b98\u65b9\u7f51\u7ad9\u63d0\u4f9b\u4e86\u5165\u95e8\u6559\u7a0b\u3001\u6982\u5ff5\u6982\u8ff0\u3001\u5b66\u4e60\u6750\u6599\u548c\u76f8\u5173\u7814\u7a76\u8d44\u8baf\u3002<\/p>\n<blockquote><p>cognee \u6700\u5927\u7684\u4f18\u52bf\u611f\u89c9\u5c31\u662f\u4e22\u7ed9\u4ed6\u6570\u636e\uff0c\u7136\u540e\u81ea\u52a8\u5904\u7406\u6570\u636e\u5e76\u5efa\u7acb\u77e5\u8bc6\u56fe\u8c31\uff0c\u5e76\u5c06\u6709\u5173\u8054 topic \u7684\u56fe\u8c31\u91cd\u65b0\u8fde\u63a5\u5728\u4e00\u8d77\uff0c\u5e2e\u52a9\u4f60\u66f4\u597d\u7684\u53d1\u6398\u6570\u636e\u7684\u5173\u8054\u4ee5\u53ca <a href=\"https:\/\/www.kdjingpai.com\/rag\/\">RAG<\/a> for LLM \u65f6\u63d0\u4f9b\u6781\u81f4\u7684\u53ef\u89e3\u91ca\u6027<\/p>\n<p>1. \u6dfb\u52a0\u6570\u636e\uff0c\u57fa\u4e8e LLM \u81ea\u52a8\u8bc6\u522b\u548c\u5904\u7406\u6570\u636e\uff0c\u62bd\u53d6\u6210 Knowledge Graph \u5e76\u53ef\u4ee5\u5b58\u50a8 weaviate <a href=\"https:\/\/www.kdjingpai.com\/xiangliangshujukushenan\/\">\u5411\u91cf\u6570\u636e\u5e93<\/a> 2. \u4f18\u70b9\u662f\uff1a\u7701\u94b1\u3001\u53ef\u89e3\u91ca\u6027 &#8211; \u56fe\u53ef\u89c6\u5316\u6570\u636e\u3001\u53ef\u63a7 &#8211; \u6574\u5408\u8fdb\u4ee3\u7801\u7b49<\/p><\/blockquote>\n<p><img decoding=\"async\" title=\"-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/08\/ff863abb32b8763.png\" alt=\"-1\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li><strong>ECL\u7ba1\u9053<\/strong>\uff1a\u5b9e\u73b0\u6570\u636e\u7684\u63d0\u53d6\u3001\u8ba4\u77e5\u548c\u52a0\u8f7d\uff0c\u652f\u6301\u4e92\u8fde\u548c\u68c0\u7d22\u5386\u53f2\u6570\u636e\u3002<\/li>\n<li><strong>\u591a\u6570\u636e\u5e93\u652f\u6301<\/strong>\uff1a\u652f\u6301PostgreSQL\u3001Weaviate\u3001Qdrant\u3001Neo4j\u3001Milvus\u7b49\u6570\u636e\u5e93\u3002<\/li>\n<li><strong>\u51cf\u5c11\u5e7b\u89c9<\/strong>\uff1a\u901a\u8fc7\u4f18\u5316\u7ba1\u9053\u8bbe\u8ba1\uff0c\u51cf\u5c11AI\u5e94\u7528\u4e2d\u7684\u5e7b\u89c9\u73b0\u8c61\u3002<\/li>\n<li><strong>\u5f00\u53d1\u8005\u53cb\u597d<\/strong>\uff1a\u63d0\u4f9b\u8be6\u7ec6\u7684\u6587\u6863\u548c\u793a\u4f8b\uff0c\u964d\u4f4e\u5f00\u53d1\u8005\u7684\u4f7f\u7528\u95e8\u69db\u3002<\/li>\n<li><strong>\u53ef\u6269\u5c55\u6027<\/strong>\uff1a\u6a21\u5757\u5316\u8bbe\u8ba1\uff0c\u65b9\u4fbf\u6269\u5c55\u548c\u5b9a\u5236\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u6d41\u7a0b<\/h3>\n<ol>\n<li><strong>\u4f7f\u7528pip\u5b89\u88c5<\/strong>\uff1a\n<pre><code>pip install cognee\r\n<\/code><\/pre>\n<p>\u6216\u8005\u5b89\u88c5\u7279\u5b9a\u6570\u636e\u5e93\u652f\u6301\uff1a<\/p>\n<pre><code>pip install 'cognee[&lt;database&gt;]'\r\n<\/code><\/pre>\n<p>\u4f8b\u5982\uff0c\u5b89\u88c5PostgreSQL\u548cNeo4j\u652f\u6301\uff1a<\/p>\n<pre><code>pip install 'cognee[postgres, neo4j]'\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u4f7f\u7528poetry\u5b89\u88c5<\/strong>\uff1a\n<pre><code>poetry add cognee\r\n<\/code><\/pre>\n<p>\u6216\u8005\u5b89\u88c5\u7279\u5b9a\u6570\u636e\u5e93\u652f\u6301\uff1a<\/p>\n<pre><code>poetry add cognee -E &lt;database&gt;\r\n<\/code><\/pre>\n<p>\u4f8b\u5982\uff0c\u5b89\u88c5PostgreSQL\u548cNeo4j\u652f\u6301\uff1a<\/p>\n<pre><code>poetry add cognee -E postgres -E neo4j\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u4f7f\u7528\u6d41\u7a0b<\/h3>\n<ol>\n<li><strong>\u8bbe\u7f6eAPI\u5bc6\u94a5<\/strong>\uff1a\n<pre><code>import os\r\nos.environ[\"LLM_API_KEY\"] = \"YOUR_OPENAI_API_KEY\"\r\n<\/code><\/pre>\n<p>\u6216\u8005\uff1a<\/p>\n<pre><code>import cognee\r\ncognee.config.set_llm_api_key(\"YOUR_OPENAI_API_KEY\")\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u521b\u5efa.env\u6587\u4ef6<\/strong>\uff1a \u521b\u5efa\u4e00\u4e2a.env\u6587\u4ef6\u5e76\u8bbe\u7f6eAPI\u5bc6\u94a5\uff1a\n<pre><code>LLM_API_KEY=YOUR_OPENAI_API_KEY\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u4f7f\u7528\u4e0d\u540c\u7684LLM\u63d0\u4f9b\u5546<\/strong>\uff1a \u53c2\u8003\u6587\u6863\u4e86\u89e3\u5982\u4f55\u914d\u7f6e\u4e0d\u540c\u7684LLM\u63d0\u4f9b\u5546\u3002<\/li>\n<li><strong>\u53ef\u89c6\u5316\u7ed3\u679c<\/strong>\uff1a \u5982\u679c\u4f7f\u7528Network\uff0c\u521b\u5efaGraphistry\u8d26\u6237\u5e76\u914d\u7f6e\uff1a\n<pre><code>cognee.config.set_graphistry_config({\r\n\"username\": \"YOUR_USERNAME\",\r\n\"password\": \"YOUR_PASSWORD\"\r\n})\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u4e3b\u8981\u529f\u80fd\u64cd\u4f5c\u6d41\u7a0b<\/h3>\n<ol>\n<li><strong>\u6570\u636e\u63d0\u53d6<\/strong>\uff1a \u4f7f\u7528Cognee\u7684ECL\u7ba1\u9053\u63d0\u53d6\u6570\u636e\uff0c\u652f\u6301\u591a\u79cd\u6570\u636e\u6e90\u548c\u683c\u5f0f\u3002<\/li>\n<li><strong>\u6570\u636e\u8ba4\u77e5<\/strong>\uff1a \u901a\u8fc7Cognee\u7684\u8ba4\u77e5\u6a21\u5757\u5904\u7406\u548c\u5206\u6790\u6570\u636e\uff0c\u51cf\u5c11\u5e7b\u89c9\u73b0\u8c61\u3002<\/li>\n<li><strong>\u6570\u636e\u52a0\u8f7d<\/strong>\uff1a \u5c06\u5904\u7406\u540e\u7684\u6570\u636e\u52a0\u8f7d\u5230\u76ee\u6807\u6570\u636e\u5e93\u6216\u5b58\u50a8\u4e2d\uff0c\u652f\u6301\u591a\u79cd\u6570\u636e\u5e93\u548c\u5411\u91cf\u5b58\u50a8\u3002<\/li>\n<\/ol>\n<h3>\u7279\u8272\u529f\u80fd\u64cd\u4f5c\u6d41\u7a0b<\/h3>\n<ol>\n<li><strong>\u4e92\u8fde\u548c\u68c0\u7d22\u5386\u53f2\u6570\u636e<\/strong>\uff1a \u4f7f\u7528Cognee\u7684\u6a21\u5757\u5316\u8bbe\u8ba1\uff0c\u65b9\u4fbf\u4e92\u8fde\u548c\u68c0\u7d22\u8fc7\u53bb\u7684\u5bf9\u8bdd\u3001\u6587\u6863\u548c\u97f3\u9891\u8f6c\u5f55\u3002<\/li>\n<li><strong>\u51cf\u5c11\u5f00\u53d1\u8005\u5de5\u4f5c\u91cf<\/strong>\uff1a \u63d0\u4f9b\u8be6\u7ec6\u7684\u6587\u6863\u548c\u793a\u4f8b\uff0c\u964d\u4f4e\u5f00\u53d1\u8005\u7684\u4f7f\u7528\u95e8\u69db\uff0c\u51cf\u5c11\u5f00\u53d1\u65f6\u95f4\u548c\u6210\u672c\u3002<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>\u8bbf\u95ee\u5b98\u7f51\u83b7\u53d6\u66f4\u591acognee\u6846\u67b6\u4fe1\u606f<br \/>\n\u9605\u8bfb\u6982\u8ff0\u638c\u63e1cognee\u7406\u8bba\u57fa\u7840<br \/>\n<a href=\"https:\/\/topoteretes.github.io\/cognee\/\">\u67e5\u770b\u6559\u7a0b\u548c\u5b66\u4e60\u6750\u6599\u5f00\u59cb\u4f7f\u7528<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>\u6838\u5fc3\u63d0\u793a\u6307\u4ee4<\/h2>\n<p>classify_content\uff1a\u5206\u7c7b\u5185\u5bb9<\/p>\n<pre>You are a classification engine and should classify content. Make sure to use one of the existing classification options nad not invent your own.\r\nThe possible classifications are:\r\n{\r\n\"Natural Language Text\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Articles, essays, and reports\",\r\n\"Books and manuscripts\",\r\n\"News stories and blog posts\",\r\n\"Research papers and academic publications\",\r\n\"Social media posts and comments\",\r\n\"Website content and product descriptions\",\r\n\"Personal narratives and stories\"\r\n]\r\n},\r\n\"Structured Documents\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Spreadsheets and tables\",\r\n\"Forms and surveys\",\r\n\"Databases and CSV files\"\r\n]\r\n},\r\n\"Code and Scripts\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Source code in various programming languages\",\r\n\"Shell commands and scripts\",\r\n\"Markup languages (HTML, XML)\",\r\n\"Stylesheets (CSS) and configuration files (YAML, JSON, INI)\"\r\n]\r\n},\r\n\"Conversational Data\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Chat transcripts and messaging history\",\r\n\"Customer service logs and interactions\",\r\n\"Conversational AI training data\"\r\n]\r\n},\r\n\"Educational Content\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Textbook content and lecture notes\",\r\n\"Exam questions and academic exercises\",\r\n\"E-learning course materials\"\r\n]\r\n},\r\n\"Creative Writing\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Poetry and prose\",\r\n\"Scripts for plays, movies, and television\",\r\n\"Song lyrics\"\r\n]\r\n},\r\n\"Technical Documentation\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Manuals and user guides\",\r\n\"Technical specifications and API documentation\",\r\n\"Helpdesk articles and FAQs\"\r\n]\r\n},\r\n\"Legal and Regulatory Documents\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Contracts and agreements\",\r\n\"Laws, regulations, and legal case documents\",\r\n\"Policy documents and compliance materials\"\r\n]\r\n},\r\n\"Medical and Scientific Texts\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Clinical trial reports\",\r\n\"Patient records and case notes\",\r\n\"Scientific journal articles\"\r\n]\r\n},\r\n\"Financial and Business Documents\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Financial reports and statements\",\r\n\"Business plans and proposals\",\r\n\"Market research and analysis reports\"\r\n]\r\n},\r\n\"Advertising and Marketing Materials\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Ad copies and marketing slogans\",\r\n\"Product catalogs and brochures\",\r\n\"Press releases and promotional content\"\r\n]\r\n},\r\n\"Emails and Correspondence\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Professional and formal correspondence\",\r\n\"Personal emails and letters\"\r\n]\r\n},\r\n\"Metadata and Annotations\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Image and video captions\",\r\n\"Annotations and metadata for various media\"\r\n]\r\n},\r\n\"Language Learning Materials\": {\r\n\"type\": \"TEXT\",\r\n\"subclass\": [\r\n\"Vocabulary lists and grammar rules\",\r\n\"Language exercises and quizzes\"\r\n]\r\n},\r\n\"Audio Content\": {\r\n\"type\": \"AUDIO\",\r\n\"subclass\": [\r\n\"Music tracks and albums\",\r\n\"Podcasts and radio broadcasts\",\r\n\"Audiobooks and audio guides\",\r\n\"Recorded interviews and speeches\",\r\n\"Sound effects and ambient sounds\"\r\n]\r\n},\r\n\"Image Content\": {\r\n\"type\": \"IMAGE\",\r\n\"subclass\": [\r\n\"Photographs and digital images\",\r\n\"Illustrations, diagrams, and charts\",\r\n\"Infographics and visual data representations\",\r\n\"Artwork and paintings\",\r\n\"Screenshots and graphical user interfaces\"\r\n]\r\n},\r\n\"Video Content\": {\r\n\"type\": \"VIDEO\",\r\n\"subclass\": [\r\n\"Movies and short films\",\r\n\"Documentaries and educational videos\",\r\n\"Video tutorials and how-to guides\",\r\n\"Animated features and cartoons\",\r\n\"Live event recordings and sports broadcasts\"\r\n]\r\n},\r\n\"Multimedia Content\": {\r\n\"type\": \"MULTIMEDIA\",\r\n\"subclass\": [\r\n\"Interactive web content and games\",\r\n\"Virtual reality (VR) and augmented reality (AR) experiences\",\r\n\"Mixed media presentations and slide decks\",\r\n\"E-learning modules with integrated multimedia\",\r\n\"Digital exhibitions and virtual tours\"\r\n]\r\n},\r\n\"3D Models and CAD Content\": {\r\n\"type\": \"3D_MODEL\",\r\n\"subclass\": [\r\n\"Architectural renderings and building plans\",\r\n\"Product design models and prototypes\",\r\n\"3D animations and <a href=\"https:\/\/www.kdjingpai.com\/character-ai\/\">character<\/a> models\",\r\n\"Scientific simulations and visualizations\",\r\n\"Virtual objects for AR\/VR environments\"\r\n]\r\n},\r\n\"Procedural Content\": {\r\n\"type\": \"PROCEDURAL\",\r\n\"subclass\": [\r\n\"Tutorials and step-by-step guides\",\r\n\"<a href=\"https:\/\/www.kdjingpai.com\/workflow\/\">Workflow<\/a> and process descriptions\",\r\n\"Simulation and training exercises\",\r\n\"Recipes and crafting instructions\"\r\n]\r\n}\r\n}<\/pre>\n<p>generate_cog_layers\uff1a\u751f\u6210\u8ba4\u77e5\u5c42<\/p>\n<pre>You are tasked with analyzing `{{ data_type }}` files, especially in a multilayer network context for tasks such as analysis, categorization, and feature extraction. Various layers can be incorporated to capture the depth and breadth of information contained within the {{ data_type }}.\r\n\r\nThese layers can help in understanding the content, context, and characteristics of the `{{ data_type }}`.\r\n\r\nYour objective is to extract meaningful layers of information that will contribute to constructing a detailed multilayer network or knowledge graph.\r\n\r\nApproach this task by considering the unique characteristics and inherent properties of the data at hand.\r\n\r\nVERY IMPORTANT: The context you are working in is `{{ category_name }}` and the specific domain you are extracting data on is `{{ category_name }}`.\r\n\r\nGuidelines for Layer Extraction:\r\nTake into account: The content type, in this case, is: `{{ category_name }}`, should play a major role in how you decompose into layers.\r\n\r\nBased on your analysis, define and describe the layers you've identified, explaining their <a href=\"https:\/\/www.kdjingpai.com\/relevance-ai\/\">relevance<\/a> and contribution to understanding the dataset. Your independent identification of layers will enable a nuanced and multifaceted representation of the data, enhancing applications in knowledge discovery, content analysis, and information <a href=\"https:\/\/www.kdjingpai.com\/retrieval\/\">retrieval<\/a>.<\/pre>\n<p>generate_graph_prompt\uff1a\u751f\u6210\u56fe\u5f62\u63d0\u793a<\/p>\n<pre>You are a top-tier algorithm\r\ndesigned for extracting information in structured formats to build a knowledge graph.\r\n- **Nodes** represent entities and concepts. They're akin to Wikipedia nodes.\r\n- **Edges** represent relationships between concepts. They're akin to Wikipedia links.\r\n- The aim is to achieve simplicity and clarity in the\r\nknowledge graph, making it accessible for a vast audience.\r\nYOU ARE ONLY EXTRACTING DATA FOR COGNITIVE LAYER `{{ layer }}`\r\n## 1. Labeling Nodes\r\n- **Consistency**: Ensure you use basic or elementary types for node labels.\r\n- For example, when you identify an entity representing a person,\r\nalways label it as **\"Person\"**.\r\nAvoid using more specific terms like \"mathematician\" or \"scientist\".\r\n- Include event, entity, time, or action nodes to the category.\r\n- Classify the memory type as episodic or semantic.\r\n- **Node IDs**: Never utilize integers as node IDs.\r\nNode IDs should be names or human-readable identifiers found in the text.\r\n## 2. Handling Numerical Data and Dates\r\n- Numerical data, like age or other related information,\r\nshould be incorporated as attributes or properties of the respective nodes.\r\n- **No Separate Nodes for Dates\/Numbers**:\r\nDo not create separate nodes for dates or numerical values.\r\nAlways attach them as attributes or properties of nodes.\r\n- **Property Format**: Properties must be in a key-value format.\r\n- **Quotation Marks**: Never use escaped single or double quotes within property values.\r\n- **Naming Convention**: Use snake_case for relationship names, e.g., `acted_in`.\r\n## 3. Coreference Resolution\r\n- **Maintain Entity Consistency**:\r\nWhen extracting entities, it's vital to ensure consistency.\r\nIf an entity, such as \"John Doe\", is mentioned multiple times\r\nin the text but is referred to by different names or pronouns (e.g., \"Joe\", \"he\"),\r\nalways use the most complete identifier for that entity throughout the knowledge graph.\r\nIn this example, use \"John Doe\" as the entity ID.\r\nRemember, the knowledge graph should be coherent and easily understandable,\r\nso maintaining consistency in entity references is crucial.\r\n## 4. Strict Compliance\r\nAdhere to the rules strictly. Non-compliance will result in termination\"\"\"<\/pre>\n<p>&nbsp;<\/p>\n<p>read_query_prompt\uff1a\u9605\u8bfb\u67e5\u8be2\u63d0\u793a<\/p>\n<pre>from os import path\r\nimport logging\r\nfrom cognee.root_dir import get_absolute_path\r\n\r\ndef read_query_prompt(prompt_file_name: str):\r\n\"\"\"Read a query prompt from a file.\"\"\"\r\ntry:\r\nfile_path = path.join(get_absolute_path(\".\/infrastructure\/llm\/prompts\"), prompt_file_name)\r\n\r\nwith open(file_path, \"r\", encoding = \"utf-8\") as file:\r\nreturn file.read()\r\nexcept FileNotFoundError:\r\nlogging.error(f\"Error: Prompt file not found. Attempted to read: %s {file_path}\")\r\nreturn None\r\nexcept Exception as e:\r\nlogging.error(f\"An error occurred: %s {e}\")\r\nreturn None<\/pre>\n<p>&nbsp;<\/p>\n<p>render_prompt\uff1a\u6e32\u67d3\u63d0\u793a<\/p>\n<pre>from jinja2 import Environment, FileSystemLoader, select_autoescape\r\nfrom cognee.root_dir import get_absolute_path\r\n\r\ndef render_prompt(filename: str, context: dict) -&gt; str:\r\n\"\"\"Render a Jinja2 template asynchronously.\r\n:param filename: The name of the template file to render.\r\n:param context: The context to render the template with.\r\n:return: The rendered template as a string.\"\"\"\r\n\r\n# Set the base directory relative to the cognee root directory\r\nbase_directory = get_absolute_path(\".\/infrastructure\/llm\/prompts\")\r\n\r\n# Initialize the Jinja2 environment to load templates from the filesystem\r\nenv = Environment(\r\nloader = FileSystemLoader(base_directory),\r\nautoescape = select_autoescape([\"html\", \"xml\", \"txt\"])\r\n)\r\n\r\n# Load the template by name\r\ntemplate = env.get_template(filename)\r\n\r\n# Render the template with the provided context\r\nrendered_template = template.render(context)\r\n\r\nreturn rendered_template<\/pre>\n<p>&nbsp;<\/p>\n<p>summarize_content\uff1a\u603b\u7ed3\u5185\u5bb9<\/p>\n<pre>You are a summarization engine and you should sumamarize content. Be brief and concise<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Cognee\u662f\u4e00\u4e2a\u4e13\u4e3aAI\u5e94\u7528\u548cAI\u4ee3\u7406\u8bbe\u8ba1\u7684\u53ef\u9760\u6570\u636e\u5c42\u89e3\u51b3\u65b9\u6848\u3002\u65e8\u5728\u52a0\u8f7d\u548c\u6784\u5efaLLM(\u5927\u578b\u8bed\u8a00\u6a21\u578b)\u4e0a\u4e0b\u6587\uff0c\u901a\u8fc7\u77e5\u8bc6\u56fe\u8c31\u548c\u5411\u91cf\u5b58\u50a8\u521b\u5efa\u51c6\u786e\u548c\u53ef\u89e3\u91ca\u7684AI\u89e3\u51b3\u65b9\u6848\u3002\u8be5\u6846\u67b6\u6709\u5229\u4e8e\u6210\u672c\u8282\u7ea6\u3001\u53ef\u89e3\u91ca\u6027\u5f3a\u548c\u7528\u6237\u53ef\u5f15\u5bfc\u63a7\u5236\uff0c\u9002\u5408\u79d1\u7814\u548c\u6559\u80b2\u7528\u9014\u3002\u5b98\u65b9\u7f51&#8230;<\/p>\n","protected":false},"author":1,"featured_media":60921,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[425,20,459],"tags":[230,260,243],"class_list":["post-5025","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-professional","category-tool","category-rag-project","tag-aikaiyuanxiangmu","tag-zhishitupu","tag-aizhishikuyukefu"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/5025","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/comments?post=5025"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/5025\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media\/60921"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media?parent=5025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/categories?post=5025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/tags?post=5025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}