Use this file to discover all available pages before exploring further.
What this builds. A KB that ingests web content two ways — one URL with AI enhancement, and a recursive crawl bounded by url_limit.
You’ll end up with. A KB holding both ingestion results, with the recursive crawl scheduled to refresh weekly.
"""Example 04: Ingest URLs (single page or recursive crawl).`UrlConfig.recursive=True` promotes a single URL to a recursive crawlbounded by `url_limit`. Per-item rescrape frequency is set on the URLconfig so the backend re-crawls on schedule."""from vectorshift.knowledge_base import ( KnowledgeBase, UrlConfig, RescrapeFrequency,)kb = KnowledgeBase.new(name="SDK urls demo")print(f"1. Created KB id={kb.id}")# Single page, no rescrapesingle = kb.add_urls_and_wait( urls=["https://docs.python.org/3/library/asyncio.html"], url_config=UrlConfig( recursive=False, ai_enhance_content=True, rescrape_frequency=RescrapeFrequency.NEVER, ), timeout=240,)print(f"2. Single URL ingested: status={single.status}")# Recursive crawl, weekly refreshcrawl = kb.add_urls_and_wait( urls=["https://docs.python.org/3/library/"], url_config=UrlConfig( recursive=True, url_limit=10, ai_enhance_content=False, rescrape_frequency=RescrapeFrequency.WEEKLY, ), timeout=300,)print(f"3. Recursive crawl ingested: status={crawl.status}")kb.delete()print("4. Deleted KB.")