Graph-Native Infrastructure for Context and Accountable AI Systems
Python agent-memoryaiai-governanceai-infrastructureartificial-intelligencecontext-engineeringcontext-graphsdata-engineeringdecision-intelligencedeveloper-toolsexplainable-aigenerative-aigraph-ragknowledge-graphllmontologyprovenancepythonreasoningsemantic-search
feat: expand real-world data sources and add web ingestion to advanced RAG notebooks
KaifAhmad1ab9624fb39e1
diff --git a/cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynb b/cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynbindex 8f5608e6..a977a6a2 100644--- a/cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynb+++ b/cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynb@@ -124,11 +124,23 @@"sources = []\n","\n","# 1. RSS Ingestion\n",- "feed_url = \"https://makeupandbeautyblog.com/feed\"\n",- "try:\n",- " feed_data = ingest_feed(feed_url, method=\"rss\")\n",- " sources.extend([item.content or item.description for item in feed_data.items[:5]])\n",- "except Exception: pass\n",+ "feed_urls = [\n",+ " \"https://makeupandbeautyblog.com/feed\",\n",+ " \"https://www.westlakedermatology.com/feed\",\n",+ " \"https://www.contourderm.com/feed\",\n",+ " \"https://www.michelegreenmd.com/feed\",\n",+ " \"https://www.skincarephysicians.net/blog/feed/\",\n",+ " \"https://www.beautifulwithbrains.com/blog/feed/\",\n",+ " \"https://www.drbaileyskincare.com/blogs/blog.atom\"\n",+ "]\n",+ "\n",+ "for url in feed_urls:\n",+ " try:\n",+ " print(f\"Ingesting from: {url}\")\n",+ " feed_data = ingest_feed(url, method=\"rss\")\n",+ " sources.extend([item.content or item.description for item in feed_data.items[:3]])\n",+ " except Exception as e:\n",+ " print(f\"Failed to ingest {url}: {e}\")\n","\n","# 2. Local Expert Guide\n","expert_content = \"\"\"\n",diff --git a/cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynb b/cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynbindex 30ba1ee9..eac58515 100644--- a/cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynb+++ b/cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynb@@ -24,7 +24,7 @@"metadata": {},"outputs": [],"source": [- "%pip install -qU semantica networkx matplotlib plotly pandas faiss-cpu falkordb sentence-transformers"+ "%pip install -qU semantica networkx matplotlib plotly pandas faiss-cpu falkordb sentence-transformers beautifulsoup4 requests"]},{@@ -103,22 +103,50 @@"metadata": {},"outputs": [],"source": [- "from semantica.ingest import FeedIngestor\n",+ "from semantica.ingest import FeedIngestor, WebIngestor\n","\n","all_content = []\n",+ "\n",+ "# 1. RSS Feed Ingestion\n","feeds = [\n"," \"http://feeds.bbci.co.uk/news/world/rss.xml\",\n",- " \"https://www.aljazeera.com/xml/rss/all.xml\"\n",+ " \"https://www.aljazeera.com/xml/rss/all.xml\",\n",+ " \"https://rss.nytimes.com/services/xml/rss/nyt/World.xml\",\n",+ " \"https://www.theguardian.com/world/rss\",\n",+ " \"https://techcrunch.com/feed/\",\n",+ " \"https://www.wired.com/feed/rss\",\n",+ " \"https://feeds.feedburner.com/venturebeat/SBNp\",\n",+ " \"https://www.kdnuggets.com/feed\",\n",+ " \"https://towardsdatascience.com/feed\",\n",+ " \"https://feeds.arstechnica.com/arstechnica/index\"\n","]\n","\n","feed_ingestor = FeedIngestor()\n","for f in feeds:\n"," try:\n",+ " print(f\"Ingesting from Feed: {f}\")\n"," data = feed_ingestor.ingest_feed(f)\n",- " for item in data.items[:15]:\n",+ " for item in data.items[:5]:\n"," text = item.content or item.description or item.title\n"," if text: all_content.append(text)\n",- " except Exception: continue\n",+ " except Exception as e:\n",+ " print(f\"Failed to ingest {f}: {e}\")\n",+ "\n",+ "# 2. Web Ingestion (Direct URL Scraping)\n",+ "web_ingestor = WebIngestor()\n",+ "web_urls = [\n",+ " \"https://en.wikipedia.org/wiki/Artificial_intelligence\",\n",+ " \"https://en.wikipedia.org/wiki/Knowledge_graph\"\n",+ "]\n",+ "\n",+ "for url in web_urls:\n",+ " try:\n",+ " print(f\"Ingesting from Web: {url}\")\n",+ " content = web_ingestor.ingest_url(url)\n",+ " if content and content.text:\n",+ " all_content.append(content.text)\n",+ " except Exception as e:\n",+ " print(f\"Failed to ingest {url}: {e}\")\n","\n","clean_docs = [normalizer.normalize(text) for text in all_content if len(text) > 100]\n","chunks = []\n",