Repository: SPThole/CoexistAI Branch: main Commit: b9e037a8b3ec Files: 40 Total size: 10.4 MB Directory structure: gitextract_gxmiyyip/ ├── .dockerignore ├── Dockerfile ├── Dockerfile.searxng ├── LICENSE ├── README.docker.md ├── README.md ├── README_MCP.md ├── __init__.py ├── app.py ├── coexist_tutorial.ipynb ├── config/ │ └── model_config.json ├── demo_queries.ipynb ├── docker-compose.yml ├── entrypoint.sh ├── model_config.py ├── output/ │ └── map_with_route_and_pois.html ├── quick_setup.sh ├── quick_setup_docker.sh ├── requirements.txt ├── searxng/ │ ├── settings.yml │ ├── settings.yml.new │ ├── uwsgi.ini │ └── uwsgi.ini.new ├── static/ │ └── admin.html ├── system_prompt.py └── utils/ ├── __init__.py ├── answer_generation.py ├── config.py ├── crawler_utils.py ├── git_utils.py ├── knowledge_base.py ├── map.py ├── process_content.py ├── profiler_utils.py ├── reddit_utils.py ├── retriever_utils.py ├── startup_banner.py ├── tts_utils.py ├── utils.py └── websearch_utils.py ================================================ FILE CONTENTS ================================================ ================================================ FILE: .dockerignore ================================================ __pycache__ *.pyc *.pyo *.pyd .pytest_cache .venv env/ infinity_env/ coexistaienv/ *.log artifacts/ output/ downloads/ ================================================ FILE: Dockerfile ================================================ FROM python:3.13-slim ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Build-time args that will be copied into the image as environment variables. # Users can pass these via `docker build --build-arg KEY=VALUE` to bake defaults. ARG LLM_MODEL_NAME=gemini-2.0-flash ARG LLM_TYPE=google ARG LLM_TEMPERATURE=0.1 ARG PORT_NUM_APP=8000 ARG PORT_NUM_SEARXNG=8085 ARG HOST_APP=0.0.0.0 ARG HOST_SEARXNG=0.0.0.0 ARG EMBED_MODE=google ARG EMBEDDING_MODEL_NAME=models/embedding-001 # Export non-secret build args as environment variables so model_config.py can read them at runtime ENV LLM_MODEL_NAME=${LLM_MODEL_NAME} ENV LLM_TYPE=${LLM_TYPE} ENV LLM_TEMPERATURE=${LLM_TEMPERATURE} ENV PORT_NUM_APP=${PORT_NUM_APP} ENV PORT_NUM_SEARXNG=${PORT_NUM_SEARXNG} ENV HOST_APP=${HOST_APP} ENV HOST_SEARXNG=${HOST_SEARXNG} ENV EMBED_MODE=${EMBED_MODE} ENV EMBEDDING_MODEL_NAME=${EMBEDDING_MODEL_NAME} # Install small set of system deps commonly needed by ML/audio packages RUN apt-get update && \ apt-get install -y --no-install-recommends \ git \ wget \ ffmpeg \ build-essential \ libsndfile1 \ && rm -rf /var/lib/apt/lists/* # Use /app as the workdir so the Dockerfile can be built from the CoexistAI folder WORKDIR /app # Copy only requirements first to leverage Docker cache (build context is the CoexistAI folder) COPY ./requirements.txt ./requirements.txt RUN python -m pip install --upgrade pip setuptools wheel # Copy application code (copy the current folder contents into /app) COPY ./ ./ # Reproduce quick_setup.sh virtualenv installs inside the image (mirrors the script) # Create a separate infinity_env and install packages there to avoid conflicts as in the script RUN python3.13 -m venv /opt/infinity_env && \ /opt/infinity_env/bin/pip install --no-cache-dir 'infinity-emb[all]' && \ /opt/infinity_env/bin/pip install --no-cache-dir 'optimum==1.27.0' && \ /opt/infinity_env/bin/pip install --no-cache-dir 'transformers<4.49' && \ /opt/infinity_env/bin/pip install --no-cache-dir --upgrade "typer==0.19.1" "click>=8.1.3" || true # Create a second venv similar to coexistaienv and install markitdown[all] RUN python3.13 -m venv /opt/coexistaienv && \ /opt/coexistaienv/bin/pip install --no-cache-dir 'markitdown[all]' || true # Now install the project requirements into the coexistaienv (matches quick_setup.sh order) RUN /opt/coexistaienv/bin/pip install --no-cache-dir -r requirements.txt || true # Entrypoint will be executed via shell; no need to force executable bit when host may mount files EXPOSE 8000 # Invoke the entrypoint from the copied project path. The entrypoint lives at CoexistAI/entrypoint.sh CMD ["sh", "/app/entrypoint.sh"] ================================================ FILE: Dockerfile.searxng ================================================ FROM searxng/searxng:latest # Copy custom settings COPY ./searxng/settings.yml /etc/searxng/settings.yml # Optionally copy other config files if needed # COPY ./searxng/uwsgi.ini /etc/searxng/uwsgi.ini ================================================ FILE: LICENSE ================================================ NON-COMMERCIAL RESEARCH AND EDUCATIONAL USE LICENSE Copyright (c) 2025 Sidhant Thole and CoexistAI Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use, copy, modify, and distribute the Software, subject to the following conditions: 1. **Non-Commercial Use Only** - The Software may be used, copied, modified, and distributed solely for non-commercial research, prototyping, and educational purposes. - Commercial use, including but not limited to use in a product, service, or offering for which a fee is charged or which is used in the operation of a business, is strictly prohibited without the express prior written consent of the copyright holders. 2. **No Redistribution for Commercial Purposes** - Redistribution of the Software or any derivative works for commercial purposes is not permitted. - Integration of the Software into commercial products or services is not permitted without explicit written permission. 3. **Attribution** - Any use, copy, or distribution of the Software must retain this license notice, copyright notice, and all disclaimers. 4. **No Warranty** - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 5. **Compliance** - You are responsible for ensuring that your use of the Software complies with all applicable laws, regulations, and terms of service of any data sources or third-party services accessed through the Software. 6. **Contact for Commercial Licensing** - For commercial licensing or other use not permitted by this license, please contact the maintainers at: [GitHub Issues or project contact email]. By using the Software, you agree to be bound by the terms of this license. ================================================ FILE: README.docker.md ================================================ # CoexistAI — Docker Quickstart ### Short, step-by-step instructions for two ways to start CoexistAI. Pick either Method A (helper script) or Method B (direct Docker Compose). ## Prerequisites - Docker Engine installed. ## Before you start (one-time) 1. Open a terminal and change into the repository folder: ```bash cd /path/to/CoexistAI ``` 2. Edit the .env file for keys and admin token (which will be used while editing model params): ## Method A — Helper script (recommended for beginners) This script automates the compose start and waits until the app reports ready. 1. Run the helper (from repo root): ```bash ./quick_setup_docker.sh ``` or ```bash # default timeout 300s ./quick_setup_docker.sh 600 # pass timeout in seconds (example: 600s = 10min) ``` For subsequent starts, run in similar way (it detects the existing image and skips building/installing). 2. What the script does (so you know what to expect): - Checks if the Docker image 'coexistai-app' already exists; if yes, runs `docker compose up -d` (no build); if not, runs `docker compose up -d --build` to start containers detached. - Polls `http://localhost:8000/status` every few seconds and prints a spinner. - Exits with code 0 when the app reports `{"status":"ready"}`. - Exits non-zero if the app reports `error` or the timeout is reached. 3. After the script finishes successfully, open: - http://localhost:8000/admin  - If using local models ignore api_keys fields - By default ADMIN_TOKEN=123456, you can change it via .env This opens the Admin UI, where you can edit model configurations, API keys, and reload settings without rebuilding the container. When to use Method A: you're new to Docker or want a simple way to wait until the app is ready. ## Method B — Direct Docker Compose (fast, manual) 1. Start the stack: - **First time** (builds the image): ```bash docker compose up -d --build ``` - **Subsequent times** (uses existing image): ```bash docker compose up -d ``` To stop: `docker compose down` To restart: `docker compose restart` 2. Wait for ready signal in terminal where you ran docker compose, then open the admin UI: - http://localhost:8000/admin 3. Verify status from the host: ```bash curl http://localhost:8000/status # expected JSON: {"status":"starting"} or {"status":"ready"} ``` 4. Edit configuration: - Use the Admin UI `/admin` and click "Save & Reload" to apply changes without rebuilding. - Or from the host (curl): ```bash curl -X POST -H "X-Admin-Token: $ADMIN_TOKEN" http://localhost:8000/admin/reload-config ``` When to use Method A: you prefer to run compose directly and watch logs yourself. Secrets (recommended pattern) - Do not store API keys in the repo. Use `.env` or file-backed secrets. - Recommended: create `CoexistAI/config/keys/` on the host, place key files there, and mount that folder into the container. Reference them in `config/model_config.json` with `llm_api_key_file` / `embed_api_key_file`. Quick troubleshooting - App unreachable? Check app logs: ```bash docker compose logs app --tail=200 ``` - App timed out in `quick_setup_docker.sh` or reports `error`? Inspect logs and increase timeout: ```bash docker compose logs app --tail=400 ./quick_setup_docker.sh 600 ``` - Long model downloads or HF errors: allow more time on first start or mount `artifacts/` (HF cache) into the container to avoid repeated downloads. Helpful commands ```bash # Check status curl http://localhost:8000/status # Ask app to reload config (from host) curl -X POST -H "X-Admin-Token: $ADMIN_TOKEN" http://localhost:8000/admin/reload-config # Follow logs interactively docker compose logs -f app --tail=200 ``` ================================================ FILE: README.md ================================================ # CoexistAI CoexistAI is a modular, developer-friendly research assistant framework. It enables you to build, search, summarize, and automate research workflows using LLMs, web search, Reddit, YouTube, git and mapping tools—all with simple API calls or Python functions.
SearxNG docker container is already running.\n",
"\n"
],
"text/plain": [
"SearxNG docker container is already running.\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from utils.utils import *\n",
"from utils.websearch_utils import *\n",
"set_logging(True) \n",
"from langchain_text_splitters import TokenTextSplitter\n",
"import os\n",
"port_num_searxng = 8085\n",
"host_searxng = \"localhost\"\n",
"if not is_searxng_running():\n",
" subprocess.run([\n",
" \"docker\", \"run\", \"--rm\",\n",
" \"-d\", \"-p\", f\"{port_num_searxng}:8080\",\n",
" \"-v\", f\"{os.getcwd()}/searxng:/etc/searxng:rw\",\n",
" \"-e\", f\"BASE_URL=http://{host_searxng}:{port_num_searxng}/\",\n",
" \"-e\", \"INSTANCE_NAME=my-instance\",\n",
" \"searxng/searxng\"\n",
" ])\n",
"else:\n",
" print(\"SearxNG docker container is already running.\")\n",
"\n",
"\n",
"os.environ['GOOGLE_API_KEY'] = 'YOUR_LLM_KEY' # Replace with your actual if google models are being used\n",
"\n",
"text_splitter = TokenTextSplitter(chunk_size=512, chunk_overlap=128)\n",
"from utils.websearch_utils import *\n",
"searcher = SearchWeb(port_num_searxng,host_searxng) # Initialize web search with a result limit"
]
},
{
"cell_type": "markdown",
"id": "ad2fddd7",
"metadata": {},
"source": [
"## 2. Loading Models\n",
"\n",
"Load embedding models and cross-encoders using the `load_model` function. You can choose between different embedding modes such as 'gemini', 'huggingface', or 'infinity_emb'.\n",
"\n",
"for local embedders, either use infinity_emb or huggingface"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "237dc7be",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:05:45,487] INFO utils.utils: Loading model: models/embedding-001 with embedding mode: google\n",
"[2025-07-27 12:05:45,487] INFO utils.utils: Loading model: models/embedding-001 with embedding mode: google\n",
"[2025-07-27 12:05:45,749] INFO transformers.configuration_utils: loading configuration file config.json from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/config.json\n",
"[2025-07-27 12:05:45,749] INFO transformers.configuration_utils: loading configuration file config.json from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/config.json\n",
"[2025-07-27 12:05:45,751] INFO transformers.configuration_utils: Model config XLMRobertaConfig {\n",
" \"architectures\": [\n",
" \"XLMRobertaForSequenceClassification\"\n",
" ],\n",
" \"attention_probs_dropout_prob\": 0.1,\n",
" \"bos_token_id\": 0,\n",
" \"classifier_dropout\": null,\n",
" \"eos_token_id\": 2,\n",
" \"hidden_act\": \"gelu\",\n",
" \"hidden_dropout_prob\": 0.1,\n",
" \"hidden_size\": 768,\n",
" \"id2label\": {\n",
" \"0\": \"LABEL_0\"\n",
" },\n",
" \"initializer_range\": 0.02,\n",
" \"intermediate_size\": 3072,\n",
" \"label2id\": {\n",
" \"LABEL_0\": 0\n",
" },\n",
" \"layer_norm_eps\": 1e-05,\n",
" \"max_position_embeddings\": 514,\n",
" \"model_type\": \"xlm-roberta\",\n",
" \"num_attention_heads\": 12,\n",
" \"num_hidden_layers\": 12,\n",
" \"output_past\": true,\n",
" \"pad_token_id\": 1,\n",
" \"position_embedding_type\": \"absolute\",\n",
" \"torch_dtype\": \"float32\",\n",
" \"transformers_version\": \"4.52.4\",\n",
" \"type_vocab_size\": 1,\n",
" \"use_cache\": true,\n",
" \"vocab_size\": 250002\n",
"}\n",
"\n",
"[2025-07-27 12:05:45,751] INFO transformers.configuration_utils: Model config XLMRobertaConfig {\n",
" \"architectures\": [\n",
" \"XLMRobertaForSequenceClassification\"\n",
" ],\n",
" \"attention_probs_dropout_prob\": 0.1,\n",
" \"bos_token_id\": 0,\n",
" \"classifier_dropout\": null,\n",
" \"eos_token_id\": 2,\n",
" \"hidden_act\": \"gelu\",\n",
" \"hidden_dropout_prob\": 0.1,\n",
" \"hidden_size\": 768,\n",
" \"id2label\": {\n",
" \"0\": \"LABEL_0\"\n",
" },\n",
" \"initializer_range\": 0.02,\n",
" \"intermediate_size\": 3072,\n",
" \"label2id\": {\n",
" \"LABEL_0\": 0\n",
" },\n",
" \"layer_norm_eps\": 1e-05,\n",
" \"max_position_embeddings\": 514,\n",
" \"model_type\": \"xlm-roberta\",\n",
" \"num_attention_heads\": 12,\n",
" \"num_hidden_layers\": 12,\n",
" \"output_past\": true,\n",
" \"pad_token_id\": 1,\n",
" \"position_embedding_type\": \"absolute\",\n",
" \"torch_dtype\": \"float32\",\n",
" \"transformers_version\": \"4.52.4\",\n",
" \"type_vocab_size\": 1,\n",
" \"use_cache\": true,\n",
" \"vocab_size\": 250002\n",
"}\n",
"\n",
"[2025-07-27 12:05:45,755] INFO transformers.modeling_utils: loading weights file model.safetensors from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/model.safetensors\n",
"[2025-07-27 12:05:45,755] INFO transformers.modeling_utils: loading weights file model.safetensors from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/model.safetensors\n",
"[2025-07-27 12:05:45,826] INFO transformers.modeling_utils: All model checkpoint weights were used when initializing XLMRobertaForSequenceClassification.\n",
"\n",
"[2025-07-27 12:05:45,826] INFO transformers.modeling_utils: All model checkpoint weights were used when initializing XLMRobertaForSequenceClassification.\n",
"\n",
"[2025-07-27 12:05:45,827] INFO transformers.modeling_utils: All the weights of XLMRobertaForSequenceClassification were initialized from the model checkpoint at BAAI/bge-reranker-base.\n",
"If your task is similar to the task the model of the checkpoint was trained on, you can already use XLMRobertaForSequenceClassification for predictions without further training.\n",
"[2025-07-27 12:05:45,827] INFO transformers.modeling_utils: All the weights of XLMRobertaForSequenceClassification were initialized from the model checkpoint at BAAI/bge-reranker-base.\n",
"If your task is similar to the task the model of the checkpoint was trained on, you can already use XLMRobertaForSequenceClassification for predictions without further training.\n",
"[2025-07-27 12:05:46,461] INFO transformers.tokenization_utils_base: loading file sentencepiece.bpe.model from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/sentencepiece.bpe.model\n",
"[2025-07-27 12:05:46,461] INFO transformers.tokenization_utils_base: loading file sentencepiece.bpe.model from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/sentencepiece.bpe.model\n",
"[2025-07-27 12:05:46,463] INFO transformers.tokenization_utils_base: loading file tokenizer.json from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/tokenizer.json\n",
"[2025-07-27 12:05:46,463] INFO transformers.tokenization_utils_base: loading file tokenizer.json from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/tokenizer.json\n",
"[2025-07-27 12:05:46,464] INFO transformers.tokenization_utils_base: loading file added_tokens.json from cache at None\n",
"[2025-07-27 12:05:46,464] INFO transformers.tokenization_utils_base: loading file added_tokens.json from cache at None\n",
"[2025-07-27 12:05:46,465] INFO transformers.tokenization_utils_base: loading file special_tokens_map.json from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/special_tokens_map.json\n",
"[2025-07-27 12:05:46,465] INFO transformers.tokenization_utils_base: loading file special_tokens_map.json from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/special_tokens_map.json\n",
"[2025-07-27 12:05:46,466] INFO transformers.tokenization_utils_base: loading file tokenizer_config.json from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/tokenizer_config.json\n",
"[2025-07-27 12:05:46,466] INFO transformers.tokenization_utils_base: loading file tokenizer_config.json from cache at /Users/sidhantthole/.cache/huggingface/hub/models--BAAI--bge-reranker-base/snapshots/2cfc18c9415c912f9d8155881c133215df768a70/tokenizer_config.json\n",
"[2025-07-27 12:05:46,467] INFO transformers.tokenization_utils_base: loading file chat_template.jinja from cache at None\n",
"[2025-07-27 12:05:46,467] INFO transformers.tokenization_utils_base: loading file chat_template.jinja from cache at None\n",
"[2025-07-27 12:05:47,331] INFO sentence_transformers.cross_encoder.CrossEncoder: Use pytorch device: mps\n",
"[2025-07-27 12:05:47,331] INFO sentence_transformers.cross_encoder.CrossEncoder: Use pytorch device: mps\n"
]
}
],
"source": [
"hf_embeddings, cross_encoder = load_model(\"models/embedding-001\", _embed_mode='google',\n",
" kwargs={'api_key': os.environ['GOOGLE_API_KEY']})"
]
},
{
"cell_type": "markdown",
"id": "eab297bd",
"metadata": {},
"source": [
"## 4. Web Search Integration\n",
"\n",
"Use the `SearchWeb` class to perform web searches and retrieve results. This is useful for augmenting LLMs with up-to-date information from the web."
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "0b1c2e46",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:05:51,924] INFO utils.websearch_utils: Search results for query 'latest news in AI': [{'snippet': 'SoftBank chief: Forget AGI, ASI will be here within 10 years · Anthropic deploys AI agents to audit models for safety · Sam Altman: AI will cause job losses and ...', 'title': 'AI News | Latest AI News, Analysis & Events', 'link': 'https://www.artificialintelligence-news.com/', 'engines': ['google'], 'category': 'general'}, {'snippet': 'AI · Meta names Shengjia Zhao as chief scientist of AI superintelligence unit · AI referrals to top websites were up 357% year-over-year in June, reaching 1.13B.', 'title': 'AI News & Artificial Intelligence', 'link': 'https://techcrunch.com/category/artificial-intelligence/', 'engines': ['google'], 'category': 'general'}, {'snippet': \"2 Jul 2025 — Here's a recap of some of our biggest AI updates from June, including more ways to search with AI Mode, a new way to share your NotebookLM notebooks publicly.\", 'title': 'The latest AI news we announced in June', 'link': 'https://blog.google/technology/ai/google-ai-updates-june-2025/', 'engines': ['google'], 'category': 'general'}]\n",
"[2025-07-27 12:05:51,924] INFO utils.websearch_utils: Search results for query 'latest news in AI': [{'snippet': 'SoftBank chief: Forget AGI, ASI will be here within 10 years · Anthropic deploys AI agents to audit models for safety · Sam Altman: AI will cause job losses and ...', 'title': 'AI News | Latest AI News, Analysis & Events', 'link': 'https://www.artificialintelligence-news.com/', 'engines': ['google'], 'category': 'general'}, {'snippet': 'AI · Meta names Shengjia Zhao as chief scientist of AI superintelligence unit · AI referrals to top websites were up 357% year-over-year in June, reaching 1.13B.', 'title': 'AI News & Artificial Intelligence', 'link': 'https://techcrunch.com/category/artificial-intelligence/', 'engines': ['google'], 'category': 'general'}, {'snippet': \"2 Jul 2025 — Here's a recap of some of our biggest AI updates from June, including more ways to search with AI Mode, a new way to share your NotebookLM notebooks publicly.\", 'title': 'The latest AI news we announced in June', 'link': 'https://blog.google/technology/ai/google-ai-updates-june-2025/', 'engines': ['google'], 'category': 'general'}]\n"
]
},
{
"data": {
"text/html": [
"[\n", " {\n", " 'snippet': 'SoftBank chief: Forget AGI, ASI will be here within 10 years · Anthropic deploys AI agents to \n", "audit models for safety · Sam Altman: AI will cause job losses and ...',\n", " 'title': 'AI News | Latest AI News, Analysis & Events',\n", " 'link': 'https://www.artificialintelligence-news.com/',\n", " 'engines': ['google'],\n", " 'category': 'general'\n", " },\n", " {\n", " 'snippet': 'AI · Meta names Shengjia Zhao as chief scientist of AI superintelligence unit · AI referrals to\n", "top websites were up 357% year-over-year in June, reaching 1.13B.',\n", " 'title': 'AI News & Artificial Intelligence',\n", " 'link': 'https://techcrunch.com/category/artificial-intelligence/',\n", " 'engines': ['google'],\n", " 'category': 'general'\n", " },\n", " {\n", " 'snippet': \"2 Jul 2025 — Here's a recap of some of our biggest AI updates from June, including more ways to\n", "search with AI Mode, a new way to share your NotebookLM notebooks publicly.\",\n", " 'title': 'The latest AI news we announced in June',\n", " 'link': 'https://blog.google/technology/ai/google-ai-updates-june-2025/',\n", " 'engines': ['google'],\n", " 'category': 'general'\n", " }\n", "]\n", "\n" ], "text/plain": [ "\u001b[1m[\u001b[0m\n", " \u001b[1m{\u001b[0m\n", " \u001b[32m'snippet'\u001b[0m: \u001b[32m'SoftBank chief: Forget AGI, ASI will be here within 10 years · Anthropic deploys AI agents to \u001b[0m\n", "\u001b[32maudit models for safety · Sam Altman: AI will cause job losses and ...'\u001b[0m,\n", " \u001b[32m'title'\u001b[0m: \u001b[32m'AI News | Latest AI News, Analysis & Events'\u001b[0m,\n", " \u001b[32m'link'\u001b[0m: \u001b[32m'https://www.artificialintelligence-news.com/'\u001b[0m,\n", " \u001b[32m'engines'\u001b[0m: \u001b[1m[\u001b[0m\u001b[32m'google'\u001b[0m\u001b[1m]\u001b[0m,\n", " \u001b[32m'category'\u001b[0m: \u001b[32m'general'\u001b[0m\n", " \u001b[1m}\u001b[0m,\n", " \u001b[1m{\u001b[0m\n", " \u001b[32m'snippet'\u001b[0m: \u001b[32m'AI · Meta names Shengjia Zhao as chief scientist of AI superintelligence unit · AI referrals to\u001b[0m\n", "\u001b[32mtop websites were up 357% year-over-year in June, reaching 1.13B.'\u001b[0m,\n", " \u001b[32m'title'\u001b[0m: \u001b[32m'AI News & Artificial Intelligence'\u001b[0m,\n", " \u001b[32m'link'\u001b[0m: \u001b[32m'https://techcrunch.com/category/artificial-intelligence/'\u001b[0m,\n", " \u001b[32m'engines'\u001b[0m: \u001b[1m[\u001b[0m\u001b[32m'google'\u001b[0m\u001b[1m]\u001b[0m,\n", " \u001b[32m'category'\u001b[0m: \u001b[32m'general'\u001b[0m\n", " \u001b[1m}\u001b[0m,\n", " \u001b[1m{\u001b[0m\n", " \u001b[32m'snippet'\u001b[0m: \u001b[32m\"2 Jul 2025 — Here's a recap of some of our biggest AI updates from June, including more ways to\u001b[0m\n", "\u001b[32msearch with AI Mode, a new way to share your NotebookLM notebooks publicly.\"\u001b[0m,\n", " \u001b[32m'title'\u001b[0m: \u001b[32m'The latest AI news we announced in June'\u001b[0m,\n", " \u001b[32m'link'\u001b[0m: \u001b[32m'https://blog.google/technology/ai/google-ai-updates-june-2025/'\u001b[0m,\n", " \u001b[32m'engines'\u001b[0m: \u001b[1m[\u001b[0m\u001b[32m'google'\u001b[0m\u001b[1m]\u001b[0m,\n", " \u001b[32m'category'\u001b[0m: \u001b[32m'general'\u001b[0m\n", " \u001b[1m}\u001b[0m\n", "\u001b[1m]\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Get the top 3 results from querying the web\n", "results = searcher.query_search(\"latest news in AI\", num_results=3)\n", "print(results)" ] }, { "cell_type": "markdown", "id": "ed3c2eb8", "metadata": {}, "source": [ "## 5. Document Conversion from URLs\n", "\n", "Convert URLs into document objects using the `urls_to_docs` function. This allows you to process and analyze web content as structured documents." ] }, { "cell_type": "code", "execution_count": 11, "id": "ca473c3a", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n", " warnings.warn('resource_tracker: process died unexpectedly, '\n", "[2025-07-27 12:05:53,392] INFO utils.websearch_utils: Fetching URL: https://en.wikipedia.org/wiki/India\n", "[2025-07-27 12:05:53,392] INFO utils.websearch_utils: Fetching URL: https://en.wikipedia.org/wiki/India\n", "[2025-07-27 12:05:53,395] INFO utils.websearch_utils: Fetching URL: https://en.wikipedia.org/wiki/Bangalore\n", "[2025-07-27 12:05:53,395] INFO utils.websearch_utils: Fetching URL: https://en.wikipedia.org/wiki/Bangalore\n", "[2025-07-27 12:05:53,696] INFO utils.websearch_utils: Fetched content from https://en.wikipedia.org/wiki/Bangalore with type text/html; charset=UTF-8\n", "[2025-07-27 12:05:53,696] INFO utils.websearch_utils: Fetched content from https://en.wikipedia.org/wiki/Bangalore with type text/html; charset=UTF-8\n", "[2025-07-27 12:05:53,719] INFO utils.websearch_utils: Fetched content from https://en.wikipedia.org/wiki/India with type text/html; charset=UTF-8\n", "[2025-07-27 12:05:53,719] INFO utils.websearch_utils: Fetched content from https://en.wikipedia.org/wiki/India with type text/html; charset=UTF-8\n", "[2025-07-27 12:05:56,040] INFO utils.websearch_utils: Processed markdown for: https://en.wikipedia.org/wiki/Bangalore\n", "[2025-07-27 12:05:56,040] INFO utils.websearch_utils: Processed markdown for: https://en.wikipedia.org/wiki/Bangalore\n", "[2025-07-27 12:05:56,073] INFO utils.websearch_utils: Processed markdown for: https://en.wikipedia.org/wiki/India\n", "[2025-07-27 12:05:56,073] INFO utils.websearch_utils: Processed markdown for: https://en.wikipedia.org/wiki/India\n", "[2025-07-27 12:05:56,074] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://en.wikipedia.org/wiki/India\n", "[2025-07-27 12:05:56,074] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://en.wikipedia.org/wiki/India\n", "[2025-07-27 12:05:56,074] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://en.wikipedia.org/wiki/Bangalore\n", "[2025-07-27 12:05:56,074] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://en.wikipedia.org/wiki/Bangalore\n", "[2025-07-27 12:05:57,351] INFO utils.websearch_utils: Total URLs processed: 2\n", "[2025-07-27 12:05:57,351] INFO utils.websearch_utils: Total URLs processed: 2\n" ] }, { "data": { "text/html": [ "
Loaded 2 documents.\n",
"\n"
],
"text/plain": [
"Loaded \u001b[1;36m2\u001b[0m documents.\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Document(\n", " metadata={'source': 'https://en.wikipedia.org/wiki/India'},\n", " page_content='India - Wikipedia\\n\\nJump to content\\n\\nCoordinates: 21°N 78°E\\ufeff / \\ufeff21°N 78°E\\ufeff \n", "/ 21; 78\\n\\n![Featured \\n\\n![Extended-protected \\n\\nFrom Wikipedia, the free encyclopedia\\n\\nCountry in South \n", "Asia\\n\\nThis article is about the country. For other uses, see India (disambiguation).\\n\\n| Republic of India \n", "*BhÄ\\x81rat Gaá¹\\x87arÄ\\x81jya* | |\\n| --- | --- |\\n| Horizontal tricolour flag bearing, from top to bottom, deep \n", "saffron, white, and green horizontal bands. In the centre of the white band is a navy-blue wheel with 24 spokes. \n", "Flag State emblem | |\\n| **Motto:**Satyameva Jayate\\xa0(Sanskrit) \"Truth Alone Triumphs\"[1] | |\\n| \n", "**Anthem:**\\xa0Jana Gana Mana\\xa0(Hindi)[a][2][3] \"Thou Art the Ruler of the Minds of All People\"[4][2] | |\\n| \n", "**National song: Vande Mataram\\xa0(Sanskrit)[c]** \"I Bow to Thee, Mother\"[b][1][2] | |\\n| Image of a globe centred \n", "on India, with India highlighted. Territory controlled by India Territory claimed but not controlled | |\\n| \n", "Capital | New Delhi 28°36â\\x80²50â\\x80³N 77°12â\\x80²30â\\x80³E / 28.61389°N 77.20833°E / 28.61389; \n", "77.20833 |\\n| Largest city by city proper population | Mumbai |\\n| Largest city by metropolitan area population | \n", "Delhi |\\n| Official\\xa0languages | |\\n| Recognised regional\\xa0languages | State level and Eighth Schedule[9] |\\n|\n", "Native languages | 424 languages[g] |\\n| Religion (2011)[11] | |\\n| Demonym(s) | |\\n| Government | Federal \n", "parliamentary republic |\\n| | |\\n| â\\x80¢\\xa0President | Droupadi Murmu |\\n| â\\x80¢\\xa0Prime Minister | Narendra \n", "Modi |\\n| | |\\n| Legislature | Parliament |\\n| â\\x80¢\\xa0Upper house | Rajya Sabha |\\n| â\\x80¢\\xa0Lower house | \n", "Lok Sabha |\\n| Independence from the United Kingdom | |\\n| | |\\n| â\\x80¢\\xa0Dominion | 15 August 1947 |\\n| \n", "â\\x80¢\\xa0Republic | 26 January 1950 |\\n| | |\\n| Area | |\\n| â\\x80¢\\xa0Total | 3,287,263\\xa0km2 \n", "(1,269,219\\xa0sq\\xa0mi)[2][h] (7th) |\\n| â\\x80¢\\xa0Water\\xa0(%) | 9.6 |\\n| Population | |\\n| â\\x80¢\\xa02023 \n", "estimate | Neutral increase 1,428,627,663[13] (1st) |\\n| â\\x80¢\\xa02011\\xa0census | Neutral increase (2nd) |\\n| \n", "â\\x80¢\\xa0Density | 430.5/km2 (1,115.0/sq\\xa0mi) (30th) |\\n| GDP\\xa0(PPP) | 2025\\xa0estimate |\\n| â\\x80¢\\xa0Total |\n", "Increase $17.647 trillion[16] (3rd) |\\n| â\\x80¢\\xa0Per capita | Increase $12,132[16] (119th) |\\n| GDP\\xa0(nominal) \n", "| 2025\\xa0estimate |\\n| â\\x80¢\\xa0Total | Increase $4.187 trillion[16] (4th) |\\n| â\\x80¢\\xa0Per capita | Increase \n", "$2,878[16] (136th) |\\n| Gini\\xa0(2021) | Positive decrease\\xa025.5[17] low inequality |\\n| HDI\\xa0(2023) | \n", "Increase\\xa00.685[18] medium\\xa0(130th) |\\n| Currency | Indian rupee (â\\x82¹) (INR) |\\n| Time zone | UTC+05:30 \n", "(IST) |\\n| Date format | |\\n| Calling code | +91 |\\n| ISO 3166 code | IN |\\n| Internet TLD | .in (others) \n", "|\\n\\n**India**, officially the **Republic of India**,[j][20] is a country in South Asia. It is the seventh-largest \n", "country by area; the most populous country since 2023;[21] and, since its independence in 1947, the world\\'s most \n", "populous Bounded by the Indian Ocean on the south, the Arabian Sea on the southwest, and the Bay of Bengal on the \n", "southeast, it shares land borders with Pakistan to the west;[k] China, Nepal, and Bhutan to the north; and \n", "Bangladesh and Myanmar to the east. In the Indian Ocean, India is near Sri Lanka and the Maldives; its Andaman and \n", "Nicobar Islands share a maritime border with Thailand, Myanmar, and Indonesia.\\n\\nModern humans arrived on the \n", "Indian subcontinent from Africa no later than 55,000 years ago.[26][27][28] Their long occupation, predominantly in\n", "isolation as hunter-gatherers, has made the region highly diverse.[29] Settled life emerged on the subcontinent in \n", "the western margins of the Indus river basin 9,000 years ago, evolving gradually into the Indus Valley Civilisation\n", "of the third millennium BCE.[30] By 1200\\xa0BCE, an archaic form of Sanskrit, an Indo-European language, had \n", "diffused into India from the northwest.[31][32] Its hymns recorded the early dawnings of Hinduism in India.[33] \n", "India\\'s pre-existing Dravidian languages were supplanted in the northern regions.[34] By 400\\xa0BCE, caste had \n", "emerged within Hinduism,[35] and Buddhism and Jainism had arisen, proclaiming social orders unlinked to \n", "heredity.[36] Early political consolidations gave rise to the loose-knit Maurya and Gupta Empires.[37] Widespread \n", "creativity suffused this era,[38] but the status of women declined,[39] and untouchability became an organized \n", "belief.[l][40] In South India, the Middle kingdoms exported Dravidian language scripts and religious cultures to \n", "the kingdoms of Southeast Asia.[41]\\n\\nIn the early medieval era, Christianity, Islam, Judaism, and Zoroastrianism \n", "became established on India\\'s southern and western coasts.[42] Muslim armies from Central Asia intermittently \n", "overran India\\'s northern plains in the second millennium.[43] The resulting Delhi Sultanate drew northern India \n", "into the cosmopolitan networks of medieval Islam.[44] In south India, the Vijayanagara Empire created a \n", "long-lasting composite Hindu culture.[45] In the Punjab, Sikhism emerged, rejecting institutionalised religion.[46]\n", "The Mughal Empire ushered in two centuries of economic expansion and relative peace,[47] leaving a rich \n", "architectural legacy.[48][49] Gradually expanding rule of the British East India Company turned India into a \n", "colonial economy but consolidated its sovereignty.[50] British Crown rule began in 1858. The rights promised to \n", "Indians were granted slowly,[51][52] but technological changes were introduced, and modern ideas of education and \n", "the public life took root.[53] A nationalist movement emerged in India, the first in the non-European British \n", "empire and an influence on other nationalist movements.[54][55] Noted for nonviolent resistance after 1920,[56] it \n", "became the primary factor in ending British rule.[57] In 1947, the British Indian Empire was partitioned into two \n", "independent a Hindu-majority dominion of India and a Muslim-majority dominion of Pakistan. A large-scale loss of \n", "life and an unprecedented migration accompanied the partition.[62]\\n\\nIndia has been a federal republic since 1950,\n", "governed through a democratic parliamentary system. It is a pluralistic, multilingual and multi-ethnic society. \n", "India\\'s population grew from 361 million in 1951 to over 1.4 billion in 2023.[63] During this time, its nominal \n", "per capita income increased from US$64 annually to US$2,601, and its literacy rate from 16.6% to 74%. A \n", "comparatively destitute country in 1951,[64] India has become a fast-growing major economy and hub for information \n", "technology services; it has an expanding middle class.[65] Indian movies and music increasingly influence global \n", "culture.[66] India has reduced its poverty rate, though at the cost of increasing economic inequality.[67] It is a \n", "nuclear-weapon state that ranks high in military expenditure. It has disputes over Kashmir with its neighbours, \n", "Pakistan and China, unresolved since the mid-20th century.[68] Among the socio-economic challenges India faces are \n", "gender inequality, child malnutrition,[69] and rising levels of air pollution.[70] India\\'s land is megadiverse \n", "with four biodiversity hotspots.[71] India\\'s wildlife, which has traditionally been viewed with tolerance in its \n", "culture,[72] is supported in protected habitats.\\n\\nEtymology\\n---------\\n\\nMain article: Names for \n", "India\\n\\nAccording to the *Oxford English Dictionary* (2009), the name \"India\" is derived from the Classical Latin \n", "*India*, a reference to South Asia and an uncertain region to its east. In turn \"India\" derived successively from \n", "Hellenistic Greek *India* (Ἰνδία), Ancient Greek *Indos* (ἸνδÏ\\x8cÏ\\x82), Old Persian *Hindush* (an \n", "eastern province of the Achaemenid Empire), and ultimately its cognate, the Sanskrit *Sindhu*, or the Indus River,\n", "and by extension its well-settled southern basin.[73][74] The Ancient Greeks referred to the Indians as *Indoi*, \n", "\\'the people of the Indus\\'.[75]\\n\\nThe term *Bharat* (*BhÄ\\x81rat*; pronounced [Ë\\x88bʱaË\\x90ɾÉ\\x99t] \n", "â\\x93\\x98), mentioned in both Indian epic poetry and the Constitution of India,[76][77] is used in its variations \n", "by many Indian languages. A modern rendering of the historical name *Bharatavarsha*, which applied originally to \n", "North India,[78][79] *Bharat* gained increased currency from the mid-19th century as a native name for \n", "India.[76][80]\\n\\n*Hindustan* ([ɦɪndÊ\\x8aË\\x88staË\\x90n] â\\x93\\x98) is a Middle Persian name for India that \n", "became popular by the 13th century,[81] and was used widely since the era of the Mughal Empire. The meaning of \n", "*Hindustan* has varied, referring to a region encompassing the northern Indian subcontinent (present-day northern \n", "India and Pakistan) or to India in its near \\n\\nHistory\\n-------\\n\\nMain articles: History of India and History of \n", "the Republic of India\\n\\n### Ancient India\\n\\n\\n\\nManuscript illustration, c.â\\x80\\x891650, of the Sanskrit epic \n", "Ramayana, composed in story-telling fashion c.â\\x80\\x89400\\xa0BCE\\xa0â\\x80\\x93 c.â\\x80\\x89300\\xa0CE[83]\\n\\nBy \n", "55,000 years ago, the first modern humans, or *Homo sapiens*, had arrived on the Indian subcontinent from \n", "Africa.[26][27][28] The earliest known modern human remains in South Asia date to about 30,000 years ago.[26] After\n", "6500\\xa0BCE, evidence for domestication of food crops and animals, construction of permanent structures, and \n", "storage of agricultural surplus appeared in Mehrgarh and other sites in Balochistan, Pakistan.[84] These gradually \n", "developed into the Indus Valley the first urban culture in South Asia,[86] which flourished during \n", "2500â\\x80\\x931900\\xa0BCE in Pakistan and western India.[87] Centred around cities such as Mohenjo-daro, Harappa, \n", "Dholavira, and Kalibangan, and relying on varied forms of subsistence, the civilisation engaged robustly in crafts \n", "production and wide-ranging trade.[86]\\n\\nDuring the period 2000â\\x80\\x93500\\xa0BCE, many regions of the \n", "subcontinent transitioned from the Chalcolithic cultures to the Iron Age ones.[88] The Vedas, the oldest scriptures\n", "associated with Hinduism,[89] were composed during this period,[90] and historians have analysed these to posit a \n", "Vedic culture in the Punjab region and the upper Gangetic Plain.[88] Most historians also consider this period to \n", "have encompassed several waves of Indo-Aryan migration into the subcontinent from the north-west.[89] The caste \n", "system, which created a hierarchy of priests, warriors, and free peasants, but which excluded indigenous peoples by\n", "labelling their occupations impure, arose during this period.[91] On the Deccan Plateau, archaeological evidence \n", "from this period suggests the existence of a chiefdom stage of political organisation.[88] In South India, a \n", "progression to sedentary life is indicated by the large number of megalithic monuments dating from this period,[92]\n", "as well as by nearby traces of agriculture, irrigation tanks, and craft traditions.[92]\\n\\n\\n\\nCave 26 of the \n", "rock-cut Ajanta Caves\\n\\nIn the late Vedic period, around the 6th century BCE, the small states and chiefdoms of \n", "the Ganges Plain and the north-western regions had consolidated into 16 major oligarchies and monarchies that were \n", "known as the The emerging urbanisation gave rise to non-Vedic religious movements, two of which became independent\n", "religions. Jainism came into prominence during the life of its exemplar, Mahavira.[95] Buddhism, based on the \n", "teachings of Gautama Buddha, attracted followers from all social classes excepting the middle class; chronicling \n", "the life of the Buddha was central to the beginnings of recorded history in India.[96][97][98] In an age of \n", "increasing urban wealth, both religions held up renunciation as an ideal,[99] and both established long-lasting \n", "monastic traditions. Politically, by the 3rd century BCE, the kingdom of Magadha had annexed or reduced other \n", "states to emerge as the Maurya Empire.[100] The empire was once thought to have controlled most of the subcontinent\n", "except the far south, but its core regions are now thought to have been separated by large autonomous \n", "areas.[101][102] The Mauryan kings are known as much for their empire-building and determined management of public \n", "life as for Ashoka\\'s renunciation of militarism and far-flung advocacy of the Buddhist *dhamma*.[103][104]\\n\\nThe \n", "Sangam literature of the Tamil language reveals that, between 200\\xa0BCE and 200\\xa0CE, the southern peninsula was \n", "ruled by the Cheras, the Cholas, and the Pandyas, dynasties that traded extensively with the Roman Empire and with \n", "West and Southeast Asia.[105][106] In North India, Hinduism asserted patriarchal control within the family, leading\n", "to increased subordination of women.[107][100] By the 4th and 5th centuries, the Gupta Empire had created a complex\n", "system of administration and taxation in the greater Ganges Plain; this system became a model for later Indian \n", "kingdoms.[108][109] Under the Guptas, a renewed Hinduism based on devotion, rather than the management of ritual, \n", "began to assert itself.[110] This renewal was reflected in a flowering of sculpture and architecture, which found \n", "patrons among an urban elite.[109] Classical Sanskrit literature flowered as well, and Indian science, astronomy, \n", "medicine, and mathematics made significant advances.[109]\\n\\n### Medieval India\\n\\nMain article: Medieval \n", "India\\n\\n\\n\\nBrihadeshwara temple, Thanjavur, completed in 1010\\xa0CE\\n\\n\\n\\nThe Qutub Minar, 73\\xa0m (240\\xa0ft) \n", "tall, completed by the Sultan of Delhi, Iltutmish\\n\\nThe Indian early medieval age, from 600 to 1200\\xa0CE, is \n", "defined by regional kingdoms and cultural diversity.[111] When Harsha of Kannauj, who ruled much of the \n", "Indo-Gangetic Plain from 606 to 647\\xa0CE, attempted to expand southwards, he was defeated by the Chalukya ruler of\n", "the Deccan.[112] When his successor attempted to expand eastwards, he was defeated by the Pala king of Bengal.[112]\n", "When the Chalukyas attempted to expand southwards, they were defeated by the Pallavas from farther south, who in \n", "turn were opposed by the Pandyas and the Cholas from still farther south.[112] No ruler of this period was able to \n", "create an empire and consistently control lands much beyond their core region.[111] During this time, pastoral \n", "peoples, whose land had been cleared to make way for the growing agricultural economy, were accommodated within \n", "caste society, as were new non-traditional ruling classes.[113] The caste system consequently began to show \n", "regional differences.[113]\\n\\nIn the 6th and 7th centuries, the first devotional hymns were created in the Tamil \n", "language.[114] They were imitated all over India and led to both the resurgence of Hinduism and the development of \n", "all modern languages of the subcontinent.[114] Indian royalty, big and small, and the temples they patronised drew \n", "citizens in great numbers to the capital cities, which became economic hubs as well.[115] Temple towns of various \n", "sizes began to appear everywhere as India underwent another urbanisation.[115] By the 8th and 9th centuries, the \n", "effects were felt in Southeast Asia, as South Indian culture and political systems were exported to lands that \n", "became part of modern-day Myanmar, Thailand, Laos, Brunei, Cambodia, Vietnam, Philippines, Malaysia, and \n", "Indonesia.[116] Indian merchants, scholars, and sometimes armies were involved in this transmission; Southeast \n", "Asians took the initiative as well, with many sojourning in Indian seminaries and translating Buddhist and Hindu \n", "texts into their languages.[116]\\n\\nAfter the 10th century, Muslim Central Asian nomadic clans, using swift-horse \n", "cavalry and raising vast armies united by ethnicity and religion, repeatedly overran South Asia\\'s north-western \n", "plains, leading eventually to the establishment of the Islamic Delhi Sultanate in 1206.[117] The sultanate was to \n", "control much of North India and to make many forays into South India. Although at first disruptive for the Indian \n", "elites, the sultanate largely left its vast non-Muslim subject population to its own laws and customs.[118][119] By\n", "repeatedly repulsing Mongol raiders in the 13th century, the sultanate saved India from the devastation visited on \n", "West and Central Asia, setting the scene for centuries of migration of fleeing soldiers, learned men, mystics, \n", "traders, artists, and artisans from that region into the subcontinent, thereby creating a syncretic Indo-Islamic \n", "culture in the north.[120][121] The sultanate\\'s raiding and weakening of the regional kingdoms of South India \n", "paved the way for the indigenous Vijayanagara Empire.[122] Embracing a strong Shaivite tradition and building upon \n", "the military technology of the sultanate, the empire came to control much of peninsular India,[123] and was to \n", "influence South Indian society for long afterwards.[122]\\n\\n### Early modern India\\n\\n\\n\\nA distant view of the Taj\n", "Mahal from the Agra Fort\\n\\n\\n\\nA two mohur Company gold coin, issued in 1835, the obverse inscribed \"William IIII,\n", "King\"\\n\\nIn the early 16th century, northern India, then under mainly Muslim rulers,[124] fell again to the \n", "superior mobility and firepower of a new generation of Central Asian warriors.[125] The resulting Mughal Empire did\n", "not stamp out the local societies it came to rule. Instead, it balanced and pacified them through new \n", "administrative practices[126][127] and diverse and inclusive ruling elites,[128] leading to more systematic, \n", "centralised, and uniform rule.[129] Eschewing tribal bonds and Islamic identity, especially under Akbar, the \n", "Mughals united their far-flung realms through loyalty, expressed through a Persianised culture, to an emperor who \n", "had near-divine status.[128] The Mughal state\\'s economic policies, deriving most revenues from agriculture[130] \n", "and mandating that taxes be paid in the well-regulated silver currency,[131] caused peasants and artisans to enter \n", "larger markets.[129] The relative peace maintained by the empire during much of the 17th century was a factor in \n", "India\\'s economic expansion,[129] resulting in greater patronage of painting, literary forms, textiles, and \n", "architecture.[132] Newly coherent social groups in northern and western India, such as the Marathas, the Rajputs, \n", "and the Sikhs, gained military and governing ambitions during Mughal rule, which, through collaboration or \n", "adversity, gave them both recognition and military experience.[133] Expanding commerce during Mughal rule gave rise\n", "to new Indian commercial and political elites along the coasts of southern and eastern India.[133] As the empire \n", "disintegrated, many among these elites were able to seek and control their own affairs.[134]\\n\\nBy the early 18th \n", "century, with the lines between commercial and political dominance being increasingly blurred, a number of European\n", "trading companies, including the English East India Company, had established coastal outposts.[135][136] The East \n", "India Company\\'s control of the seas, greater resources, and more advanced military training and technology led it \n", "to increasingly assert its military strength and caused it to become attractive to a portion of the Indian elite; \n", "these factors were crucial in allowing the company to gain control over the Bengal region by 1765 and sideline the \n", "other European Its further access to the riches of Bengal and the subsequent increased strength and size of its \n", "army enabled it to annex or subdue most of India by the 1820s.[140] India was then no longer exporting manufactured\n", "goods as it long had, but was instead supplying the British Empire with raw materials. Many historians consider \n", "this to be the onset of India\\'s colonial period.[135] By this time, with its economic power severely curtailed by \n", "the British parliament and having effectively been made an arm of British administration, the East India Company \n", "began more consciously to enter non-economic arenas, including education, social reform, and culture.[141]\\n\\n### \n", "Modern India\\n\\nMain article: History of India (1947â\\x80\\x93present)\\n\\n\\n\\n1909 map of the British Indian \n", "Empire\\n\\n\\n\\nJawaharlal Nehru sharing a light moment with Mahatma Gandhi, Mumbai, 6 July 1946\\n\\nHistorians \n", "consider India\\'s modern age to have begun sometime between 1848 and 1885. The appointment in 1848 of Lord \n", "Dalhousie as Governor General of the East India Company set the stage for changes essential to a modern state. \n", "These included the consolidation and demarcation of sovereignty, the surveillance of the population, and the \n", "education of citizens. Technological changesâ\\x80\\x94among them, railways, canals, and the telegraphâ\\x80\\x94were \n", "introduced not long after their introduction in However, disaffection with the company also grew during this time \n", "and set off the Indian Rebellion of 1857. Fed by diverse resentments and perceptions, including invasive \n", "British-style social reforms, harsh land taxes, and summary treatment of some rich landowners and princes, the \n", "rebellion rocked many regions of northern and central India and shook the foundations of Company rule.[146][147] \n", "Although the rebellion was suppressed by 1858, it led to the dissolution of the East India Company and the direct \n", "administration of India by the British government. Proclaiming a unitary state and a gradual but limited \n", "British-style parliamentary system, the new rulers also protected princes and landed gentry as a feudal safeguard \n", "against future unrest.[148][149] In the decades following, public life gradually emerged all over India, leading \n", "eventually to the founding of the Indian National Congress in \\n\\nThe rush of technology and the commercialisation \n", "of agriculture in the second half of the 19th century was marked by economic setbacks, and many small farmers \n", "became dependent on the whims of far-away markets.[154] There was an increase in the number of large-scale \n", "famines,[155] and, despite the risks of infrastructure development borne by Indian taxpayers, little industrial \n", "employment was generated for Indians.[156] There were also salutary effects: commercial cropping, especially in the\n", "newly canalled Punjab, led to increased food production for internal consumption.[157] The railway network provided\n", "critical famine relief,[158] notably reduced the cost of moving goods,[158] and helped nascent Indian-owned \n", "industry.[157]\\n\\nAfter World War I, in which approximately one million Indians served,[159] a new period began. It\n", "was marked by British reforms but also repressive legislation, by more strident Indian calls for self-rule, and by \n", "the beginnings of a nonviolent movement of non-co-operation, of which Mahatma Gandhi would become the leader and \n", "enduring symbol.[160] During the 1930s, slow legislative reform was enacted by the British; the Indian National \n", "Congress won victories in the resulting elections.[161] The next decade was beset with crises: Indian participation\n", "in World War\\xa0II, the Congress\\'s final push for non-co-operation, and an upsurge of Muslim nationalism. All were\n", "capped by the advent of independence in 1947, but tempered by the partition of India into two states: India and \n", "Pakistan.[162]\\n\\nVital to India\\'s self-image as an independent nation was its constitution, completed in 1950, \n", "which put in place a secular and democratic republic.[163] Economic liberalisation, which began in the 1980s and \n", "with the collaboration with Soviet Union for technical knowledge,[164] has created a large urban middle class, \n", "transformed India into one of the world\\'s fastest-growing economies,[165] and increased its geopolitical \n", "influence. Yet, India is also shaped by persistent poverty, both rural and urban;[166] by religious and \n", "caste-related violence;[167] by Maoist-inspired Naxalite insurgencies;[168] and by separatism in Jammu and Kashmir \n", "and in Northeast India.[169] It has unresolved territorial disputes with China and with Pakistan.[170] India\\'s \n", "sustained democratic freedoms are unique among the world\\'s newer nations; however, in spite of its recent economic\n", "successes, freedom from want for its disadvantaged population remains a goal yet to be achieved.[171] As of 2025, \n", "poverty in India declined sharply, mainly due to government welfare programs.[172]\\n\\nGeography\\n---------\\n\\nMain \n", "article: Geography of India\\n\\n\\n\\nThe Tungabhadra, with rocky outcrops, flows into the peninsular Krishna \n", "River[173]\\n\\n\\n\\nFishing boats lashed together in a tidal creek in Anjarle village, Maharashtra\\n\\nIndia accounts \n", "for the bulk of the Indian subcontinent, lying atop the Indian tectonic plate, a part of the Indo-Australian \n", "Plate.[174] India\\'s defining geological processes began 75 million years ago when the Indian Plate, then part of \n", "the southern supercontinent Gondwana, began a north-eastward drift caused by seafloor spreading to its south-west, \n", "and later, south and south-east.[174] Simultaneously, the vast Tethyan oceanic crust, to its northeast, began to \n", "subduct under the Eurasian Plate.[174] These dual processes, driven by convection in the Earth\\'s mantle, both \n", "created the Indian Ocean and caused the Indian continental crust eventually to under-thrust Eurasia and to uplift \n", "the Himalayas.[174] Immediately south of the emerging Himalayas, plate movement created a vast crescent-shaped \n", "trough that rapidly filled with river-borne sediment[175] and now constitutes the Indo-Gangetic Plain.[176] The \n", "original Indian plate makes its first appearance above the sediment in the ancient Aravalli range, which extends \n", "from the Delhi Ridge in a southwesterly direction. To the west lies the Thar Desert, the eastern spread of which is\n", "checked by the \\n\\nThe remaining Indian Plate survives as peninsular India, the oldest and geologically most stable\n", "part of India. It extends as far north as the Satpura and Vindhya ranges in central India. These parallel chains \n", "run from the Arabian Sea coast in Gujarat in the west to the coal-rich Chota Nagpur Plateau in Jharkhand in the \n", "east.[180] To the south, the remaining peninsular landmass, the Deccan Plateau, is flanked on the west and east by \n", "coastal ranges known as the Western and Eastern Ghats;[181] the plateau contains the country\\'s oldest rock \n", "formations, some over one billion years old. Constituted in such fashion, India lies to the north of the equator \n", "between 6° 44â\\x80² and 35° 30â\\x80² north latitude[m] and 68° 7â\\x80² and 97° 25â\\x80² east \n", "longitude.[182]\\n\\nIndia\\'s coastline measures 7,517 kilometres (4,700\\xa0mi) in length; of this distance, 5,423 \n", "kilometres (3,400\\xa0mi) belong to peninsular India and 2,094 kilometres (1,300\\xa0mi) to the Andaman, Nicobar, and\n", "Lakshadweep island chains.[183] According to the Indian naval hydrographic charts, the mainland coastline consists \n", "of the following: 43% sandy beaches; 11% rocky shores, including cliffs; and 46% mudflats or marshy shores.[183] \n", "Major Himalayan-origin rivers that substantially flow through India include the Ganges and the Brahmaputra, both of\n", "which drain into the Bay of Bengal.[184] Important tributaries of the Ganges include the Yamuna and the Kosi; the \n", "latter\\'s extremely low gradient, caused by long-term silt deposition, leads to severe floods and course \n", "changes.[185][186] Major peninsular rivers, whose steeper gradients prevent their waters from flooding, include the\n", "Godavari, the Mahanadi, the Kaveri, and the Krishna, which also drain into the Bay of Bengal;[187] and the Narmada \n", "and the Tapti, which drain into the Arabian Sea.[188] Coastal features include the marshy Rann of Kutch of western \n", "India and the alluvial Sundarbans delta of eastern India; the latter is shared with Bangladesh.[189] India has two \n", "archipelagos: the Lakshadweep, coral atolls off India\\'s south-western coast; and the Andaman and Nicobar Islands, \n", "a volcanic chain in the Andaman Sea.[190]\\n\\nIndian climate is strongly influenced by the Himalayas and the Thar \n", "Desert, both of which drive the economically and culturally pivotal summer and winter monsoons.[191] The Himalayas \n", "prevent cold Central Asian katabatic winds from blowing in, keeping the bulk of the Indian subcontinent warmer than\n", "most locations at similar latitudes.[192][193] The Thar Desert plays a crucial role in attracting the \n", "moisture-laden south-west summer monsoon winds that, between June and October, provide the majority of India\\'s \n", "rainfall.[191] Four major climatic groupings predominate in India: tropical wet, tropical dry, subtropical humid, \n", "and montane.[194] Temperatures in India have risen by 0.7\\xa0°C (1.3\\xa0°F) between 1901 and 2018.[195] Climate \n", "change in India is often thought to be the cause. The retreat of Himalayan glaciers has adversely affected the flow\n", "rate of the major Himalayan rivers, including the Ganges and the Brahmaputra.[196] According to some current \n", "projections, the number and severity of droughts in India will have markedly increased by the end of the present \n", "century.[197]\\n\\n### Biodiversity\\n\\nMain articles: Forestry in India and Wildlife of India\\n\\n\\n\\nIndia has the \n", "majority of the world\\'s wild tigers, approximately 3,170 in 2022.[198]\\n\\n\\n\\nA chital (*Axis axis*) stag in the \n", "Nagarhole National Park in a region covered by a moderately dense[n] forest.\\n\\n\\n\\nThree of the last Asiatic \n", "cheetahs in India were shot dead in 1948 in Surguja district, Madhya Pradesh, Central India by Maharajah Ramanuj \n", "Pratap Singh Deo. The young male cheetahs, all from the same litter, were sitting together when they were shot at \n", "night.\\n\\nIndia is a megadiverse country, a term employed for 17 countries that display high biological diversity \n", "and contain many species exclusively indigenous, or endemic, to them.[199] India is the habitat for 8.6% of all \n", "mammals, 13.7% of bird species, 7.9% of reptile species, 6% of amphibian species, 12.2% of fish species, and 6.0% \n", "of all flowering plant species.[200][201] Fully a third of Indian plant species are endemic.[202] India also \n", "contains four of the world\\'s 34 biodiversity hotspots,[71] or regions that display significant habitat loss in the\n", "presence of high endemism.[o][203]\\n\\nIndia\\'s most dense forests, such as the tropical moist forest of the Andaman\n", "Islands, the Western Ghats, and Northeast India, occupy approximately 3% of its land area.[204][205] *Moderately \n", "dense forest*, whose canopy density is between 40% and 70%, occupies 9.39% of India\\'s land area.[204][205] It \n", "predominates in the temperate coniferous forest of the Himalayas, the moist deciduous *sal* forest of eastern \n", "India, and the dry deciduous teak forest of central and southern India.[206] India has two natural zones of thorn \n", "forest, one in the Deccan Plateau, immediately east of the Western Ghats, and the other in the western part of the \n", "Indo-Gangetic plain, now turned into rich agricultural land by irrigation, its features no longer visible.[207] \n", "Among the Indian subcontinent\\'s notable indigenous trees are the astringent *Azadirachta indica*, or *neem*, which\n", "is widely used in rural Indian herbal medicine,[208] and the luxuriant *Ficus religiosa*, or *peepul*,[209] which \n", "is displayed on the ancient seals of Mohenjo-daro,[210] and under which the Buddha is recorded in the Pali canon to\n", "have sought enlightenment.[211]\\n\\nMany Indian species have descended from those of Gondwana, the southern \n", "supercontinent from which India separated more than 100 million years ago.[212] India\\'s subsequent collision with \n", "Eurasia set off a mass exchange of species. However, volcanism and climatic changes later caused the extinction of \n", "many endemic Indian forms.[213] Still later, mammals entered India from Asia through two zoogeographic passes \n", "flanking the Himalayas.[214] This had the effect of lowering endemism among India\\'s mammals, which stands at \n", "12.6%, contrasting with 45.8% among reptiles and 55.8% among amphibians.[201] Among endemics are the \n", "vulnerable[215] hooded leaf monkey[216] and the threatened Beddome\\'s toad[217][218] of the Western Ghats.\\n\\nIndia\n", "contains 172 IUCN-designated threatened animal species, or 2.9% of endangered forms.[219] These include the \n", "endangered Bengal tiger and the Ganges river dolphin. Critically endangered species include the gharial, a \n", "crocodilian; the great Indian bustard; and the Indian white-rumped vulture, which has become nearly extinct by \n", "having ingested the carrion of diclofenac-treated cattle.[220] Before they were extensively used for agriculture \n", "and cleared for human settlement, the thorn forests of Punjab were mingled at intervals with open grasslands that \n", "were grazed by large herds of blackbuck preyed on by the Asiatic cheetah; the blackbuck, no longer extant in \n", "Punjab, is now severely endangered in India, and the cheetah is extinct.[221] The pervasive and ecologically \n", "devastating human encroachment of recent decades has critically endangered Indian wildlife. In response, the system\n", "of national parks and protected areas, first established in 1935, was expanded substantially. In 1972, India \n", "enacted the Wildlife Protection Act[222] and Project Tiger to safeguard crucial wilderness; the Forest Conservation\n", "Act was enacted in 1980 and amendments added in 1988.[223] India hosts more than five hundred wildlife sanctuaries \n", "and eighteen\\xa0biosphere reserves,[224] four of which are part of the World Network of Biosphere Reserves; its \n", "eighty-nine wetlands are registered under the Ramsar Convention.[225]\\n\\nPolitics and government\\n\\n\\n### \n", "Politics\\n\\nMain article: Politics of India\\n\\nSee also: Democracy in India\\n\\n\\n\\nAs part of Janadesh 2007, 25,000\n", "proâ\\x80\\x93land reform landless people in Madhya Pradesh listen to Rajagopal P. V.[226]\\n\\n\\n\\nUS president Barack\n", "Obama addresses the members of the Parliament of India in New Delhi in November 2010.\\n\\nIndia is a parliamentary \n", "republic with a multi-party system.[227] It has six\\xa0recognised national parties, including the Indian National \n", "Congress (INC) and the Bharatiya Janata Party (BJP), and over 50\\xa0regional parties.[228] Congress is considered \n", "the ideological centre in Indian political culture,[229] whereas the BJP is right-wing to From 1950 to the late \n", "1980s, Congress held a majority in the India\\'s parliament. Afterwards, it increasingly shared power with the \n", "BJP,[233] as well as with powerful regional parties, which forced multi-party coalition governments at the \n", "centre.[234]\\n\\nIn the Republic of India\\'s general elections in 1951, 1957, and 1962, Congress, led by Jawaharlal \n", "Nehru, won easy victories. On Nehru\\'s death in 1964, Lal Bahadur Shastri briefly became prime minister; he was \n", "succeeded in 1966, by Nehru\\'s daughter Indira Gandhi, who led the Congress to election victories in 1967 and 1971.\n", "Following public discontent with the state of emergency Indira Gandhi had declared in 1975, Congress was voted out \n", "of power in 1977; Janata Party, which had opposed the emergency, was voted in. Its government lasted two years; \n", "Morarji Desai and Charan Singh served as prime ministers. After Congress was returned to power in 1980, Indira \n", "Gandhi was assassinated and succeeded by Rajiv Gandhi, who won easily in the elections later that year. In the 1989\n", "elections a National Front coalition, led by the Janata Dal in alliance with the Left Front, won, lasting just \n", "under two years, and V.P. Singh and Chandra Shekhar serving as prime ministers.[235] In the 1991 Indian general \n", "election, Congress, as the largest single party, formed a minority government led by P. V. Narasimha \n", "Rao.[236]\\n\\nAfter the 1996 Indian general election, the BJP formed a government briefly; it was followed by United\n", "Front coalitions, which depended on external political support. Two prime ministers served during this period: H.D.\n", "Deve Gowda and I.K. Gujral. In 1998, the BJP formed a coalitionâ\\x80\\x94the National Democratic Alliance (NDA). Led\n", "by Atal Bihari Vajpayee, the NDA became the first non-Congress, coalition government to complete a five-year \n", "term.[237] In the 2004 Indian general elections, no party won an absolute majority. Still, the Congress emerged as \n", "the largest single party, forming another successful coalition: the United Progressive Alliance (UPA). It had the \n", "support of left-leaning parties and MPs who opposed the BJP. The UPA returned to power in the 2009 general election\n", "with increased numbers, and it no longer required external support from India\\'s communist parties.[238] Manmohan \n", "Singh became the first prime minister since Jawaharlal Nehru in 1957 and 1962 to be re-elected to a consecutive \n", "five-year term.[239] In the 2014 general election, the BJP became the first political party since 1984 to win an \n", "absolute majority.[240] In the 2019 general election, the BJP regained an absolute majority. In the 2024 general \n", "election, a BJP-led NDA coalition formed the government. Narendra Modi, a former chief minister of Gujarat, is \n", "serving as the prime minister of India in his third term since May 26, 2014.[241]\\n\\n### Government\\n\\nMain \n", "article: Government of India\\n\\nSee also: Constitution of India\\n\\n\\n\\nRashtrapati Bhavan, the official residence \n", "of the President of India, was designed by British architects Edwin Lutyens and Herbert Baker for the Viceroy of \n", "India, and constructed between 1911 and 1931 during the British Raj.[242]\\n\\nIndia is a federation with a \n", "parliamentary system governed under the Constitution of India. Federalism in India defines the power distribution \n", "between the union and the states. India\\'s form of government, traditionally described as \"quasi-federal\" with a \n", "strong centre and weak states,[243] has grown increasingly federal since the late 1990s as a result of political, \n", "economic, and social changes.[244][245]\\n\\nThe Government of India comprises three branches: the Executive, \n", "Legislature, and Judiciary.[246] The President of India is the ceremonial head of state,[247] who is elected \n", "indirectly for a five-year term by an electoral college comprising members of national and state The Prime \n", "Minister of India is the head of government and exercises most executive power.[250] Appointed by the \n", "president,[251] the prime minister is supported by the party or political alliance with a majority of seats in the \n", "lower house of parliament.[250] The executive of the Indian government consists of the president, the \n", "vice-president, and the Union Council of Ministersâ\\x80\\x94with the cabinet being its executive \n", "committeeâ\\x80\\x94headed by the prime minister. Any minister holding a portfolio must be a member of one of the \n", "houses of parliament.[247] In the Indian parliamentary system, the executive is subordinate to the legislature; the\n", "prime minister and their council are directly responsible to the lower house of the parliament. Civil servants act \n", "as permanent executives and all decisions of the executive are implemented by them.[252]\\n\\nThe legislature of \n", "India is the bicameral parliament. Operating under a Westminster-style parliamentary system, it comprises an upper \n", "house called the Rajya Sabha (Council of States) and a lower house called the Lok Sabha (House of the People).[253]\n", "The Rajya Sabha is a permanent body of 245\\xa0members who serve staggered six-year terms with elections every 2 \n", "years.[254] Most are elected indirectly by the state and union territorial legislatures in numbers proportional to \n", "their state\\'s share of the national population.[251] The Lok Sabha\\'s 543\\xa0members are elected directly by \n", "popular vote among citizens aged at least 18;[255] they represent single-member constituencies for \n", "five-year\\xa0terms.[256] Several seats from each state are reserved for candidates from Scheduled Castes and \n", "Scheduled Tribes in proportion to their population within that state.[255]\\n\\nIndia has a three-tier\\xa0unitary \n", "independent judiciary[257] comprising the supreme court, headed by the Chief Justice of India, 25\\xa0high courts, \n", "and a large number of trial courts.[257] The supreme court has original jurisdiction over cases involving \n", "fundamental rights and over disputes between states and the centre and has appellate jurisdiction over the high \n", "courts.[258] It has the power to both strike down union or state laws which contravene the constitution[259] and \n", "invalidate any government action it deems \\n\\n### Administrative divisions\\n\\nMain article: Administrative \n", "divisions of India\\n\\nSee also: Political integration of India\\n\\n\\n\\nA clickable map of the 28 states and 8 union \n", "territories of India\\n\\nIndia is a federal union comprising 28 states and 8 union territories.[12] All states, as \n", "well as the union territories of Jammu and Kashmir, Puducherry and the National Capital Territory of Delhi, have \n", "elected legislatures and governments following the Westminster system. The remaining five union territories are \n", "directly ruled by the central government through appointed administrators. In 1956, under the States Reorganisation\n", "Act, states were reorganised on a linguistic basis.[261] There are over a quarter of a million local government \n", "bodies at city, town, block, district and village levels.[262]\\n\\n#### States\\n\\n#### Union territories\\n\\nForeign,\n", "economic, and strategic relations\\n\\n\\nMain article: Foreign relations of India\\n\\nSee also: Indian Armed \n", "Forces\\n\\n\\n\\nDuring the 1950s and 60s, India played a pivotal role in the Non-Aligned Movement.[263] From left to \n", "right: Gamal Abdel Nasser of United Arab Republic (now Egypt), Josip Broz Tito of Yugoslavia and Jawaharlal Nehru \n", "in Belgrade, September 1961.\\n\\nIndia became a republic in 1950, remaining a member of the Commonwealth of \n", "Nations.[264][265] India strongly supported decolonisation in Africa and Asia in the 1950s; it played a leading \n", "role in the Non-Aligned Movement.[266] After cordial relations initially, India went to war with China in 1962. \n", "India was widely thought to have been humiliated.[267] Another military conflict followed in 1967 in which India \n", "successfully repelled a Chinese attack.[268] India has had uneasy relations with its western neighbour, Pakistan. \n", "The two countries went to war in 1947, 1965, 1971, and 1999. Three of these wars were fought over the disputed \n", "territory of Kashmir. In contrast, the 1971 war followed India\\'s support for the independence of Bangladesh.[269] \n", "After the 1965 war with Pakistan, India began to pursue close military and economic ties with the Soviet Union; by \n", "the late 1960s, the Soviet Union was its largest arms supplier.[270] India has played a key role in the South Asian\n", "Association for Regional Cooperation and the World Trade Organization. The nation has supplied 100,000 military and\n", "police personnel in 35 UN peacekeeping needed*]\\n\\n\\n\\nThe Indian Air Force contingent marching at the 221st \n", "Bastille Day military parade in Paris, on 14 July 2009. The parade at which India was the foreign guest was led by \n", "India\\'s oldest regiment, the Maratha Light Infantry, founded in 1768.[271]\\n\\nChina\\'s nuclear test of 1964 and \n", "threats to intervene in support of Pakistan in the 1965 war caused India to produce nuclear weapons.[272] India \n", "conducted its first nuclear weapons test in 1974 and carried out additional underground testing in 1998. India has \n", "signed neither the Comprehensive Nuclear-Test-Ban Treaty nor the Nuclear Non-Proliferation Treaty, considering both\n", "to be flawed and discriminatory.[273] India maintains a \"no first use\" nuclear policy and is developing a nuclear \n", "triad capability as a part of its \"Minimum Credible Deterrence\" doctrine.[274][275]\\n\\nSince the end of the Cold \n", "War, India has increased its economic, strategic, and military cooperation with the United States and the European \n", "Union.[276] In 2008, a civilian nuclear agreement was signed between India and the United States. Although India \n", "possessed nuclear weapons at the time and was not a party to the Nuclear Non-Proliferation Treaty, it received \n", "waivers from the International Atomic Energy Agency and the Nuclear Suppliers Group, ending earlier restrictions on\n", "India\\'s nuclear technology and commerce; India subsequently signed co-operation agreements involving civilian \n", "nuclear energy with Russia,[277] France,[278] the United Kingdom,[279] and Canada.[280]\\n\\nThe President of India \n", "is the supreme commander of the nation\\'s armed forces; with 1.45\\xa0million active troops, they compose the \n", "world\\'s second-largest military. It comprises the Indian Army, the Indian Navy, the Indian Air Force, and the \n", "Indian Coast Guard.[281] The official Indian defence budget for 2011 was US$36.03\\xa0billion, or 1.83% of GDP.[282]\n", "Defence expenditure was pegged at US$70.12\\xa0billion for fiscal year 2022â\\x80\\x9323 and, increased 9.8% than \n", "previous fiscal year.[283][284] India is the world\\'s second-largest arms importer; between 2016 and 2020, it \n", "accounted for 9.5% of the total global arms imports.[285] Much of the military expenditure was focused on defence \n", "against Pakistan and countering growing Chinese influence in the Indian Ocean.[286]\\n\\nEconomy\\n-------\\n\\nMain \n", "article: Economy of India\\n\\n\\n\\nIn 2019, 43% of India\\'s total workforce was employed in \n", "agriculture.[287]\\n\\n\\n\\nIndia is the world\\'s largest producer of milk, with the largest population of cattle. In \n", "2018, nearly 80% of India\\'s milk was sourced from small farms with herd size between one and two, the milk \n", "harvested by hand milking.[289]\\n\\n\\n\\n55% of India\\'s female workforce was employed in agriculture in \n", "2019.[288]\\n\\nAccording to the International Monetary Fund (IMF), the Indian economy in 2024 was nominally worth \n", "$3.94\\xa0trillion; it was the fifth-largest economy by market exchange rates and is, at around $15.0\\xa0trillion, \n", "the third-largest by purchasing power parity (PPP).[16] With its average annual GDP growth rate of 5.8% over the \n", "past two decades, and reaching 6.1% during 2011â\\x80\\x932012,[290] India is one of the world\\'s fastest-growing \n", "economies.[291] However, due to its low GDP per capitaâ\\x80\\x94which ranks 136th in the world in nominal per capita\n", "income and 125th in per capita income adjusted for purchasing power parity (PPP)â\\x80\\x94the vast majority of \n", "Indians fall into the low-income group.[292][293] Until 1991, all Indian governments followed protectionist \n", "policies that were influenced by socialist economics. Widespread state intervention and regulation largely walled \n", "the economy off from the outside world. An acute balance of payments crisis in 1991 forced the nation to liberalise\n", "its economy;[294] since then, it has moved increasingly towards a free-market system[295][296] by emphasising both \n", "foreign trade and direct investment inflows.[297] India has been a member of World Trade Organization since 1 \n", "January 1995.[298]\\n\\nThe 522-million-worker Indian labour force is the world\\'s second largest, as of \n", "2017[update].[281] The service sector makes up 55.6% of GDP, the industrial sector 26.3% and the agricultural \n", "sector 18.1%. India\\'s foreign exchange remittances of US$100 billion in 2022,[299] highest in the world, were \n", "contributed to its economy by 32 million Indians working in foreign countries.[300] In 2006, the share of external \n", "trade in India\\'s GDP stood at 24%, up from 6% in 1985.[295] In 2008, India\\'s share of world trade was 1.7%;[301] \n", "In 2021, India was the world\\'s ninth-largest importer and the sixteenth-largest exporter.[302] Between 2001 and \n", "2011, the contribution of petrochemical and engineering goods to total exports grew from 14% to 42%.[303] India was\n", "the world\\'s second-largest textile exporter after China in the 2013 calendar year.[304]\\n\\nAveraging an economic \n", "growth rate of 7.5% for several years before 2007,[295] India has more than doubled its hourly wage rates during \n", "the first decade of the 21st century.[305] Some 431 million Indians have left poverty since 1985; India\\'s middle \n", "classes are projected to number around 580\\xa0million by 2030.[306] In 2023, India\\'s consumer market was the \n", "world\\'s fifth largest.[307] India\\'s nominal GDP per capita increased steadily from US$308 in 1991, when economic \n", "liberalisation began, to US$1,380 in 2010, to an estimated US$2,731 in 2024. It is expected to grow to US$3,264 by \n", "2026.[16]\\n\\n### Industries\\n\\n\\n\\nA tea garden in Sikkim. India, the world\\'s second-largest producer of tea, is a\n", "nation of one billion tea drinkers, who consume 70% of India\\'s tea output.\\n\\nThe Indian automotive industry, the \n", "world\\'s second-fastest growing, increased domestic sales by 26% during 2009â\\x80\\x932010,[308] and exports by 36% \n", "during 2008â\\x80\\x932009.[309] In 2022, India became the world\\'s third-largest vehicle market after China and the \n", "United States, surpassing Japan.[310] At the end of 2011, the Indian IT industry employed 2.8\\xa0million \n", "professionals, generated revenues close to US$100\\xa0billion equalling 7.5% of Indian GDP, and contributed 26% of \n", "India\\'s merchandise exports.[311]\\n\\nThe pharmaceutical industry in India includes 3,000 pharmaceutical companies \n", "and 10,500 manufacturing units; India is the world\\'s third-largest pharmaceutical producer, largest producer of \n", "generic medicines and supply up to 50â\\x80\\x9360% of global vaccines demand, these all contribute up to \n", "US$24.44\\xa0billions in exports and India\\'s local pharmaceutical market is estimated up to \n", "US$42\\xa0billion.[312][313] India is among the top 12 biotech destinations in the world.[314][315] The Indian \n", "biotech industry grew by 15.1% in 2012â\\x80\\x932013, increasing its revenues from â\\x82¹204.4\\xa0billion (Indian \n", "rupees) to â\\x82¹235.24\\xa0billion (US$3.94\\xa0billion at June 2013 exchange rates).[316]\\n\\n### Energy\\n\\nMain \n", "article: Energy in India\\n\\nSee also: Energy policy of India\\n\\nIndia\\'s capacity to generate electrical power is \n", "300 gigawatts, of which 42 gigawatts is renewable.[317] The country\\'s usage of coal is a major cause of India\\'s \n", "greenhouse gas emissions, but its renewable energy is competing \\xa0source\\xa0needed*] India emits about 7% of \n", "global greenhouse gas emissions. This equates to about 2.5 tons of carbon dioxide per person per year, which is \n", "half the world average.[319][320] Increasing access to electricity and clean cooking with liquefied petroleum gas \n", "have been priorities for energy in India.[321]\\n\\n### Socio-economic challenges\\n\\nMain articles: Poverty in India,\n", "Income inequality in India, and Debt bondage in India\\n\\n\\n\\nHealth workers about to begin another day of \n", "immunisation against infectious diseases in 2006. Eight years later, and three years after India\\'s last case of \n", "polio, the World Health Organization declared India to be polio-free.[322]\\n\\nDespite economic growth during recent\n", "decades, India continues to face socio-economic challenges. In 2006, India contained the largest number of people \n", "living below the World Bank\\'s international poverty line of US$1.25 per day.[323] The proportion decreased from \n", "60% in 1981 to 42% in 2005.[324] Under the World Bank\\'s later revised poverty line, it was 21%-22.5 in \n", "2011.[p][326][327] In 2019, the estimates had gone down to 10.2%.[327] In 2014, 30.7% of India\\'s children under \n", "the age of five were underweight.[328] According to a Food and Agriculture Organization report in 2015, 15% of the \n", "population was The Midday Meal Scheme attempts to lower these rates.[331]\\n\\nA 2018 Walk Free Foundation report \n", "estimated that nearly 8\\xa0million people in India were living in different forms of modern slavery, such as bonded\n", "labour, child labour, human trafficking, and forced begging.[332] According to the 2011 census, there were \n", "10.1\\xa0million child labourers in the country, a decline of 2.6\\xa0million from 12.6\\xa0million in \n", "2001.[333]\\n\\nSince 1991, economic inequality between India\\'s states has consistently grown: the per-capita net \n", "state domestic product of the richest states in 2007 was 3.2 times that of the poorest.[334] Corruption in India is\n", "perceived to have decreased. According to the Corruption Perceptions Index, India ranked 78th out of 180 countries \n", "in 2018, an improvement from 85th in 2014.[335][336]\\n\\nAs of 2025, poverty in India declined sharply. According to\n", "the World Bank report, extreme poverty fall from 16.2% in 2011-12 to 2.3% in 2022-23. In rural areas it fell from \n", "18.4% to 2.8%, and in urban areas, from 10.7% to 1.1%. 378 million peopole were lifted from poverty and 171 million\n", "from extreme poverty. The main reason, according to the World Bank, is not economic growth but different government\n", "welfare programs, like transferring food and money to the people with low income, improving their access to \n", "services.[172]\\n\\nDemographics, languages, and religion\\n\\n\\nMain articles: Demographics of India, Languages of \n", "India, and Religion in India\\n\\nSee also: South Asian ethnic groups\\n\\n\\n\\nA Sikh pilgrim at the Harmandir Sahib, \n", "or Golden Temple, in Amritsar, Punjab\\n\\n\\n\\nThe interior of San Thome Basilica, Chennai, Tamil Nadu. Christianity \n", "is believed to have been introduced to India by the late 2nd century by Syriac-speaking Christians.\\n\\nWith an \n", "estimated 1,428,627,663 residents in 2023, India is the world\\'s most populous country.[13] 1,210,193,422 residents\n", "were reported in the 2011 provisional census report.[337] Its population grew by 17.64% from 2001 to 2011,[338] \n", "compared to 21.54% growth in the previous decade (1991â\\x80\\x932001).[338] The human sex ratio, according to the \n", "2011 census, is 940 females per 1,000 males.[337] The median age was 28.7 in 2020.[281] The first post-colonial \n", "census, conducted in 1951, counted 361\\xa0million people.[339] Medical advances made in the last 50 years as well \n", "as increased agricultural productivity brought about by the \"Green Revolution\" have caused India\\'s population to \n", "grow rapidly.[340]\\n\\nThe life expectancy in India is at 70 yearsâ\\x80\\x9471.5 years for women, 68.7 years for \n", "men.[281] There are around 93 physicians per 100,000 people.[341] Migration from rural to urban areas has been an \n", "important dynamic in India\\'s recent history. The number of people living in urban areas grew by 31.2% between 1991\n", "and 2001.[342] Yet, in 2001, over 70% still lived in rural areas.[343][344] The level of urbanisation increased \n", "further from 27.81% in the 2001 Census to 31.16% in the 2011 Census. The slowing down of the overall population \n", "growth rate was due to the sharp decline in the growth rate in rural areas since 1991.[345] According to the 2011 \n", "census, there are 53 million-plus urban agglomerations in India; among them Mumbai, Delhi, Kolkata, Chennai, \n", "Bengaluru, Hyderabad and Ahmedabad, in decreasing order by population.[346] The literacy rate in 2011 was 74.04%: \n", "65.46% among females and 82.14% among males.[347] The rural-urban literacy gap, which was 21.2 percentage points in\n", "2001, dropped to 16.1 percentage points in 2011. The improvement in the rural literacy rate is twice that of urban \n", "areas.[345] Kerala is the most literate state with 93.91% literacy; while Bihar the least with \n", "63.82%.[347]\\n\\nAmong speakers of the Indian languages, 74% speak Indo-Aryan languages, the easternmost branch of \n", "the Indo-European languages; 24% speak Dravidian languages, indigenous to South Asia and spoken widely before the \n", "spread of Indo-Aryan languages and 2% speak Austroasiatic languages or the Sino-Tibetan languages. India has no \n", "national language.[348] Hindi, with the largest number of speakers, is the official language of the English is \n", "used extensively in business and administration and has the status of a \"subsidiary official language\";[6] it is \n", "important in education, especially as a medium of higher education. Each state and union territory has one or more \n", "official languages, and the constitution recognises in particular 22 \"scheduled languages\".\\n\\nThe 2011 census \n", "reported the religion in India with the largest number of followers was Hinduism (79.80% of the population), \n", "followed by Islam (14.23%); the remaining were Christianity (2.30%), Sikhism (1.72%), Buddhism (0.70%), Jainism \n", "(0.36%) and others[q] (0.9%).[11] India has the third-largest Muslim populationâ\\x80\\x94the largest for a \n", "non-Muslim majority country.[351][352]\\n\\nCulture\\n-------\\n\\nMain article: Culture of India\\n\\n### Visual \n", "art\\n\\nMain article: Indian art\\n\\nIndia has a very ancient tradition of art, which has exchanged many influences \n", "with the rest of Eurasia, especially in the first millennium, when Buddhist art spread with Indian religions to \n", "Central, East and Southeast Asia, the last also greatly influenced by Hindu art.[353] Thousands of seals from the \n", "Indus Valley Civilization of the third millennium BCE have been found, usually carved with animals, but also some \n", "with human figures. The Pashupati seal, excavated in Mohenjo-daro, Pakistan, in 1928â\\x80\\x9329, is the best \n", "known.[354][355] After this there is a long period with virtually nothing surviving.[355][356] Almost all surviving\n", "ancient Indian art thereafter is in various forms of religious sculpture in durable materials, or coins. There was \n", "probably originally far more in wood, which is lost. In north India Mauryan art is the first imperial In the first\n", "millennium CE, Buddhist art spread with Indian religions to Central, East and Southeast Asia, the last also greatly\n", "influenced by Hindu art.[360] Over the following centuries a distinctly Indian style of sculpting the human figure \n", "developed, with less interest in articulating precise anatomy than ancient Greek sculpture but showing smoothly \n", "flowing forms expressing *prana* (\"breath\" or This is often complicated by the need to give figures multiple arms \n", "or heads, or represent different genders on the left and right of figures, as with the Ardhanarishvara form of \n", "Shiva and Parvati.[363][364]\\n\\nMost of the earliest large sculpture is Buddhist, either excavated from Buddhist \n", "stupas such as Sanchi, Sarnath and Amaravati,[365] or is rock cut reliefs at sites such as Ajanta, Karla and \n", "Ellora. Hindu and Jain sites appear rather later.[366][367] In spite of this complex mixture of religious \n", "traditions, generally, the prevailing artistic style at any time and place has been shared by the major religious \n", "groups, and sculptors probably usually served all communities.[368] Gupta art, at its peak \n", "c.â\\x80\\x89300\\xa0CE\\xa0â\\x80\\x93 c.â\\x80\\x89500\\xa0CE, is often regarded as a classical period whose influence \n", "lingered for many centuries after; it saw a new dominance of Hindu sculpture, as at the Elephanta Caves.[369][370] \n", "Across the north, this became rather stiff and formulaic after c.â\\x80\\x89800\\xa0CE, though rich with finely carved\n", "detail in the surrounds of statues.[371] But in the South, under the Pallava and Chola dynasties, sculpture in both\n", "stone and bronze had a sustained period of great achievement; the large bronzes with Shiva as Nataraja have become \n", "an iconic symbol of India.[372][373]\\n\\nAncient paintings have only survived at a few sites, of which the crowded \n", "scenes of court life in the Ajanta Caves are some of the most important.[374][375] Painted manuscripts of religious\n", "texts survive from Eastern India from 10th century onwards, most of the earliest being Buddhist and later Jain. \n", "These significantly influenced later artistic styles.[376] The Persian-derived Deccan painting, starting just \n", "before the Mughal miniature, between them give the first large body of secular painting, with an emphasis on \n", "portraits, and the recording of princely pleasures and wars.[377][378] The style spread to Hindu courts, especially\n", "among the Rajputs, and developed a variety of styles, with the smaller courts often the most innovative, with \n", "figures such as Nihâl Chand and Nainsukh.[379][380] As a market developed among European residents, it was \n", "supplied by Company painting by Indian artists with considerable Western influence.[381][382] In the 19th century, \n", "cheap Kalighat paintings of gods and everyday life, done on paper, were urban folk art from Calcutta, which later \n", "saw the Bengal School of Art, reflecting the art colleges founded by the British, the first movement in modern \n", "Indian Society\\n\\nMain articles: Caste system in India and Gender inequality in India\\n\\n\\n\\nMuslims offer *namaz*\n", "at a mosque in Srinagar, Jammu and Kashmir.\\n\\nThe Indian caste system embodies much of the social stratification \n", "and many of the social restrictions found on the Indian subcontinent. Social classes are defined by thousands of \n", "endogamous hereditary groups, often termed as *jÄ\\x81tis*, or \"castes\".[385] India abolished untouchability in 1950\n", "with the adoption of the constitution and has since enacted other anti-discriminatory laws and social welfare \n", "initiatives.[r] However, the system continues to be dominant in India, and caste-based inequality, discrimination, \n", "segregation, and violence persist.[387][388]\\n\\nMulti-generational patrilineal joint families have been the norm in\n", "India, though nuclear families are becoming common in urban areas.[389] An overwhelming majority of Indians have \n", "their marriages arranged by their parents or other family elders.[390] Marriage is thought to be for life,[390] and\n", "the divorce rate is extremely low,[391] with less than one in a thousand marriages ending in divorce.[392] Child \n", "marriages are common, especially in rural areas; many women wed before reaching 18, which is their legal \n", "marriageable age.[393] Female infanticide in India, and lately female foeticide, have created skewed gender ratios;\n", "the number of missing women in the country quadrupled from 15 million to 63\\xa0million in the 50 years ending in \n", "2014, faster than the population growth during the same period.[394] According to an Indian government study, an \n", "additional 21 million girls are unwanted and do not receive adequate care.[395] Despite a government ban on \n", "sex-selective foeticide, the practice remains commonplace in India, the result of a preference for boys in a \n", "patriarchal society.[396] The payment of dowry, although illegal, remains widespread across class lines.[397] \n", "Deaths resulting from dowry, mostly from bride burning, are on the rise, despite stringent anti-dowry \n", "laws.[398]\\n\\n### Education\\n\\nMain article: Education in India\\n\\nSee also: Literacy in India and History of \n", "education in the Indian subcontinent\\n\\n\\n\\nChildren awaiting school lunch in Rayka (also Raika), a village in \n", "rural Gujarat. The salutation *Jai Bhim* written on the blackboard honours the jurist, social reformer, and Dalit \n", "leader B. R. Ambedkar.\\n\\nIn the 2011 census, about 73% of the population was literate, with 81% for men and 65% \n", "for women. This compares to 1981 when the respective rates were 41%, 53% and 29%. In 1951 the rates were 18%, 27% \n", "and 9%. In 1921 the rates 7%, 12% and 2%. In 1891 they were 5%, 9% and 1%,[399][400] According to Latika Chaudhary,\n", "in 1911 there were under three primary schools for every ten villages. Statistically, more caste and religious \n", "diversity reduced private spending. Primary schools taught literacy, so local diversity limited its \n", "growth.[401]\\n\\nThe education system of India is the world\\'s second-largest.[402] India has over 900 universities,\n", "40,000 colleges[403] and 1.5\\xa0million schools.[404] In India\\'s higher education system, a significant number of \n", "seats are reserved under affirmative action policies for the historically disadvantaged. In recent decades India\\'s\n", "improved education system is often cited as one of the main contributors to its economic \\n\\n### Clothing\\n\\nMain \n", "article: Clothing in India\\n\\n\\n\\nWomen in sari at an adult literacy class in Tamil Nadu\\n\\n\\n\\nWomen (from left to\n", "right) in churidars and kameez (with back to the camera), jeans and sweater, and pink shalwar kameez\\n\\nFrom \n", "ancient times until the advent of the modern, the most widely worn traditional dress in India was draped.[407] For \n", "women it took the form of a sari, a single piece of cloth many yards long.[407] The sari was traditionally wrapped \n", "around the lower body and the shoulder.[407] In its modern form, it is combined with an underskirt, or Indian \n", "petticoat, and tucked in the waist band for more secure fastening. It is also commonly worn with an Indian blouse, \n", "or choli, which serves as the primary upper-body garment, the sari\\'s endâ\\x80\\x94passing over the \n", "shoulderâ\\x80\\x94covering the midriff and obscuring the upper body\\'s contours.[407] For men, a similar but shorter\n", "length of cloth, the dhoti, has served as a lower-body garment.[408]\\n\\nThe use of stitched clothes became \n", "widespread after Muslim rule was established at first by the Delhi sultanate (c.â\\x80\\x891300 CE) and then \n", "continued by the Mughal Empire (c.â\\x80\\x891525 CE).[409] Among the garments introduced during this time and still \n", "commonly worn are: the shalwars and pyjamas, both styles of trousers, and the tunics kurta and kameez.[409] In \n", "southern India, the traditional draped garments were to see much longer continuous use.[409]\\n\\nSalwars are \n", "atypically wide at the waist but narrow to a cuffed bottom. They are held up by a drawstring, which causes them to \n", "become pleated around the waist.[410] The pants can be wide and baggy, or they can be cut quite narrow, on the \n", "bias, in which case they are called churidars. When they are ordinarily wide at the waist and their bottoms are \n", "hemmed but not cuffed, they are called pyjamas. The kameez is a long shirt or tunic,[411] its side seams left open \n", "below the waistline.[412] The kurta is traditionally collarless and made of cotton or silk; it is worn plain or \n", "with embroidered decoration, such as chikan; and typically falls to either just above or just below the wearer\\'s \n", "knees.[413]\\n\\nIn the last 50 years, fashions have changed a great deal in India. Increasingly, in urban northern \n", "India, the sari is no longer the apparel of everyday wear, though they remain popular on formal occasions.[414] The\n", "traditional shalwar kameez is rarely worn by younger urban women, who favour churidars or jeans.[414] In office \n", "settings, ubiquitous air conditioning allows men to wear sports jackets year-round.[414] For weddings and formal \n", "occasions, men in the middle and upper classes often wear bandgala, or short Nehru jackets, with pants, with the \n", "groom and his groomsmen sporting sherwanis and churidars.[414] The dhoti, once the universal garment of Hindu \n", "males, the wearing of which in the homespun and handwoven khadi allowed Gandhi to bring Indian nationalism to the \n", "millions,[415]\\nis seldom seen in the cities.[414]\\n\\n### Cuisine\\n\\nMain article: Indian cuisine\\n\\n\\n\\nSouth \n", "Indian vegetarian thali, or platter\\n\\nThe foundation of a typical Indian meal is a cereal cooked plainly and \n", "complemented with flavourful savoury dishes.[416] The cooked cereal could be steamed rice; chapati, a thin \n", "unleavened bread;[417] the idli, a steamed breakfast cake; or dosa, a griddled pancake.[418] The savoury dishes \n", "might include lentils, pulses and vegetables commonly spiced with ginger and garlic, but also with a combination of\n", "spices that may include coriander, cumin, turmeric, cinnamon, cardamon and others.[416] They might also include \n", "poultry, fish, or meat dishes. In some instances, the ingredients may be mixed during the cooking \n", "process.[419]\\n\\nA platter, or thali, used for eating usually has a central place reserved for the cooked cereal, \n", "and peripheral ones for the flavourful accompaniments. The cereal and its accompaniments are eaten simultaneously \n", "rather than a piecemeal manner. This is accomplished by mixingâ\\x80\\x94for example of rice and lentilsâ\\x80\\x94or \n", "folding, wrapping, scooping or dippingâ\\x80\\x94such as chapati and cooked vegetables.[416]\\n\\n\\n\\nA tandoor chef in\n", "the Turkman Gate, Old Delhi, makes Khameeri roti (a Muslim-influenced style of leavened bread).[420]\\n\\nIndia has \n", "distinctive vegetarian cuisines, each a feature of the geographical and cultural histories of its adherents.[421] \n", "About 20% to 39% of India\\'s population consists of Much of this stems from caste hierarchy, as upper castes, such\n", "as the Brahmins, consider vegetarian food to be \"pure\".[424][425] Although meat is eaten widely in India, the \n", "proportional consumption of meat in the overall diet is low.[426] Unlike China, which has increased its per capita \n", "meat consumption substantially in its years of increased economic growth, in India the strong dietary traditions \n", "have contributed to dairy, rather than meat, becoming the preferred form of animal protein consumption.[427]\\n\\nThe\n", "most significant import of cooking techniques into India during the last millennium occurred during the Mughal \n", "Empire. Dishes such as the pilaf,[428] developed in the Abbasid caliphate,[429] and cooking techniques such as the \n", "marinating of meat in yogurt, spread into northern India from regions to its northwest.[430] To the simple yogurt \n", "marinade of Persia, onions, garlic, almonds, and spices began to be added in India.[430] Rice was partially cooked \n", "and layered alternately with the sauteed meat, the pot sealed tightly, and slow cooked according to another Persian\n", "cooking technique, to produce what has today become biryani,[430] a feature of festive dining in many parts of \n", "India.[431] In the food served in Indian restaurants worldwide, the diversity of Indian food has been partially \n", "concealed by the dominance of Punjabi cuisine. The popularity of tandoori chickenâ\\x80\\x94cooked in the tandoor \n", "oven, which had traditionally been used for baking bread in the rural Punjab and the Delhi region, especially among\n", "Muslims, but which is originally from Central Asiaâ\\x80\\x94dates to the 1950s, and was caused in large part by an \n", "entrepreneurial response among people from the Punjab who had been displaced by the 1947 partition.[421]\\n\\n### \n", "Sports and recreation\\n\\nMain article: Sport in India\\n\\nSee also: Indian physical culture\\n\\n\\n\\nGirls play \n", "hopscotch in Jaora, Madhya Pradesh. Hopscotch has been commonly played by girls in rural India.[432]\\n\\nSeveral \n", "traditional sportsâ\\x80\\x94such as *kabaddi*, *kho kho*, pehlwani, *gilli-danda,* hopscotch and martial arts such \n", "as *Kalarippayattu* and *marma adiâ\\x80\\x94*remain popular. Chess is commonly held to have originated in India as \n", "*chaturaá¹\\x85ga*;[433] in recent years, there has been a rise in the number of Indian grandmasters,[434] and world\n", "champions.[435] Parcheesi is derived from *Pachisi*, another traditional Indian pastime, which in early modern \n", "times was played on a giant marble court by Mughal emperor Akbar the Great.[436]\\n\\nCricket is the most popular \n", "sport in India.[437] India has won two Cricket World Cups, the 1983 edition and the 2011 edition. India has won \n", "eight field hockey gold medals in the summer Olympics.[438]\\n\\nSee \n", "also\\n--------Notes\\n-----\\n\\nReferences\\n----------\\n\\nBibliography\\n------------\\n\\n### Overview\\n\\n### \n", "Etymology\\n\\n### History\\n\\n### Geography\\n\\n### Biodiversity\\n\\n### Politics\\n\\n### Foreign relations and \n", "military\\n\\n### Economy\\n\\n### Demographics\\n\\n### Art\\n\\n### Culture\\n\\nExternal \n", "links\\n--------------\\n\\n**India** at Wikipedia\\'s sister projects\\n\\n information**| India topics | |\\n| --- | ---\n", "|\\n| | History | | | --- | --- | | | | | | --- | --- | | Overviews | | | Ancient | | | Middle Kingdoms | | | \n", "Middle Ages | | | Early Modern | | | Late modern | | | Republic | | | Contemporary | | | | | |\\n| | Geography \n", "| | | --- | --- | | | | | | --- | --- | | Geology | | | Heritage | | | Environment | | | Landforms | | | \n", "Regions | | | Subdivisions | | | See also | | | | | |\\n| | Politics | | | --- | --- | | | | | | --- | --- | | \n", "Government | | | Law | | | | | --- | --- | | | | | Enforcement | | | | | --- | --- | | Federal | | | \n", "Intelligence | | | | | Military | | | Politics | | | | | |\\n| | Economy | | | --- | --- | | | | | | --- | --- \n", "| | Companies | | | Governance | | | Currency | | | Financial services | | | History | | | People | | | \n", "States | | | Sectors | | | Regulator | | | Other | | | | | |\\n| | | | | --- | --- | | | | | | --- | --- | | \n", "Society | | | Culture | | | | | |\\n\\n| Related topics | |\\n| --- | --- |\\n| | States and union territories of \n", "India | | | --- | --- | | States | | | Union territories | | | | | | South Asian topics | | | --- | --- | | \n", "Countries and regions | | | Ethnic groups | | | Culture | | | Environment | | | Economy and Politics | | | \n", "History | | | Religion | | | Sports | | | Education | | | Military | | | Science and technology | | | \n", "Members of the Commonwealth of Nations | | | --- | --- | | Sovereign states (members) | | | Associated states | |\n", "| Dependent territories | | | | | --- | --- | | Australia | | | New Zealand | | | United Kingdom | | | | \n", "Source: Commonwealth Secretariat â\\x80\\x93 Member Countries | | | South Asian Association for Regional \n", "Cooperation (SAARC) | | | --- | --- | | Agreements | South Asian Free Trade Area | | Summits | | | Members | | | \n", "Observers | | | Guests | | | Specialised agencies | | | Related Articles | | | Group of Eight (G8) and Group\n", "of Eight + Five (G8+5) | | | --- | --- | | G8 members | | | Representative | | | G8+5 | | | See also | | | \n", "G20 major economies | | | --- | --- | | | | | BRICS | | | --- | --- | | Membership | | | Summits | | | \n", "Leaders | | | Sports | | | Related | | | East Asia Summit (EAS) | | | --- | --- | | | | | | | | Shanghai\n", "Cooperation Organisation (SCO) | | | --- | --- | | Summits | | | Member states | | | Observer states | | | \n", "Dialogue partners | | | Guests | | | Applicants | | | See also | | | Countries and dependencies of Asia | | \n", "| --- | --- | | Sovereign states | | | States with limited recognition | | | Dependent territories | | | | | \n", "--- | --- | | Australia | | | Greece | | | United Kingdom | | | | Special administrative regions of China | | |\n", "| | | |\\n\\nPortals:\\n\\n| Authority control databases Edit this at Wikidata | |\\n| --- | --- |\\n| International | \n", "|\\n| National | |\\n| Geographic | |\\n| Academics | |\\n| Artists | |\\n| People | |\\n| Other | |\\n\\n21°N \n", "78°E / 21°N 78°E / 21; 78\\n\\n\\n\\nRetrieved from \\n\\nCategories:\\n\\nHidden \n", "categories:\\n\\nSearch\\n\\nSearch\\n\\nIndia\\n\\n305 languages\\n\\nAdd topic'\n", ")\n", "\n" ], "text/plain": [ "\u001b[1;35mDocument\u001b[0m\u001b[1m(\u001b[0m\n", " \u001b[33mmetadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'source'\u001b[0m: \u001b[32m'https://en.wikipedia.org/wiki/India'\u001b[0m\u001b[1m}\u001b[0m,\n", " \u001b[33mpage_content\u001b[0m=\u001b[32m'India - Wikipedia\\n\\nJump to content\\n\\nCoordinates: 21°N 78°E\\ufeff / \\ufeff21°N 78°E\\ufeff \u001b[0m\n", "\u001b[32m/ 21; 78\\n\\n!\u001b[0m\u001b[32m[\u001b[0m\u001b[32mFeatured \\n\\n!\u001b[0m\u001b[32m[\u001b[0m\u001b[32mExtended-protected \\n\\nFrom Wikipedia, the free encyclopedia\\n\\nCountry in South \u001b[0m\n", "\u001b[32mAsia\\n\\nThis article is about the country. For other uses, see India \u001b[0m\u001b[32m(\u001b[0m\u001b[32mdisambiguation\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\\n\\n| Republic of India \u001b[0m\n", "\u001b[32m*BhÄ\\x81rat Gaá¹\\x87arÄ\\x81jya* | |\\n| --- | --- |\\n| Horizontal tricolour flag bearing, from top to bottom, deep \u001b[0m\n", "\u001b[32msaffron, white, and green horizontal bands. In the centre of the white band is a navy-blue wheel with 24 spokes. \u001b[0m\n", "\u001b[32mFlag State emblem | |\\n| **Motto:**Satyameva Jayate\\xa0\u001b[0m\u001b[32m(\u001b[0m\u001b[32mSanskrit\u001b[0m\u001b[32m)\u001b[0m\u001b[32m \"Truth Alone Triumphs\"\u001b[0m\u001b[32m[\u001b[0m\u001b[32m1\u001b[0m\u001b[32m]\u001b[0m\u001b[32m | |\\n| \u001b[0m\n", "\u001b[32m**Anthem:**\\xa0Jana Gana Mana\\xa0\u001b[0m\u001b[32m(\u001b[0m\u001b[32mHindi\u001b[0m\u001b[32m)\u001b[0m\u001b[32m[\u001b[0m\u001b[32ma\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m2\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m3\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \"Thou Art the Ruler of the Minds of All People\"\u001b[0m\u001b[32m[\u001b[0m\u001b[32m4\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m2\u001b[0m\u001b[32m]\u001b[0m\u001b[32m | |\\n| \u001b[0m\n", "\u001b[32m**National song: Vande Mataram\\xa0\u001b[0m\u001b[32m(\u001b[0m\u001b[32mSanskrit\u001b[0m\u001b[32m)\u001b[0m\u001b[32m[\u001b[0m\u001b[32mc\u001b[0m\u001b[32m]\u001b[0m\u001b[32m** \"I Bow to Thee, Mother\"\u001b[0m\u001b[32m[\u001b[0m\u001b[32mb\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m1\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m2\u001b[0m\u001b[32m]\u001b[0m\u001b[32m | |\\n| Image of a globe centred \u001b[0m\n", "\u001b[32mon India, with India highlighted. Territory controlled by India Territory claimed but not controlled | |\\n| \u001b[0m\n", "\u001b[32mCapital | New Delhi 28°36â\\x80²50â\\x80³N 77°12â\\x80²30â\\x80³E / 28.61389°N 77.20833°E / 28.61389; \u001b[0m\n", "\u001b[32m77.20833 |\\n| Largest city by city proper population | Mumbai |\\n| Largest city by metropolitan area population | \u001b[0m\n", "\u001b[32mDelhi |\\n| Official\\xa0languages | |\\n| Recognised regional\\xa0languages | State level and Eighth Schedule\u001b[0m\u001b[32m[\u001b[0m\u001b[32m9\u001b[0m\u001b[32m]\u001b[0m\u001b[32m |\\n|\u001b[0m\n", "\u001b[32mNative languages | 424 languages\u001b[0m\u001b[32m[\u001b[0m\u001b[32mg\u001b[0m\u001b[32m]\u001b[0m\u001b[32m |\\n| Religion \u001b[0m\u001b[32m(\u001b[0m\u001b[32m2011\u001b[0m\u001b[32m)\u001b[0m\u001b[32m[\u001b[0m\u001b[32m11\u001b[0m\u001b[32m]\u001b[0m\u001b[32m | |\\n| Demonym\u001b[0m\u001b[32m(\u001b[0m\u001b[32ms\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | |\\n| Government | Federal \u001b[0m\n", "\u001b[32mparliamentary republic |\\n| | |\\n| â\\x80¢\\xa0President | Droupadi Murmu |\\n| â\\x80¢\\xa0Prime Minister | Narendra \u001b[0m\n", "\u001b[32mModi |\\n| | |\\n| Legislature | Parliament |\\n| â\\x80¢\\xa0Upper house | Rajya Sabha |\\n| â\\x80¢\\xa0Lower house | \u001b[0m\n", "\u001b[32mLok Sabha |\\n| Independence from the United Kingdom | |\\n| | |\\n| â\\x80¢\\xa0Dominion | 15 August 1947 |\\n| \u001b[0m\n", "\u001b[32mâ\\x80¢\\xa0Republic | 26 January 1950 |\\n| | |\\n| Area | |\\n| â\\x80¢\\xa0Total | 3,287,263\\xa0km2 \u001b[0m\n", "\u001b[32m(\u001b[0m\u001b[32m1,269,219\\xa0sq\\xa0mi\u001b[0m\u001b[32m)\u001b[0m\u001b[32m[\u001b[0m\u001b[32m2\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32mh\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\u001b[32m(\u001b[0m\u001b[32m7th\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| â\\x80¢\\xa0Water\\xa0\u001b[0m\u001b[32m(\u001b[0m\u001b[32m%\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | 9.6 |\\n| Population | |\\n| â\\x80¢\\xa02023 \u001b[0m\n", "\u001b[32mestimate | Neutral increase 1,428,627,663\u001b[0m\u001b[32m[\u001b[0m\u001b[32m13\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\u001b[32m(\u001b[0m\u001b[32m1st\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| â\\x80¢\\xa02011\\xa0census | Neutral increase \u001b[0m\u001b[32m(\u001b[0m\u001b[32m2nd\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| \u001b[0m\n", "\u001b[32mâ\\x80¢\\xa0Density | 430.5/km2 \u001b[0m\u001b[32m(\u001b[0m\u001b[32m1,115.0/sq\\xa0mi\u001b[0m\u001b[32m)\u001b[0m\u001b[32m \u001b[0m\u001b[32m(\u001b[0m\u001b[32m30th\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| GDP\\xa0\u001b[0m\u001b[32m(\u001b[0m\u001b[32mPPP\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | 2025\\xa0estimate |\\n| â\\x80¢\\xa0Total |\u001b[0m\n", "\u001b[32mIncrease $17.647 trillion\u001b[0m\u001b[32m[\u001b[0m\u001b[32m16\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\u001b[32m(\u001b[0m\u001b[32m3rd\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| â\\x80¢\\xa0Per capita | Increase $12,132\u001b[0m\u001b[32m[\u001b[0m\u001b[32m16\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\u001b[32m(\u001b[0m\u001b[32m119th\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| GDP\\xa0\u001b[0m\u001b[32m(\u001b[0m\u001b[32mnominal\u001b[0m\u001b[32m)\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32m| 2025\\xa0estimate |\\n| â\\x80¢\\xa0Total | Increase $4.187 trillion\u001b[0m\u001b[32m[\u001b[0m\u001b[32m16\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\u001b[32m(\u001b[0m\u001b[32m4th\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| â\\x80¢\\xa0Per capita | Increase \u001b[0m\n", "\u001b[32m$2,878\u001b[0m\u001b[32m[\u001b[0m\u001b[32m16\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\u001b[32m(\u001b[0m\u001b[32m136th\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| Gini\\xa0\u001b[0m\u001b[32m(\u001b[0m\u001b[32m2021\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | Positive decrease\\xa025.5\u001b[0m\u001b[32m[\u001b[0m\u001b[32m17\u001b[0m\u001b[32m]\u001b[0m\u001b[32m low inequality |\\n| HDI\\xa0\u001b[0m\u001b[32m(\u001b[0m\u001b[32m2023\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | \u001b[0m\n", "\u001b[32mIncrease\\xa00.685\u001b[0m\u001b[32m[\u001b[0m\u001b[32m18\u001b[0m\u001b[32m]\u001b[0m\u001b[32m medium\\xa0\u001b[0m\u001b[32m(\u001b[0m\u001b[32m130th\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| Currency | Indian rupee \u001b[0m\u001b[32m(\u001b[0m\u001b[32mâ\\x82¹\u001b[0m\u001b[32m)\u001b[0m\u001b[32m \u001b[0m\u001b[32m(\u001b[0m\u001b[32mINR\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| Time zone | UTC+05:30 \u001b[0m\n", "\u001b[32m(\u001b[0m\u001b[32mIST\u001b[0m\u001b[32m)\u001b[0m\u001b[32m |\\n| Date format | |\\n| Calling code | +91 |\\n| ISO 3166 code | IN |\\n| Internet TLD | .in \u001b[0m\u001b[32m(\u001b[0m\u001b[32mothers\u001b[0m\u001b[32m)\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32m|\\n\\n**India**, officially the **Republic of India**,\u001b[0m\u001b[32m[\u001b[0m\u001b[32mj\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m20\u001b[0m\u001b[32m]\u001b[0m\u001b[32m is a country in South Asia. It is the seventh-largest \u001b[0m\n", "\u001b[32mcountry by area; the most populous country since 2023;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m21\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and, since its independence in 1947, the world\\'s most \u001b[0m\n", "\u001b[32mpopulous Bounded by the Indian Ocean on the south, the Arabian Sea on the southwest, and the Bay of Bengal on the \u001b[0m\n", "\u001b[32msoutheast, it shares land borders with Pakistan to the west;\u001b[0m\u001b[32m[\u001b[0m\u001b[32mk\u001b[0m\u001b[32m]\u001b[0m\u001b[32m China, Nepal, and Bhutan to the north; and \u001b[0m\n", "\u001b[32mBangladesh and Myanmar to the east. In the Indian Ocean, India is near Sri Lanka and the Maldives; its Andaman and \u001b[0m\n", "\u001b[32mNicobar Islands share a maritime border with Thailand, Myanmar, and Indonesia.\\n\\nModern humans arrived on the \u001b[0m\n", "\u001b[32mIndian subcontinent from Africa no later than 55,000 years ago.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m26\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m27\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m28\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Their long occupation, predominantly in\u001b[0m\n", "\u001b[32misolation as hunter-gatherers, has made the region highly diverse.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m29\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Settled life emerged on the subcontinent in \u001b[0m\n", "\u001b[32mthe western margins of the Indus river basin 9,000 years ago, evolving gradually into the Indus Valley Civilisation\u001b[0m\n", "\u001b[32mof the third millennium BCE.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m30\u001b[0m\u001b[32m]\u001b[0m\u001b[32m By 1200\\xa0BCE, an archaic form of Sanskrit, an Indo-European language, had \u001b[0m\n", "\u001b[32mdiffused into India from the northwest.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m31\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m32\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Its hymns recorded the early dawnings of Hinduism in India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m33\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mIndia\\'s pre-existing Dravidian languages were supplanted in the northern regions.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m34\u001b[0m\u001b[32m]\u001b[0m\u001b[32m By 400\\xa0BCE, caste had \u001b[0m\n", "\u001b[32memerged within Hinduism,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m35\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and Buddhism and Jainism had arisen, proclaiming social orders unlinked to \u001b[0m\n", "\u001b[32mheredity.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m36\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Early political consolidations gave rise to the loose-knit Maurya and Gupta Empires.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m37\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Widespread \u001b[0m\n", "\u001b[32mcreativity suffused this era,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m38\u001b[0m\u001b[32m]\u001b[0m\u001b[32m but the status of women declined,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m39\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and untouchability became an organized \u001b[0m\n", "\u001b[32mbelief.\u001b[0m\u001b[32m[\u001b[0m\u001b[32ml\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m40\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In South India, the Middle kingdoms exported Dravidian language scripts and religious cultures to \u001b[0m\n", "\u001b[32mthe kingdoms of Southeast Asia.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m41\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIn the early medieval era, Christianity, Islam, Judaism, and Zoroastrianism \u001b[0m\n", "\u001b[32mbecame established on India\\'s southern and western coasts.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m42\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Muslim armies from Central Asia intermittently \u001b[0m\n", "\u001b[32moverran India\\'s northern plains in the second millennium.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m43\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The resulting Delhi Sultanate drew northern India \u001b[0m\n", "\u001b[32minto the cosmopolitan networks of medieval Islam.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m44\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In south India, the Vijayanagara Empire created a \u001b[0m\n", "\u001b[32mlong-lasting composite Hindu culture.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m45\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In the Punjab, Sikhism emerged, rejecting institutionalised religion.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m46\u001b[0m\u001b[32m]\u001b[0m\n", "\u001b[32mThe Mughal Empire ushered in two centuries of economic expansion and relative peace,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m47\u001b[0m\u001b[32m]\u001b[0m\u001b[32m leaving a rich \u001b[0m\n", "\u001b[32marchitectural legacy.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m48\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m49\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Gradually expanding rule of the British East India Company turned India into a \u001b[0m\n", "\u001b[32mcolonial economy but consolidated its sovereignty.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m50\u001b[0m\u001b[32m]\u001b[0m\u001b[32m British Crown rule began in 1858. The rights promised to \u001b[0m\n", "\u001b[32mIndians were granted slowly,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m51\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m52\u001b[0m\u001b[32m]\u001b[0m\u001b[32m but technological changes were introduced, and modern ideas of education and \u001b[0m\n", "\u001b[32mthe public life took root.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m53\u001b[0m\u001b[32m]\u001b[0m\u001b[32m A nationalist movement emerged in India, the first in the non-European British \u001b[0m\n", "\u001b[32mempire and an influence on other nationalist movements.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m54\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m55\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Noted for nonviolent resistance after 1920,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m56\u001b[0m\u001b[32m]\u001b[0m\u001b[32m it \u001b[0m\n", "\u001b[32mbecame the primary factor in ending British rule.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m57\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In 1947, the British Indian Empire was partitioned into two \u001b[0m\n", "\u001b[32mindependent a Hindu-majority dominion of India and a Muslim-majority dominion of Pakistan. A large-scale loss of \u001b[0m\n", "\u001b[32mlife and an unprecedented migration accompanied the partition.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m62\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIndia has been a federal republic since 1950,\u001b[0m\n", "\u001b[32mgoverned through a democratic parliamentary system. It is a pluralistic, multilingual and multi-ethnic society. \u001b[0m\n", "\u001b[32mIndia\\'s population grew from 361 million in 1951 to over 1.4 billion in 2023.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m63\u001b[0m\u001b[32m]\u001b[0m\u001b[32m During this time, its nominal \u001b[0m\n", "\u001b[32mper capita income increased from US$64 annually to US$2,601, and its literacy rate from 16.6% to 74%. A \u001b[0m\n", "\u001b[32mcomparatively destitute country in 1951,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m64\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has become a fast-growing major economy and hub for information \u001b[0m\n", "\u001b[32mtechnology services; it has an expanding middle class.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m65\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Indian movies and music increasingly influence global \u001b[0m\n", "\u001b[32mculture.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m66\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has reduced its poverty rate, though at the cost of increasing economic inequality.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m67\u001b[0m\u001b[32m]\u001b[0m\u001b[32m It is a \u001b[0m\n", "\u001b[32mnuclear-weapon state that ranks high in military expenditure. It has disputes over Kashmir with its neighbours, \u001b[0m\n", "\u001b[32mPakistan and China, unresolved since the mid-20th century.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m68\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Among the socio-economic challenges India faces are \u001b[0m\n", "\u001b[32mgender inequality, child malnutrition,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m69\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and rising levels of air pollution.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m70\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India\\'s land is megadiverse \u001b[0m\n", "\u001b[32mwith four biodiversity hotspots.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m71\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India\\'s wildlife, which has traditionally been viewed with tolerance in its \u001b[0m\n", "\u001b[32mculture,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m72\u001b[0m\u001b[32m]\u001b[0m\u001b[32m is supported in protected habitats.\\n\\nEtymology\\n---------\\n\\nMain article: Names for \u001b[0m\n", "\u001b[32mIndia\\n\\nAccording to the *Oxford English Dictionary* \u001b[0m\u001b[32m(\u001b[0m\u001b[32m2009\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, the name \"India\" is derived from the Classical Latin \u001b[0m\n", "\u001b[32m*India*, a reference to South Asia and an uncertain region to its east. In turn \"India\" derived successively from \u001b[0m\n", "\u001b[32mHellenistic Greek *India* \u001b[0m\u001b[32m(\u001b[0m\u001b[32mἸνδία\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, Ancient Greek *Indos* \u001b[0m\u001b[32m(\u001b[0m\u001b[32mἸνδÏ\\x8cÏ\\x82\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, Old Persian *Hindush* \u001b[0m\u001b[32m(\u001b[0m\u001b[32man \u001b[0m\n", "\u001b[32meastern province of the Achaemenid Empire\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, and ultimately its cognate, the Sanskrit *Sindhu*, or the Indus River,\u001b[0m\n", "\u001b[32mand by extension its well-settled southern basin.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m73\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m74\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The Ancient Greeks referred to the Indians as *Indoi*, \u001b[0m\n", "\u001b[32m\\'the people of the Indus\\'.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m75\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe term *Bharat* \u001b[0m\u001b[32m(\u001b[0m\u001b[32m*BhÄ\\x81rat*; pronounced \u001b[0m\u001b[32m[\u001b[0m\u001b[32mË\\x88bʱaË\\x90ɾÉ\\x99t\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mâ\\x93\\x98\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, mentioned in both Indian epic poetry and the Constitution of India,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m76\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m77\u001b[0m\u001b[32m]\u001b[0m\u001b[32m is used in its variations \u001b[0m\n", "\u001b[32mby many Indian languages. A modern rendering of the historical name *Bharatavarsha*, which applied originally to \u001b[0m\n", "\u001b[32mNorth India,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m78\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m79\u001b[0m\u001b[32m]\u001b[0m\u001b[32m *Bharat* gained increased currency from the mid-19th century as a native name for \u001b[0m\n", "\u001b[32mIndia.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m76\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m80\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n*Hindustan* \u001b[0m\u001b[32m(\u001b[0m\u001b[32m[\u001b[0m\u001b[32mɦɪndÊ\\x8aË\\x88staË\\x90n\u001b[0m\u001b[32m]\u001b[0m\u001b[32m â\\x93\\x98\u001b[0m\u001b[32m)\u001b[0m\u001b[32m is a Middle Persian name for India that \u001b[0m\n", "\u001b[32mbecame popular by the 13th century,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m81\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and was used widely since the era of the Mughal Empire. The meaning of \u001b[0m\n", "\u001b[32m*Hindustan* has varied, referring to a region encompassing the northern Indian subcontinent \u001b[0m\u001b[32m(\u001b[0m\u001b[32mpresent-day northern \u001b[0m\n", "\u001b[32mIndia and Pakistan\u001b[0m\u001b[32m)\u001b[0m\u001b[32m or to India in its near \\n\\nHistory\\n-------\\n\\nMain articles: History of India and History of \u001b[0m\n", "\u001b[32mthe Republic of India\\n\\n### Ancient India\\n\\n\\n\\nManuscript illustration, c.â\\x80\\x891650, of the Sanskrit epic \u001b[0m\n", "\u001b[32mRamayana, composed in story-telling fashion c.â\\x80\\x89400\\xa0BCE\\xa0â\\x80\\x93 c.â\\x80\\x89300\\xa0CE\u001b[0m\u001b[32m[\u001b[0m\u001b[32m83\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nBy \u001b[0m\n", "\u001b[32m55,000 years ago, the first modern humans, or *Homo sapiens*, had arrived on the Indian subcontinent from \u001b[0m\n", "\u001b[32mAfrica.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m26\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m27\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m28\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The earliest known modern human remains in South Asia date to about 30,000 years ago.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m26\u001b[0m\u001b[32m]\u001b[0m\u001b[32m After\u001b[0m\n", "\u001b[32m6500\\xa0BCE, evidence for domestication of food crops and animals, construction of permanent structures, and \u001b[0m\n", "\u001b[32mstorage of agricultural surplus appeared in Mehrgarh and other sites in Balochistan, Pakistan.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m84\u001b[0m\u001b[32m]\u001b[0m\u001b[32m These gradually \u001b[0m\n", "\u001b[32mdeveloped into the Indus Valley the first urban culture in South Asia,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m86\u001b[0m\u001b[32m]\u001b[0m\u001b[32m which flourished during \u001b[0m\n", "\u001b[32m2500â\\x80\\x931900\\xa0BCE in Pakistan and western India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m87\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Centred around cities such as Mohenjo-daro, Harappa, \u001b[0m\n", "\u001b[32mDholavira, and Kalibangan, and relying on varied forms of subsistence, the civilisation engaged robustly in crafts \u001b[0m\n", "\u001b[32mproduction and wide-ranging trade.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m86\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nDuring the period 2000â\\x80\\x93500\\xa0BCE, many regions of the \u001b[0m\n", "\u001b[32msubcontinent transitioned from the Chalcolithic cultures to the Iron Age ones.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m88\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The Vedas, the oldest scriptures\u001b[0m\n", "\u001b[32massociated with Hinduism,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m89\u001b[0m\u001b[32m]\u001b[0m\u001b[32m were composed during this period,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m90\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and historians have analysed these to posit a \u001b[0m\n", "\u001b[32mVedic culture in the Punjab region and the upper Gangetic Plain.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m88\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Most historians also consider this period to \u001b[0m\n", "\u001b[32mhave encompassed several waves of Indo-Aryan migration into the subcontinent from the north-west.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m89\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The caste \u001b[0m\n", "\u001b[32msystem, which created a hierarchy of priests, warriors, and free peasants, but which excluded indigenous peoples by\u001b[0m\n", "\u001b[32mlabelling their occupations impure, arose during this period.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m91\u001b[0m\u001b[32m]\u001b[0m\u001b[32m On the Deccan Plateau, archaeological evidence \u001b[0m\n", "\u001b[32mfrom this period suggests the existence of a chiefdom stage of political organisation.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m88\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In South India, a \u001b[0m\n", "\u001b[32mprogression to sedentary life is indicated by the large number of megalithic monuments dating from this period,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m92\u001b[0m\u001b[32m]\u001b[0m\n", "\u001b[32mas well as by nearby traces of agriculture, irrigation tanks, and craft traditions.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m92\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n\\n\\nCave 26 of the \u001b[0m\n", "\u001b[32mrock-cut Ajanta Caves\\n\\nIn the late Vedic period, around the 6th century BCE, the small states and chiefdoms of \u001b[0m\n", "\u001b[32mthe Ganges Plain and the north-western regions had consolidated into 16 major oligarchies and monarchies that were \u001b[0m\n", "\u001b[32mknown as the The emerging urbanisation gave rise to non-Vedic religious movements, two of which became independent\u001b[0m\n", "\u001b[32mreligions. Jainism came into prominence during the life of its exemplar, Mahavira.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m95\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Buddhism, based on the \u001b[0m\n", "\u001b[32mteachings of Gautama Buddha, attracted followers from all social classes excepting the middle class; chronicling \u001b[0m\n", "\u001b[32mthe life of the Buddha was central to the beginnings of recorded history in India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m96\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m97\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m98\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In an age of \u001b[0m\n", "\u001b[32mincreasing urban wealth, both religions held up renunciation as an ideal,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m99\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and both established long-lasting \u001b[0m\n", "\u001b[32mmonastic traditions. Politically, by the 3rd century BCE, the kingdom of Magadha had annexed or reduced other \u001b[0m\n", "\u001b[32mstates to emerge as the Maurya Empire.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m100\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The empire was once thought to have controlled most of the subcontinent\u001b[0m\n", "\u001b[32mexcept the far south, but its core regions are now thought to have been separated by large autonomous \u001b[0m\n", "\u001b[32mareas.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m101\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m102\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The Mauryan kings are known as much for their empire-building and determined management of public \u001b[0m\n", "\u001b[32mlife as for Ashoka\\'s renunciation of militarism and far-flung advocacy of the Buddhist *dhamma*.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m103\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m104\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe \u001b[0m\n", "\u001b[32mSangam literature of the Tamil language reveals that, between 200\\xa0BCE and 200\\xa0CE, the southern peninsula was \u001b[0m\n", "\u001b[32mruled by the Cheras, the Cholas, and the Pandyas, dynasties that traded extensively with the Roman Empire and with \u001b[0m\n", "\u001b[32mWest and Southeast Asia.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m105\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m106\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In North India, Hinduism asserted patriarchal control within the family, leading\u001b[0m\n", "\u001b[32mto increased subordination of women.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m107\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m100\u001b[0m\u001b[32m]\u001b[0m\u001b[32m By the 4th and 5th centuries, the Gupta Empire had created a complex\u001b[0m\n", "\u001b[32msystem of administration and taxation in the greater Ganges Plain; this system became a model for later Indian \u001b[0m\n", "\u001b[32mkingdoms.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m108\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m109\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Under the Guptas, a renewed Hinduism based on devotion, rather than the management of ritual, \u001b[0m\n", "\u001b[32mbegan to assert itself.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m110\u001b[0m\u001b[32m]\u001b[0m\u001b[32m This renewal was reflected in a flowering of sculpture and architecture, which found \u001b[0m\n", "\u001b[32mpatrons among an urban elite.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m109\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Classical Sanskrit literature flowered as well, and Indian science, astronomy, \u001b[0m\n", "\u001b[32mmedicine, and mathematics made significant advances.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m109\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### Medieval India\\n\\nMain article: Medieval \u001b[0m\n", "\u001b[32mIndia\\n\\n\\n\\nBrihadeshwara temple, Thanjavur, completed in 1010\\xa0CE\\n\\n\\n\\nThe Qutub Minar, 73\\xa0m \u001b[0m\u001b[32m(\u001b[0m\u001b[32m240\\xa0ft\u001b[0m\u001b[32m)\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mtall, completed by the Sultan of Delhi, Iltutmish\\n\\nThe Indian early medieval age, from 600 to 1200\\xa0CE, is \u001b[0m\n", "\u001b[32mdefined by regional kingdoms and cultural diversity.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m111\u001b[0m\u001b[32m]\u001b[0m\u001b[32m When Harsha of Kannauj, who ruled much of the \u001b[0m\n", "\u001b[32mIndo-Gangetic Plain from 606 to 647\\xa0CE, attempted to expand southwards, he was defeated by the Chalukya ruler of\u001b[0m\n", "\u001b[32mthe Deccan.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m112\u001b[0m\u001b[32m]\u001b[0m\u001b[32m When his successor attempted to expand eastwards, he was defeated by the Pala king of Bengal.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m112\u001b[0m\u001b[32m]\u001b[0m\n", "\u001b[32mWhen the Chalukyas attempted to expand southwards, they were defeated by the Pallavas from farther south, who in \u001b[0m\n", "\u001b[32mturn were opposed by the Pandyas and the Cholas from still farther south.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m112\u001b[0m\u001b[32m]\u001b[0m\u001b[32m No ruler of this period was able to \u001b[0m\n", "\u001b[32mcreate an empire and consistently control lands much beyond their core region.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m111\u001b[0m\u001b[32m]\u001b[0m\u001b[32m During this time, pastoral \u001b[0m\n", "\u001b[32mpeoples, whose land had been cleared to make way for the growing agricultural economy, were accommodated within \u001b[0m\n", "\u001b[32mcaste society, as were new non-traditional ruling classes.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m113\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The caste system consequently began to show \u001b[0m\n", "\u001b[32mregional differences.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m113\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIn the 6th and 7th centuries, the first devotional hymns were created in the Tamil \u001b[0m\n", "\u001b[32mlanguage.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m114\u001b[0m\u001b[32m]\u001b[0m\u001b[32m They were imitated all over India and led to both the resurgence of Hinduism and the development of \u001b[0m\n", "\u001b[32mall modern languages of the subcontinent.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m114\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Indian royalty, big and small, and the temples they patronised drew \u001b[0m\n", "\u001b[32mcitizens in great numbers to the capital cities, which became economic hubs as well.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m115\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Temple towns of various \u001b[0m\n", "\u001b[32msizes began to appear everywhere as India underwent another urbanisation.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m115\u001b[0m\u001b[32m]\u001b[0m\u001b[32m By the 8th and 9th centuries, the \u001b[0m\n", "\u001b[32meffects were felt in Southeast Asia, as South Indian culture and political systems were exported to lands that \u001b[0m\n", "\u001b[32mbecame part of modern-day Myanmar, Thailand, Laos, Brunei, Cambodia, Vietnam, Philippines, Malaysia, and \u001b[0m\n", "\u001b[32mIndonesia.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m116\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Indian merchants, scholars, and sometimes armies were involved in this transmission; Southeast \u001b[0m\n", "\u001b[32mAsians took the initiative as well, with many sojourning in Indian seminaries and translating Buddhist and Hindu \u001b[0m\n", "\u001b[32mtexts into their languages.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m116\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nAfter the 10th century, Muslim Central Asian nomadic clans, using swift-horse \u001b[0m\n", "\u001b[32mcavalry and raising vast armies united by ethnicity and religion, repeatedly overran South Asia\\'s north-western \u001b[0m\n", "\u001b[32mplains, leading eventually to the establishment of the Islamic Delhi Sultanate in 1206.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m117\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The sultanate was to \u001b[0m\n", "\u001b[32mcontrol much of North India and to make many forays into South India. Although at first disruptive for the Indian \u001b[0m\n", "\u001b[32melites, the sultanate largely left its vast non-Muslim subject population to its own laws and customs.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m118\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m119\u001b[0m\u001b[32m]\u001b[0m\u001b[32m By\u001b[0m\n", "\u001b[32mrepeatedly repulsing Mongol raiders in the 13th century, the sultanate saved India from the devastation visited on \u001b[0m\n", "\u001b[32mWest and Central Asia, setting the scene for centuries of migration of fleeing soldiers, learned men, mystics, \u001b[0m\n", "\u001b[32mtraders, artists, and artisans from that region into the subcontinent, thereby creating a syncretic Indo-Islamic \u001b[0m\n", "\u001b[32mculture in the north.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m120\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m121\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The sultanate\\'s raiding and weakening of the regional kingdoms of South India \u001b[0m\n", "\u001b[32mpaved the way for the indigenous Vijayanagara Empire.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m122\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Embracing a strong Shaivite tradition and building upon \u001b[0m\n", "\u001b[32mthe military technology of the sultanate, the empire came to control much of peninsular India,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m123\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and was to \u001b[0m\n", "\u001b[32minfluence South Indian society for long afterwards.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m122\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### Early modern India\\n\\n\\n\\nA distant view of the Taj\u001b[0m\n", "\u001b[32mMahal from the Agra Fort\\n\\n\\n\\nA two mohur Company gold coin, issued in 1835, the obverse inscribed \"William IIII,\u001b[0m\n", "\u001b[32mKing\"\\n\\nIn the early 16th century, northern India, then under mainly Muslim rulers,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m124\u001b[0m\u001b[32m]\u001b[0m\u001b[32m fell again to the \u001b[0m\n", "\u001b[32msuperior mobility and firepower of a new generation of Central Asian warriors.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m125\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The resulting Mughal Empire did\u001b[0m\n", "\u001b[32mnot stamp out the local societies it came to rule. Instead, it balanced and pacified them through new \u001b[0m\n", "\u001b[32madministrative practices\u001b[0m\u001b[32m[\u001b[0m\u001b[32m126\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m127\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and diverse and inclusive ruling elites,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m128\u001b[0m\u001b[32m]\u001b[0m\u001b[32m leading to more systematic, \u001b[0m\n", "\u001b[32mcentralised, and uniform rule.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m129\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Eschewing tribal bonds and Islamic identity, especially under Akbar, the \u001b[0m\n", "\u001b[32mMughals united their far-flung realms through loyalty, expressed through a Persianised culture, to an emperor who \u001b[0m\n", "\u001b[32mhad near-divine status.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m128\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The Mughal state\\'s economic policies, deriving most revenues from agriculture\u001b[0m\u001b[32m[\u001b[0m\u001b[32m130\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mand mandating that taxes be paid in the well-regulated silver currency,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m131\u001b[0m\u001b[32m]\u001b[0m\u001b[32m caused peasants and artisans to enter \u001b[0m\n", "\u001b[32mlarger markets.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m129\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The relative peace maintained by the empire during much of the 17th century was a factor in \u001b[0m\n", "\u001b[32mIndia\\'s economic expansion,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m129\u001b[0m\u001b[32m]\u001b[0m\u001b[32m resulting in greater patronage of painting, literary forms, textiles, and \u001b[0m\n", "\u001b[32marchitecture.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m132\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Newly coherent social groups in northern and western India, such as the Marathas, the Rajputs, \u001b[0m\n", "\u001b[32mand the Sikhs, gained military and governing ambitions during Mughal rule, which, through collaboration or \u001b[0m\n", "\u001b[32madversity, gave them both recognition and military experience.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m133\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Expanding commerce during Mughal rule gave rise\u001b[0m\n", "\u001b[32mto new Indian commercial and political elites along the coasts of southern and eastern India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m133\u001b[0m\u001b[32m]\u001b[0m\u001b[32m As the empire \u001b[0m\n", "\u001b[32mdisintegrated, many among these elites were able to seek and control their own affairs.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m134\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nBy the early 18th \u001b[0m\n", "\u001b[32mcentury, with the lines between commercial and political dominance being increasingly blurred, a number of European\u001b[0m\n", "\u001b[32mtrading companies, including the English East India Company, had established coastal outposts.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m135\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m136\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The East \u001b[0m\n", "\u001b[32mIndia Company\\'s control of the seas, greater resources, and more advanced military training and technology led it \u001b[0m\n", "\u001b[32mto increasingly assert its military strength and caused it to become attractive to a portion of the Indian elite; \u001b[0m\n", "\u001b[32mthese factors were crucial in allowing the company to gain control over the Bengal region by 1765 and sideline the \u001b[0m\n", "\u001b[32mother European Its further access to the riches of Bengal and the subsequent increased strength and size of its \u001b[0m\n", "\u001b[32marmy enabled it to annex or subdue most of India by the 1820s.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m140\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India was then no longer exporting manufactured\u001b[0m\n", "\u001b[32mgoods as it long had, but was instead supplying the British Empire with raw materials. Many historians consider \u001b[0m\n", "\u001b[32mthis to be the onset of India\\'s colonial period.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m135\u001b[0m\u001b[32m]\u001b[0m\u001b[32m By this time, with its economic power severely curtailed by \u001b[0m\n", "\u001b[32mthe British parliament and having effectively been made an arm of British administration, the East India Company \u001b[0m\n", "\u001b[32mbegan more consciously to enter non-economic arenas, including education, social reform, and culture.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m141\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### \u001b[0m\n", "\u001b[32mModern India\\n\\nMain article: History of India \u001b[0m\u001b[32m(\u001b[0m\u001b[32m1947â\\x80\\x93present\u001b[0m\u001b[32m)\u001b[0m\u001b[32m\\n\\n\\n\\n1909 map of the British Indian \u001b[0m\n", "\u001b[32mEmpire\\n\\n\\n\\nJawaharlal Nehru sharing a light moment with Mahatma Gandhi, Mumbai, 6 July 1946\\n\\nHistorians \u001b[0m\n", "\u001b[32mconsider India\\'s modern age to have begun sometime between 1848 and 1885. The appointment in 1848 of Lord \u001b[0m\n", "\u001b[32mDalhousie as Governor General of the East India Company set the stage for changes essential to a modern state. \u001b[0m\n", "\u001b[32mThese included the consolidation and demarcation of sovereignty, the surveillance of the population, and the \u001b[0m\n", "\u001b[32meducation of citizens. Technological changesâ\\x80\\x94among them, railways, canals, and the telegraphâ\\x80\\x94were \u001b[0m\n", "\u001b[32mintroduced not long after their introduction in However, disaffection with the company also grew during this time \u001b[0m\n", "\u001b[32mand set off the Indian Rebellion of 1857. Fed by diverse resentments and perceptions, including invasive \u001b[0m\n", "\u001b[32mBritish-style social reforms, harsh land taxes, and summary treatment of some rich landowners and princes, the \u001b[0m\n", "\u001b[32mrebellion rocked many regions of northern and central India and shook the foundations of Company rule.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m146\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m147\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mAlthough the rebellion was suppressed by 1858, it led to the dissolution of the East India Company and the direct \u001b[0m\n", "\u001b[32madministration of India by the British government. Proclaiming a unitary state and a gradual but limited \u001b[0m\n", "\u001b[32mBritish-style parliamentary system, the new rulers also protected princes and landed gentry as a feudal safeguard \u001b[0m\n", "\u001b[32magainst future unrest.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m148\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m149\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In the decades following, public life gradually emerged all over India, leading \u001b[0m\n", "\u001b[32meventually to the founding of the Indian National Congress in \\n\\nThe rush of technology and the commercialisation \u001b[0m\n", "\u001b[32mof agriculture in the second half of the 19th century was marked by economic setbacks, and many small farmers \u001b[0m\n", "\u001b[32mbecame dependent on the whims of far-away markets.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m154\u001b[0m\u001b[32m]\u001b[0m\u001b[32m There was an increase in the number of large-scale \u001b[0m\n", "\u001b[32mfamines,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m155\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and, despite the risks of infrastructure development borne by Indian taxpayers, little industrial \u001b[0m\n", "\u001b[32memployment was generated for Indians.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m156\u001b[0m\u001b[32m]\u001b[0m\u001b[32m There were also salutary effects: commercial cropping, especially in the\u001b[0m\n", "\u001b[32mnewly canalled Punjab, led to increased food production for internal consumption.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m157\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The railway network provided\u001b[0m\n", "\u001b[32mcritical famine relief,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m158\u001b[0m\u001b[32m]\u001b[0m\u001b[32m notably reduced the cost of moving goods,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m158\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and helped nascent Indian-owned \u001b[0m\n", "\u001b[32mindustry.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m157\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nAfter World War I, in which approximately one million Indians served,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m159\u001b[0m\u001b[32m]\u001b[0m\u001b[32m a new period began. It\u001b[0m\n", "\u001b[32mwas marked by British reforms but also repressive legislation, by more strident Indian calls for self-rule, and by \u001b[0m\n", "\u001b[32mthe beginnings of a nonviolent movement of non-co-operation, of which Mahatma Gandhi would become the leader and \u001b[0m\n", "\u001b[32menduring symbol.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m160\u001b[0m\u001b[32m]\u001b[0m\u001b[32m During the 1930s, slow legislative reform was enacted by the British; the Indian National \u001b[0m\n", "\u001b[32mCongress won victories in the resulting elections.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m161\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The next decade was beset with crises: Indian participation\u001b[0m\n", "\u001b[32min World War\\xa0II, the Congress\\'s final push for non-co-operation, and an upsurge of Muslim nationalism. All were\u001b[0m\n", "\u001b[32mcapped by the advent of independence in 1947, but tempered by the partition of India into two states: India and \u001b[0m\n", "\u001b[32mPakistan.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m162\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nVital to India\\'s self-image as an independent nation was its constitution, completed in 1950, \u001b[0m\n", "\u001b[32mwhich put in place a secular and democratic republic.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m163\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Economic liberalisation, which began in the 1980s and \u001b[0m\n", "\u001b[32mwith the collaboration with Soviet Union for technical knowledge,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m164\u001b[0m\u001b[32m]\u001b[0m\u001b[32m has created a large urban middle class, \u001b[0m\n", "\u001b[32mtransformed India into one of the world\\'s fastest-growing economies,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m165\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and increased its geopolitical \u001b[0m\n", "\u001b[32minfluence. Yet, India is also shaped by persistent poverty, both rural and urban;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m166\u001b[0m\u001b[32m]\u001b[0m\u001b[32m by religious and \u001b[0m\n", "\u001b[32mcaste-related violence;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m167\u001b[0m\u001b[32m]\u001b[0m\u001b[32m by Maoist-inspired Naxalite insurgencies;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m168\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and by separatism in Jammu and Kashmir \u001b[0m\n", "\u001b[32mand in Northeast India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m169\u001b[0m\u001b[32m]\u001b[0m\u001b[32m It has unresolved territorial disputes with China and with Pakistan.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m170\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India\\'s \u001b[0m\n", "\u001b[32msustained democratic freedoms are unique among the world\\'s newer nations; however, in spite of its recent economic\u001b[0m\n", "\u001b[32msuccesses, freedom from want for its disadvantaged population remains a goal yet to be achieved.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m171\u001b[0m\u001b[32m]\u001b[0m\u001b[32m As of 2025, \u001b[0m\n", "\u001b[32mpoverty in India declined sharply, mainly due to government welfare programs.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m172\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nGeography\\n---------\\n\\nMain \u001b[0m\n", "\u001b[32marticle: Geography of India\\n\\n\\n\\nThe Tungabhadra, with rocky outcrops, flows into the peninsular Krishna \u001b[0m\n", "\u001b[32mRiver\u001b[0m\u001b[32m[\u001b[0m\u001b[32m173\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n\\n\\nFishing boats lashed together in a tidal creek in Anjarle village, Maharashtra\\n\\nIndia accounts \u001b[0m\n", "\u001b[32mfor the bulk of the Indian subcontinent, lying atop the Indian tectonic plate, a part of the Indo-Australian \u001b[0m\n", "\u001b[32mPlate.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m174\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India\\'s defining geological processes began 75 million years ago when the Indian Plate, then part of \u001b[0m\n", "\u001b[32mthe southern supercontinent Gondwana, began a north-eastward drift caused by seafloor spreading to its south-west, \u001b[0m\n", "\u001b[32mand later, south and south-east.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m174\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Simultaneously, the vast Tethyan oceanic crust, to its northeast, began to \u001b[0m\n", "\u001b[32msubduct under the Eurasian Plate.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m174\u001b[0m\u001b[32m]\u001b[0m\u001b[32m These dual processes, driven by convection in the Earth\\'s mantle, both \u001b[0m\n", "\u001b[32mcreated the Indian Ocean and caused the Indian continental crust eventually to under-thrust Eurasia and to uplift \u001b[0m\n", "\u001b[32mthe Himalayas.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m174\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Immediately south of the emerging Himalayas, plate movement created a vast crescent-shaped \u001b[0m\n", "\u001b[32mtrough that rapidly filled with river-borne sediment\u001b[0m\u001b[32m[\u001b[0m\u001b[32m175\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and now constitutes the Indo-Gangetic Plain.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m176\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The \u001b[0m\n", "\u001b[32moriginal Indian plate makes its first appearance above the sediment in the ancient Aravalli range, which extends \u001b[0m\n", "\u001b[32mfrom the Delhi Ridge in a southwesterly direction. To the west lies the Thar Desert, the eastern spread of which is\u001b[0m\n", "\u001b[32mchecked by the \\n\\nThe remaining Indian Plate survives as peninsular India, the oldest and geologically most stable\u001b[0m\n", "\u001b[32mpart of India. It extends as far north as the Satpura and Vindhya ranges in central India. These parallel chains \u001b[0m\n", "\u001b[32mrun from the Arabian Sea coast in Gujarat in the west to the coal-rich Chota Nagpur Plateau in Jharkhand in the \u001b[0m\n", "\u001b[32meast.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m180\u001b[0m\u001b[32m]\u001b[0m\u001b[32m To the south, the remaining peninsular landmass, the Deccan Plateau, is flanked on the west and east by \u001b[0m\n", "\u001b[32mcoastal ranges known as the Western and Eastern Ghats;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m181\u001b[0m\u001b[32m]\u001b[0m\u001b[32m the plateau contains the country\\'s oldest rock \u001b[0m\n", "\u001b[32mformations, some over one billion years old. Constituted in such fashion, India lies to the north of the equator \u001b[0m\n", "\u001b[32mbetween 6° 44â\\x80² and 35° 30â\\x80² north latitude\u001b[0m\u001b[32m[\u001b[0m\u001b[32mm\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and 68° 7â\\x80² and 97° 25â\\x80² east \u001b[0m\n", "\u001b[32mlongitude.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m182\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIndia\\'s coastline measures 7,517 kilometres \u001b[0m\u001b[32m(\u001b[0m\u001b[32m4,700\\xa0mi\u001b[0m\u001b[32m)\u001b[0m\u001b[32m in length; of this distance, 5,423 \u001b[0m\n", "\u001b[32mkilometres \u001b[0m\u001b[32m(\u001b[0m\u001b[32m3,400\\xa0mi\u001b[0m\u001b[32m)\u001b[0m\u001b[32m belong to peninsular India and 2,094 kilometres \u001b[0m\u001b[32m(\u001b[0m\u001b[32m1,300\\xa0mi\u001b[0m\u001b[32m)\u001b[0m\u001b[32m to the Andaman, Nicobar, and\u001b[0m\n", "\u001b[32mLakshadweep island chains.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m183\u001b[0m\u001b[32m]\u001b[0m\u001b[32m According to the Indian naval hydrographic charts, the mainland coastline consists \u001b[0m\n", "\u001b[32mof the following: 43% sandy beaches; 11% rocky shores, including cliffs; and 46% mudflats or marshy shores.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m183\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mMajor Himalayan-origin rivers that substantially flow through India include the Ganges and the Brahmaputra, both of\u001b[0m\n", "\u001b[32mwhich drain into the Bay of Bengal.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m184\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Important tributaries of the Ganges include the Yamuna and the Kosi; the \u001b[0m\n", "\u001b[32mlatter\\'s extremely low gradient, caused by long-term silt deposition, leads to severe floods and course \u001b[0m\n", "\u001b[32mchanges.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m185\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m186\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Major peninsular rivers, whose steeper gradients prevent their waters from flooding, include the\u001b[0m\n", "\u001b[32mGodavari, the Mahanadi, the Kaveri, and the Krishna, which also drain into the Bay of Bengal;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m187\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and the Narmada \u001b[0m\n", "\u001b[32mand the Tapti, which drain into the Arabian Sea.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m188\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Coastal features include the marshy Rann of Kutch of western \u001b[0m\n", "\u001b[32mIndia and the alluvial Sundarbans delta of eastern India; the latter is shared with Bangladesh.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m189\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has two \u001b[0m\n", "\u001b[32marchipelagos: the Lakshadweep, coral atolls off India\\'s south-western coast; and the Andaman and Nicobar Islands, \u001b[0m\n", "\u001b[32ma volcanic chain in the Andaman Sea.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m190\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIndian climate is strongly influenced by the Himalayas and the Thar \u001b[0m\n", "\u001b[32mDesert, both of which drive the economically and culturally pivotal summer and winter monsoons.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m191\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The Himalayas \u001b[0m\n", "\u001b[32mprevent cold Central Asian katabatic winds from blowing in, keeping the bulk of the Indian subcontinent warmer than\u001b[0m\n", "\u001b[32mmost locations at similar latitudes.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m192\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m193\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The Thar Desert plays a crucial role in attracting the \u001b[0m\n", "\u001b[32mmoisture-laden south-west summer monsoon winds that, between June and October, provide the majority of India\\'s \u001b[0m\n", "\u001b[32mrainfall.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m191\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Four major climatic groupings predominate in India: tropical wet, tropical dry, subtropical humid, \u001b[0m\n", "\u001b[32mand montane.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m194\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Temperatures in India have risen by 0.7\\xa0°C \u001b[0m\u001b[32m(\u001b[0m\u001b[32m1.3\\xa0°F\u001b[0m\u001b[32m)\u001b[0m\u001b[32m between 1901 and 2018.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m195\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Climate \u001b[0m\n", "\u001b[32mchange in India is often thought to be the cause. The retreat of Himalayan glaciers has adversely affected the flow\u001b[0m\n", "\u001b[32mrate of the major Himalayan rivers, including the Ganges and the Brahmaputra.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m196\u001b[0m\u001b[32m]\u001b[0m\u001b[32m According to some current \u001b[0m\n", "\u001b[32mprojections, the number and severity of droughts in India will have markedly increased by the end of the present \u001b[0m\n", "\u001b[32mcentury.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m197\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### Biodiversity\\n\\nMain articles: Forestry in India and Wildlife of India\\n\\n\\n\\nIndia has the \u001b[0m\n", "\u001b[32mmajority of the world\\'s wild tigers, approximately 3,170 in 2022.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m198\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n\\n\\nA chital \u001b[0m\u001b[32m(\u001b[0m\u001b[32m*Axis axis*\u001b[0m\u001b[32m)\u001b[0m\u001b[32m stag in the \u001b[0m\n", "\u001b[32mNagarhole National Park in a region covered by a moderately dense\u001b[0m\u001b[32m[\u001b[0m\u001b[32mn\u001b[0m\u001b[32m]\u001b[0m\u001b[32m forest.\\n\\n\\n\\nThree of the last Asiatic \u001b[0m\n", "\u001b[32mcheetahs in India were shot dead in 1948 in Surguja district, Madhya Pradesh, Central India by Maharajah Ramanuj \u001b[0m\n", "\u001b[32mPratap Singh Deo. The young male cheetahs, all from the same litter, were sitting together when they were shot at \u001b[0m\n", "\u001b[32mnight.\\n\\nIndia is a megadiverse country, a term employed for 17 countries that display high biological diversity \u001b[0m\n", "\u001b[32mand contain many species exclusively indigenous, or endemic, to them.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m199\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India is the habitat for 8.6% of all \u001b[0m\n", "\u001b[32mmammals, 13.7% of bird species, 7.9% of reptile species, 6% of amphibian species, 12.2% of fish species, and 6.0% \u001b[0m\n", "\u001b[32mof all flowering plant species.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m200\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m201\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Fully a third of Indian plant species are endemic.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m202\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India also \u001b[0m\n", "\u001b[32mcontains four of the world\\'s 34 biodiversity hotspots,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m71\u001b[0m\u001b[32m]\u001b[0m\u001b[32m or regions that display significant habitat loss in the\u001b[0m\n", "\u001b[32mpresence of high endemism.\u001b[0m\u001b[32m[\u001b[0m\u001b[32mo\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m203\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIndia\\'s most dense forests, such as the tropical moist forest of the Andaman\u001b[0m\n", "\u001b[32mIslands, the Western Ghats, and Northeast India, occupy approximately 3% of its land area.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m204\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m205\u001b[0m\u001b[32m]\u001b[0m\u001b[32m *Moderately \u001b[0m\n", "\u001b[32mdense forest*, whose canopy density is between 40% and 70%, occupies 9.39% of India\\'s land area.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m204\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m205\u001b[0m\u001b[32m]\u001b[0m\u001b[32m It \u001b[0m\n", "\u001b[32mpredominates in the temperate coniferous forest of the Himalayas, the moist deciduous *sal* forest of eastern \u001b[0m\n", "\u001b[32mIndia, and the dry deciduous teak forest of central and southern India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m206\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has two natural zones of thorn \u001b[0m\n", "\u001b[32mforest, one in the Deccan Plateau, immediately east of the Western Ghats, and the other in the western part of the \u001b[0m\n", "\u001b[32mIndo-Gangetic plain, now turned into rich agricultural land by irrigation, its features no longer visible.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m207\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mAmong the Indian subcontinent\\'s notable indigenous trees are the astringent *Azadirachta indica*, or *neem*, which\u001b[0m\n", "\u001b[32mis widely used in rural Indian herbal medicine,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m208\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and the luxuriant *Ficus religiosa*, or *peepul*,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m209\u001b[0m\u001b[32m]\u001b[0m\u001b[32m which \u001b[0m\n", "\u001b[32mis displayed on the ancient seals of Mohenjo-daro,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m210\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and under which the Buddha is recorded in the Pali canon to\u001b[0m\n", "\u001b[32mhave sought enlightenment.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m211\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nMany Indian species have descended from those of Gondwana, the southern \u001b[0m\n", "\u001b[32msupercontinent from which India separated more than 100 million years ago.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m212\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India\\'s subsequent collision with \u001b[0m\n", "\u001b[32mEurasia set off a mass exchange of species. However, volcanism and climatic changes later caused the extinction of \u001b[0m\n", "\u001b[32mmany endemic Indian forms.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m213\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Still later, mammals entered India from Asia through two zoogeographic passes \u001b[0m\n", "\u001b[32mflanking the Himalayas.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m214\u001b[0m\u001b[32m]\u001b[0m\u001b[32m This had the effect of lowering endemism among India\\'s mammals, which stands at \u001b[0m\n", "\u001b[32m12.6%, contrasting with 45.8% among reptiles and 55.8% among amphibians.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m201\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Among endemics are the \u001b[0m\n", "\u001b[32mvulnerable\u001b[0m\u001b[32m[\u001b[0m\u001b[32m215\u001b[0m\u001b[32m]\u001b[0m\u001b[32m hooded leaf monkey\u001b[0m\u001b[32m[\u001b[0m\u001b[32m216\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and the threatened Beddome\\'s toad\u001b[0m\u001b[32m[\u001b[0m\u001b[32m217\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m218\u001b[0m\u001b[32m]\u001b[0m\u001b[32m of the Western Ghats.\\n\\nIndia\u001b[0m\n", "\u001b[32mcontains 172 IUCN-designated threatened animal species, or 2.9% of endangered forms.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m219\u001b[0m\u001b[32m]\u001b[0m\u001b[32m These include the \u001b[0m\n", "\u001b[32mendangered Bengal tiger and the Ganges river dolphin. Critically endangered species include the gharial, a \u001b[0m\n", "\u001b[32mcrocodilian; the great Indian bustard; and the Indian white-rumped vulture, which has become nearly extinct by \u001b[0m\n", "\u001b[32mhaving ingested the carrion of diclofenac-treated cattle.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m220\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Before they were extensively used for agriculture \u001b[0m\n", "\u001b[32mand cleared for human settlement, the thorn forests of Punjab were mingled at intervals with open grasslands that \u001b[0m\n", "\u001b[32mwere grazed by large herds of blackbuck preyed on by the Asiatic cheetah; the blackbuck, no longer extant in \u001b[0m\n", "\u001b[32mPunjab, is now severely endangered in India, and the cheetah is extinct.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m221\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The pervasive and ecologically \u001b[0m\n", "\u001b[32mdevastating human encroachment of recent decades has critically endangered Indian wildlife. In response, the system\u001b[0m\n", "\u001b[32mof national parks and protected areas, first established in 1935, was expanded substantially. In 1972, India \u001b[0m\n", "\u001b[32menacted the Wildlife Protection Act\u001b[0m\u001b[32m[\u001b[0m\u001b[32m222\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and Project Tiger to safeguard crucial wilderness; the Forest Conservation\u001b[0m\n", "\u001b[32mAct was enacted in 1980 and amendments added in 1988.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m223\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India hosts more than five hundred wildlife sanctuaries \u001b[0m\n", "\u001b[32mand eighteen\\xa0biosphere reserves,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m224\u001b[0m\u001b[32m]\u001b[0m\u001b[32m four of which are part of the World Network of Biosphere Reserves; its \u001b[0m\n", "\u001b[32meighty-nine wetlands are registered under the Ramsar Convention.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m225\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nPolitics and government\\n\\n\\n### \u001b[0m\n", "\u001b[32mPolitics\\n\\nMain article: Politics of India\\n\\nSee also: Democracy in India\\n\\n\\n\\nAs part of Janadesh 2007, 25,000\u001b[0m\n", "\u001b[32mproâ\\x80\\x93land reform landless people in Madhya Pradesh listen to Rajagopal P. V.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m226\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n\\n\\nUS president Barack\u001b[0m\n", "\u001b[32mObama addresses the members of the Parliament of India in New Delhi in November 2010.\\n\\nIndia is a parliamentary \u001b[0m\n", "\u001b[32mrepublic with a multi-party system.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m227\u001b[0m\u001b[32m]\u001b[0m\u001b[32m It has six\\xa0recognised national parties, including the Indian National \u001b[0m\n", "\u001b[32mCongress \u001b[0m\u001b[32m(\u001b[0m\u001b[32mINC\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and the Bharatiya Janata Party \u001b[0m\u001b[32m(\u001b[0m\u001b[32mBJP\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, and over 50\\xa0regional parties.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m228\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Congress is considered \u001b[0m\n", "\u001b[32mthe ideological centre in Indian political culture,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m229\u001b[0m\u001b[32m]\u001b[0m\u001b[32m whereas the BJP is right-wing to From 1950 to the late \u001b[0m\n", "\u001b[32m1980s, Congress held a majority in the India\\'s parliament. Afterwards, it increasingly shared power with the \u001b[0m\n", "\u001b[32mBJP,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m233\u001b[0m\u001b[32m]\u001b[0m\u001b[32m as well as with powerful regional parties, which forced multi-party coalition governments at the \u001b[0m\n", "\u001b[32mcentre.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m234\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIn the Republic of India\\'s general elections in 1951, 1957, and 1962, Congress, led by Jawaharlal \u001b[0m\n", "\u001b[32mNehru, won easy victories. On Nehru\\'s death in 1964, Lal Bahadur Shastri briefly became prime minister; he was \u001b[0m\n", "\u001b[32msucceeded in 1966, by Nehru\\'s daughter Indira Gandhi, who led the Congress to election victories in 1967 and 1971.\u001b[0m\n", "\u001b[32mFollowing public discontent with the state of emergency Indira Gandhi had declared in 1975, Congress was voted out \u001b[0m\n", "\u001b[32mof power in 1977; Janata Party, which had opposed the emergency, was voted in. Its government lasted two years; \u001b[0m\n", "\u001b[32mMorarji Desai and Charan Singh served as prime ministers. After Congress was returned to power in 1980, Indira \u001b[0m\n", "\u001b[32mGandhi was assassinated and succeeded by Rajiv Gandhi, who won easily in the elections later that year. In the 1989\u001b[0m\n", "\u001b[32melections a National Front coalition, led by the Janata Dal in alliance with the Left Front, won, lasting just \u001b[0m\n", "\u001b[32munder two years, and V.P. Singh and Chandra Shekhar serving as prime ministers.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m235\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In the 1991 Indian general \u001b[0m\n", "\u001b[32melection, Congress, as the largest single party, formed a minority government led by P. V. Narasimha \u001b[0m\n", "\u001b[32mRao.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m236\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nAfter the 1996 Indian general election, the BJP formed a government briefly; it was followed by United\u001b[0m\n", "\u001b[32mFront coalitions, which depended on external political support. Two prime ministers served during this period: H.D.\u001b[0m\n", "\u001b[32mDeve Gowda and I.K. Gujral. In 1998, the BJP formed a coalitionâ\\x80\\x94the National Democratic Alliance \u001b[0m\u001b[32m(\u001b[0m\u001b[32mNDA\u001b[0m\u001b[32m)\u001b[0m\u001b[32m. Led\u001b[0m\n", "\u001b[32mby Atal Bihari Vajpayee, the NDA became the first non-Congress, coalition government to complete a five-year \u001b[0m\n", "\u001b[32mterm.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m237\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In the 2004 Indian general elections, no party won an absolute majority. Still, the Congress emerged as \u001b[0m\n", "\u001b[32mthe largest single party, forming another successful coalition: the United Progressive Alliance \u001b[0m\u001b[32m(\u001b[0m\u001b[32mUPA\u001b[0m\u001b[32m)\u001b[0m\u001b[32m. It had the \u001b[0m\n", "\u001b[32msupport of left-leaning parties and MPs who opposed the BJP. The UPA returned to power in the 2009 general election\u001b[0m\n", "\u001b[32mwith increased numbers, and it no longer required external support from India\\'s communist parties.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m238\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Manmohan \u001b[0m\n", "\u001b[32mSingh became the first prime minister since Jawaharlal Nehru in 1957 and 1962 to be re-elected to a consecutive \u001b[0m\n", "\u001b[32mfive-year term.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m239\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In the 2014 general election, the BJP became the first political party since 1984 to win an \u001b[0m\n", "\u001b[32mabsolute majority.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m240\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In the 2019 general election, the BJP regained an absolute majority. In the 2024 general \u001b[0m\n", "\u001b[32melection, a BJP-led NDA coalition formed the government. Narendra Modi, a former chief minister of Gujarat, is \u001b[0m\n", "\u001b[32mserving as the prime minister of India in his third term since May 26, 2014.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m241\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### Government\\n\\nMain \u001b[0m\n", "\u001b[32marticle: Government of India\\n\\nSee also: Constitution of India\\n\\n\\n\\nRashtrapati Bhavan, the official residence \u001b[0m\n", "\u001b[32mof the President of India, was designed by British architects Edwin Lutyens and Herbert Baker for the Viceroy of \u001b[0m\n", "\u001b[32mIndia, and constructed between 1911 and 1931 during the British Raj.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m242\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIndia is a federation with a \u001b[0m\n", "\u001b[32mparliamentary system governed under the Constitution of India. Federalism in India defines the power distribution \u001b[0m\n", "\u001b[32mbetween the union and the states. India\\'s form of government, traditionally described as \"quasi-federal\" with a \u001b[0m\n", "\u001b[32mstrong centre and weak states,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m243\u001b[0m\u001b[32m]\u001b[0m\u001b[32m has grown increasingly federal since the late 1990s as a result of political, \u001b[0m\n", "\u001b[32meconomic, and social changes.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m244\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m245\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe Government of India comprises three branches: the Executive, \u001b[0m\n", "\u001b[32mLegislature, and Judiciary.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m246\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The President of India is the ceremonial head of state,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m247\u001b[0m\u001b[32m]\u001b[0m\u001b[32m who is elected \u001b[0m\n", "\u001b[32mindirectly for a five-year term by an electoral college comprising members of national and state The Prime \u001b[0m\n", "\u001b[32mMinister of India is the head of government and exercises most executive power.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m250\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Appointed by the \u001b[0m\n", "\u001b[32mpresident,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m251\u001b[0m\u001b[32m]\u001b[0m\u001b[32m the prime minister is supported by the party or political alliance with a majority of seats in the \u001b[0m\n", "\u001b[32mlower house of parliament.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m250\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The executive of the Indian government consists of the president, the \u001b[0m\n", "\u001b[32mvice-president, and the Union Council of Ministersâ\\x80\\x94with the cabinet being its executive \u001b[0m\n", "\u001b[32mcommitteeâ\\x80\\x94headed by the prime minister. Any minister holding a portfolio must be a member of one of the \u001b[0m\n", "\u001b[32mhouses of parliament.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m247\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In the Indian parliamentary system, the executive is subordinate to the legislature; the\u001b[0m\n", "\u001b[32mprime minister and their council are directly responsible to the lower house of the parliament. Civil servants act \u001b[0m\n", "\u001b[32mas permanent executives and all decisions of the executive are implemented by them.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m252\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe legislature of \u001b[0m\n", "\u001b[32mIndia is the bicameral parliament. Operating under a Westminster-style parliamentary system, it comprises an upper \u001b[0m\n", "\u001b[32mhouse called the Rajya Sabha \u001b[0m\u001b[32m(\u001b[0m\u001b[32mCouncil of States\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and a lower house called the Lok Sabha \u001b[0m\u001b[32m(\u001b[0m\u001b[32mHouse of the People\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m253\u001b[0m\u001b[32m]\u001b[0m\n", "\u001b[32mThe Rajya Sabha is a permanent body of 245\\xa0members who serve staggered six-year terms with elections every 2 \u001b[0m\n", "\u001b[32myears.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m254\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Most are elected indirectly by the state and union territorial legislatures in numbers proportional to \u001b[0m\n", "\u001b[32mtheir state\\'s share of the national population.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m251\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The Lok Sabha\\'s 543\\xa0members are elected directly by \u001b[0m\n", "\u001b[32mpopular vote among citizens aged at least 18;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m255\u001b[0m\u001b[32m]\u001b[0m\u001b[32m they represent single-member constituencies for \u001b[0m\n", "\u001b[32mfive-year\\xa0terms.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m256\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Several seats from each state are reserved for candidates from Scheduled Castes and \u001b[0m\n", "\u001b[32mScheduled Tribes in proportion to their population within that state.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m255\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIndia has a three-tier\\xa0unitary \u001b[0m\n", "\u001b[32mindependent judiciary\u001b[0m\u001b[32m[\u001b[0m\u001b[32m257\u001b[0m\u001b[32m]\u001b[0m\u001b[32m comprising the supreme court, headed by the Chief Justice of India, 25\\xa0high courts, \u001b[0m\n", "\u001b[32mand a large number of trial courts.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m257\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The supreme court has original jurisdiction over cases involving \u001b[0m\n", "\u001b[32mfundamental rights and over disputes between states and the centre and has appellate jurisdiction over the high \u001b[0m\n", "\u001b[32mcourts.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m258\u001b[0m\u001b[32m]\u001b[0m\u001b[32m It has the power to both strike down union or state laws which contravene the constitution\u001b[0m\u001b[32m[\u001b[0m\u001b[32m259\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and \u001b[0m\n", "\u001b[32minvalidate any government action it deems \\n\\n### Administrative divisions\\n\\nMain article: Administrative \u001b[0m\n", "\u001b[32mdivisions of India\\n\\nSee also: Political integration of India\\n\\n\\n\\nA clickable map of the 28 states and 8 union \u001b[0m\n", "\u001b[32mterritories of India\\n\\nIndia is a federal union comprising 28 states and 8 union territories.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m12\u001b[0m\u001b[32m]\u001b[0m\u001b[32m All states, as \u001b[0m\n", "\u001b[32mwell as the union territories of Jammu and Kashmir, Puducherry and the National Capital Territory of Delhi, have \u001b[0m\n", "\u001b[32melected legislatures and governments following the Westminster system. The remaining five union territories are \u001b[0m\n", "\u001b[32mdirectly ruled by the central government through appointed administrators. In 1956, under the States Reorganisation\u001b[0m\n", "\u001b[32mAct, states were reorganised on a linguistic basis.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m261\u001b[0m\u001b[32m]\u001b[0m\u001b[32m There are over a quarter of a million local government \u001b[0m\n", "\u001b[32mbodies at city, town, block, district and village levels.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m262\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n#### States\\n\\n#### Union territories\\n\\nForeign,\u001b[0m\n", "\u001b[32meconomic, and strategic relations\\n\\n\\nMain article: Foreign relations of India\\n\\nSee also: Indian Armed \u001b[0m\n", "\u001b[32mForces\\n\\n\\n\\nDuring the 1950s and 60s, India played a pivotal role in the Non-Aligned Movement.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m263\u001b[0m\u001b[32m]\u001b[0m\u001b[32m From left to \u001b[0m\n", "\u001b[32mright: Gamal Abdel Nasser of United Arab Republic \u001b[0m\u001b[32m(\u001b[0m\u001b[32mnow Egypt\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, Josip Broz Tito of Yugoslavia and Jawaharlal Nehru \u001b[0m\n", "\u001b[32min Belgrade, September 1961.\\n\\nIndia became a republic in 1950, remaining a member of the Commonwealth of \u001b[0m\n", "\u001b[32mNations.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m264\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m265\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India strongly supported decolonisation in Africa and Asia in the 1950s; it played a leading \u001b[0m\n", "\u001b[32mrole in the Non-Aligned Movement.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m266\u001b[0m\u001b[32m]\u001b[0m\u001b[32m After cordial relations initially, India went to war with China in 1962. \u001b[0m\n", "\u001b[32mIndia was widely thought to have been humiliated.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m267\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Another military conflict followed in 1967 in which India \u001b[0m\n", "\u001b[32msuccessfully repelled a Chinese attack.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m268\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has had uneasy relations with its western neighbour, Pakistan. \u001b[0m\n", "\u001b[32mThe two countries went to war in 1947, 1965, 1971, and 1999. Three of these wars were fought over the disputed \u001b[0m\n", "\u001b[32mterritory of Kashmir. In contrast, the 1971 war followed India\\'s support for the independence of Bangladesh.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m269\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mAfter the 1965 war with Pakistan, India began to pursue close military and economic ties with the Soviet Union; by \u001b[0m\n", "\u001b[32mthe late 1960s, the Soviet Union was its largest arms supplier.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m270\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has played a key role in the South Asian\u001b[0m\n", "\u001b[32mAssociation for Regional Cooperation and the World Trade Organization. The nation has supplied 100,000 military and\u001b[0m\n", "\u001b[32mpolice personnel in 35 UN peacekeeping needed*\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n\\n\\nThe Indian Air Force contingent marching at the 221st \u001b[0m\n", "\u001b[32mBastille Day military parade in Paris, on 14 July 2009. The parade at which India was the foreign guest was led by \u001b[0m\n", "\u001b[32mIndia\\'s oldest regiment, the Maratha Light Infantry, founded in 1768.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m271\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nChina\\'s nuclear test of 1964 and \u001b[0m\n", "\u001b[32mthreats to intervene in support of Pakistan in the 1965 war caused India to produce nuclear weapons.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m272\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India \u001b[0m\n", "\u001b[32mconducted its first nuclear weapons test in 1974 and carried out additional underground testing in 1998. India has \u001b[0m\n", "\u001b[32msigned neither the Comprehensive Nuclear-Test-Ban Treaty nor the Nuclear Non-Proliferation Treaty, considering both\u001b[0m\n", "\u001b[32mto be flawed and discriminatory.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m273\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India maintains a \"no first use\" nuclear policy and is developing a nuclear \u001b[0m\n", "\u001b[32mtriad capability as a part of its \"Minimum Credible Deterrence\" doctrine.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m274\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m275\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nSince the end of the Cold \u001b[0m\n", "\u001b[32mWar, India has increased its economic, strategic, and military cooperation with the United States and the European \u001b[0m\n", "\u001b[32mUnion.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m276\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In 2008, a civilian nuclear agreement was signed between India and the United States. Although India \u001b[0m\n", "\u001b[32mpossessed nuclear weapons at the time and was not a party to the Nuclear Non-Proliferation Treaty, it received \u001b[0m\n", "\u001b[32mwaivers from the International Atomic Energy Agency and the Nuclear Suppliers Group, ending earlier restrictions on\u001b[0m\n", "\u001b[32mIndia\\'s nuclear technology and commerce; India subsequently signed co-operation agreements involving civilian \u001b[0m\n", "\u001b[32mnuclear energy with Russia,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m277\u001b[0m\u001b[32m]\u001b[0m\u001b[32m France,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m278\u001b[0m\u001b[32m]\u001b[0m\u001b[32m the United Kingdom,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m279\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and Canada.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m280\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe President of India \u001b[0m\n", "\u001b[32mis the supreme commander of the nation\\'s armed forces; with 1.45\\xa0million active troops, they compose the \u001b[0m\n", "\u001b[32mworld\\'s second-largest military. It comprises the Indian Army, the Indian Navy, the Indian Air Force, and the \u001b[0m\n", "\u001b[32mIndian Coast Guard.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m281\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The official Indian defence budget for 2011 was US$36.03\\xa0billion, or 1.83% of GDP.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m282\u001b[0m\u001b[32m]\u001b[0m\n", "\u001b[32mDefence expenditure was pegged at US$70.12\\xa0billion for fiscal year 2022â\\x80\\x9323 and, increased 9.8% than \u001b[0m\n", "\u001b[32mprevious fiscal year.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m283\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m284\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India is the world\\'s second-largest arms importer; between 2016 and 2020, it \u001b[0m\n", "\u001b[32maccounted for 9.5% of the total global arms imports.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m285\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Much of the military expenditure was focused on defence \u001b[0m\n", "\u001b[32magainst Pakistan and countering growing Chinese influence in the Indian Ocean.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m286\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nEconomy\\n-------\\n\\nMain \u001b[0m\n", "\u001b[32marticle: Economy of India\\n\\n\\n\\nIn 2019, 43% of India\\'s total workforce was employed in \u001b[0m\n", "\u001b[32magriculture.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m287\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n\\n\\nIndia is the world\\'s largest producer of milk, with the largest population of cattle. In \u001b[0m\n", "\u001b[32m2018, nearly 80% of India\\'s milk was sourced from small farms with herd size between one and two, the milk \u001b[0m\n", "\u001b[32mharvested by hand milking.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m289\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n\\n\\n55% of India\\'s female workforce was employed in agriculture in \u001b[0m\n", "\u001b[32m2019.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m288\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nAccording to the International Monetary Fund \u001b[0m\u001b[32m(\u001b[0m\u001b[32mIMF\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, the Indian economy in 2024 was nominally worth \u001b[0m\n", "\u001b[32m$3.94\\xa0trillion; it was the fifth-largest economy by market exchange rates and is, at around $15.0\\xa0trillion, \u001b[0m\n", "\u001b[32mthe third-largest by purchasing power parity \u001b[0m\u001b[32m(\u001b[0m\u001b[32mPPP\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m16\u001b[0m\u001b[32m]\u001b[0m\u001b[32m With its average annual GDP growth rate of 5.8% over the \u001b[0m\n", "\u001b[32mpast two decades, and reaching 6.1% during 2011â\\x80\\x932012,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m290\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India is one of the world\\'s fastest-growing \u001b[0m\n", "\u001b[32meconomies.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m291\u001b[0m\u001b[32m]\u001b[0m\u001b[32m However, due to its low GDP per capitaâ\\x80\\x94which ranks 136th in the world in nominal per capita\u001b[0m\n", "\u001b[32mincome and 125th in per capita income adjusted for purchasing power parity \u001b[0m\u001b[32m(\u001b[0m\u001b[32mPPP\u001b[0m\u001b[32m)\u001b[0m\u001b[32mâ\\x80\\x94the vast majority of \u001b[0m\n", "\u001b[32mIndians fall into the low-income group.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m292\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m293\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Until 1991, all Indian governments followed protectionist \u001b[0m\n", "\u001b[32mpolicies that were influenced by socialist economics. Widespread state intervention and regulation largely walled \u001b[0m\n", "\u001b[32mthe economy off from the outside world. An acute balance of payments crisis in 1991 forced the nation to liberalise\u001b[0m\n", "\u001b[32mits economy;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m294\u001b[0m\u001b[32m]\u001b[0m\u001b[32m since then, it has moved increasingly towards a free-market system\u001b[0m\u001b[32m[\u001b[0m\u001b[32m295\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m296\u001b[0m\u001b[32m]\u001b[0m\u001b[32m by emphasising both \u001b[0m\n", "\u001b[32mforeign trade and direct investment inflows.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m297\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has been a member of World Trade Organization since 1 \u001b[0m\n", "\u001b[32mJanuary 1995.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m298\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe 522-million-worker Indian labour force is the world\\'s second largest, as of \u001b[0m\n", "\u001b[32m2017\u001b[0m\u001b[32m[\u001b[0m\u001b[32mupdate\u001b[0m\u001b[32m]\u001b[0m\u001b[32m.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m281\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The service sector makes up 55.6% of GDP, the industrial sector 26.3% and the agricultural \u001b[0m\n", "\u001b[32msector 18.1%. India\\'s foreign exchange remittances of US$100 billion in 2022,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m299\u001b[0m\u001b[32m]\u001b[0m\u001b[32m highest in the world, were \u001b[0m\n", "\u001b[32mcontributed to its economy by 32 million Indians working in foreign countries.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m300\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In 2006, the share of external \u001b[0m\n", "\u001b[32mtrade in India\\'s GDP stood at 24%, up from 6% in 1985.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m295\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In 2008, India\\'s share of world trade was 1.7%;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m301\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mIn 2021, India was the world\\'s ninth-largest importer and the sixteenth-largest exporter.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m302\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Between 2001 and \u001b[0m\n", "\u001b[32m2011, the contribution of petrochemical and engineering goods to total exports grew from 14% to 42%.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m303\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India was\u001b[0m\n", "\u001b[32mthe world\\'s second-largest textile exporter after China in the 2013 calendar year.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m304\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nAveraging an economic \u001b[0m\n", "\u001b[32mgrowth rate of 7.5% for several years before 2007,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m295\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has more than doubled its hourly wage rates during \u001b[0m\n", "\u001b[32mthe first decade of the 21st century.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m305\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Some 431 million Indians have left poverty since 1985; India\\'s middle \u001b[0m\n", "\u001b[32mclasses are projected to number around 580\\xa0million by 2030.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m306\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In 2023, India\\'s consumer market was the \u001b[0m\n", "\u001b[32mworld\\'s fifth largest.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m307\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India\\'s nominal GDP per capita increased steadily from US$308 in 1991, when economic \u001b[0m\n", "\u001b[32mliberalisation began, to US$1,380 in 2010, to an estimated US$2,731 in 2024. It is expected to grow to US$3,264 by \u001b[0m\n", "\u001b[32m2026.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m16\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### Industries\\n\\n\\n\\nA tea garden in Sikkim. India, the world\\'s second-largest producer of tea, is a\u001b[0m\n", "\u001b[32mnation of one billion tea drinkers, who consume 70% of India\\'s tea output.\\n\\nThe Indian automotive industry, the \u001b[0m\n", "\u001b[32mworld\\'s second-fastest growing, increased domestic sales by 26% during 2009â\\x80\\x932010,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m308\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and exports by 36% \u001b[0m\n", "\u001b[32mduring 2008â\\x80\\x932009.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m309\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In 2022, India became the world\\'s third-largest vehicle market after China and the \u001b[0m\n", "\u001b[32mUnited States, surpassing Japan.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m310\u001b[0m\u001b[32m]\u001b[0m\u001b[32m At the end of 2011, the Indian IT industry employed 2.8\\xa0million \u001b[0m\n", "\u001b[32mprofessionals, generated revenues close to US$100\\xa0billion equalling 7.5% of Indian GDP, and contributed 26% of \u001b[0m\n", "\u001b[32mIndia\\'s merchandise exports.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m311\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe pharmaceutical industry in India includes 3,000 pharmaceutical companies \u001b[0m\n", "\u001b[32mand 10,500 manufacturing units; India is the world\\'s third-largest pharmaceutical producer, largest producer of \u001b[0m\n", "\u001b[32mgeneric medicines and supply up to 50â\\x80\\x9360% of global vaccines demand, these all contribute up to \u001b[0m\n", "\u001b[32mUS$24.44\\xa0billions in exports and India\\'s local pharmaceutical market is estimated up to \u001b[0m\n", "\u001b[32mUS$42\\xa0billion.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m312\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m313\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India is among the top 12 biotech destinations in the world.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m314\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m315\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The Indian \u001b[0m\n", "\u001b[32mbiotech industry grew by 15.1% in 2012â\\x80\\x932013, increasing its revenues from â\\x82¹204.4\\xa0billion \u001b[0m\u001b[32m(\u001b[0m\u001b[32mIndian \u001b[0m\n", "\u001b[32mrupees\u001b[0m\u001b[32m)\u001b[0m\u001b[32m to â\\x82¹235.24\\xa0billion \u001b[0m\u001b[32m(\u001b[0m\u001b[32mUS$3.94\\xa0billion at June 2013 exchange rates\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m316\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### Energy\\n\\nMain \u001b[0m\n", "\u001b[32marticle: Energy in India\\n\\nSee also: Energy policy of India\\n\\nIndia\\'s capacity to generate electrical power is \u001b[0m\n", "\u001b[32m300 gigawatts, of which 42 gigawatts is renewable.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m317\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The country\\'s usage of coal is a major cause of India\\'s \u001b[0m\n", "\u001b[32mgreenhouse gas emissions, but its renewable energy is competing \\xa0source\\xa0needed*\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India emits about 7% of \u001b[0m\n", "\u001b[32mglobal greenhouse gas emissions. This equates to about 2.5 tons of carbon dioxide per person per year, which is \u001b[0m\n", "\u001b[32mhalf the world average.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m319\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m320\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Increasing access to electricity and clean cooking with liquefied petroleum gas \u001b[0m\n", "\u001b[32mhave been priorities for energy in India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m321\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### Socio-economic challenges\\n\\nMain articles: Poverty in India,\u001b[0m\n", "\u001b[32mIncome inequality in India, and Debt bondage in India\\n\\n\\n\\nHealth workers about to begin another day of \u001b[0m\n", "\u001b[32mimmunisation against infectious diseases in 2006. Eight years later, and three years after India\\'s last case of \u001b[0m\n", "\u001b[32mpolio, the World Health Organization declared India to be polio-free.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m322\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nDespite economic growth during recent\u001b[0m\n", "\u001b[32mdecades, India continues to face socio-economic challenges. In 2006, India contained the largest number of people \u001b[0m\n", "\u001b[32mliving below the World Bank\\'s international poverty line of US$1.25 per day.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m323\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The proportion decreased from \u001b[0m\n", "\u001b[32m60% in 1981 to 42% in 2005.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m324\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Under the World Bank\\'s later revised poverty line, it was 21%-22.5 in \u001b[0m\n", "\u001b[32m2011.\u001b[0m\u001b[32m[\u001b[0m\u001b[32mp\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m326\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m327\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In 2019, the estimates had gone down to 10.2%.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m327\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In 2014, 30.7% of India\\'s children under \u001b[0m\n", "\u001b[32mthe age of five were underweight.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m328\u001b[0m\u001b[32m]\u001b[0m\u001b[32m According to a Food and Agriculture Organization report in 2015, 15% of the \u001b[0m\n", "\u001b[32mpopulation was The Midday Meal Scheme attempts to lower these rates.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m331\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nA 2018 Walk Free Foundation report \u001b[0m\n", "\u001b[32mestimated that nearly 8\\xa0million people in India were living in different forms of modern slavery, such as bonded\u001b[0m\n", "\u001b[32mlabour, child labour, human trafficking, and forced begging.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m332\u001b[0m\u001b[32m]\u001b[0m\u001b[32m According to the 2011 census, there were \u001b[0m\n", "\u001b[32m10.1\\xa0million child labourers in the country, a decline of 2.6\\xa0million from 12.6\\xa0million in \u001b[0m\n", "\u001b[32m2001.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m333\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nSince 1991, economic inequality between India\\'s states has consistently grown: the per-capita net \u001b[0m\n", "\u001b[32mstate domestic product of the richest states in 2007 was 3.2 times that of the poorest.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m334\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Corruption in India is\u001b[0m\n", "\u001b[32mperceived to have decreased. According to the Corruption Perceptions Index, India ranked 78th out of 180 countries \u001b[0m\n", "\u001b[32min 2018, an improvement from 85th in 2014.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m335\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m336\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nAs of 2025, poverty in India declined sharply. According to\u001b[0m\n", "\u001b[32mthe World Bank report, extreme poverty fall from 16.2% in 2011-12 to 2.3% in 2022-23. In rural areas it fell from \u001b[0m\n", "\u001b[32m18.4% to 2.8%, and in urban areas, from 10.7% to 1.1%. 378 million peopole were lifted from poverty and 171 million\u001b[0m\n", "\u001b[32mfrom extreme poverty. The main reason, according to the World Bank, is not economic growth but different government\u001b[0m\n", "\u001b[32mwelfare programs, like transferring food and money to the people with low income, improving their access to \u001b[0m\n", "\u001b[32mservices.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m172\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nDemographics, languages, and religion\\n\\n\\nMain articles: Demographics of India, Languages of \u001b[0m\n", "\u001b[32mIndia, and Religion in India\\n\\nSee also: South Asian ethnic groups\\n\\n\\n\\nA Sikh pilgrim at the Harmandir Sahib, \u001b[0m\n", "\u001b[32mor Golden Temple, in Amritsar, Punjab\\n\\n\\n\\nThe interior of San Thome Basilica, Chennai, Tamil Nadu. Christianity \u001b[0m\n", "\u001b[32mis believed to have been introduced to India by the late 2nd century by Syriac-speaking Christians.\\n\\nWith an \u001b[0m\n", "\u001b[32mestimated 1,428,627,663 residents in 2023, India is the world\\'s most populous country.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m13\u001b[0m\u001b[32m]\u001b[0m\u001b[32m 1,210,193,422 residents\u001b[0m\n", "\u001b[32mwere reported in the 2011 provisional census report.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m337\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Its population grew by 17.64% from 2001 to 2011,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m338\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mcompared to 21.54% growth in the previous decade \u001b[0m\u001b[32m(\u001b[0m\u001b[32m1991â\\x80\\x932001\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m338\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The human sex ratio, according to the \u001b[0m\n", "\u001b[32m2011 census, is 940 females per 1,000 males.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m337\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The median age was 28.7 in 2020.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m281\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The first post-colonial \u001b[0m\n", "\u001b[32mcensus, conducted in 1951, counted 361\\xa0million people.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m339\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Medical advances made in the last 50 years as well \u001b[0m\n", "\u001b[32mas increased agricultural productivity brought about by the \"Green Revolution\" have caused India\\'s population to \u001b[0m\n", "\u001b[32mgrow rapidly.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m340\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe life expectancy in India is at 70 yearsâ\\x80\\x9471.5 years for women, 68.7 years for \u001b[0m\n", "\u001b[32mmen.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m281\u001b[0m\u001b[32m]\u001b[0m\u001b[32m There are around 93 physicians per 100,000 people.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m341\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Migration from rural to urban areas has been an \u001b[0m\n", "\u001b[32mimportant dynamic in India\\'s recent history. The number of people living in urban areas grew by 31.2% between 1991\u001b[0m\n", "\u001b[32mand 2001.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m342\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Yet, in 2001, over 70% still lived in rural areas.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m343\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m344\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The level of urbanisation increased \u001b[0m\n", "\u001b[32mfurther from 27.81% in the 2001 Census to 31.16% in the 2011 Census. The slowing down of the overall population \u001b[0m\n", "\u001b[32mgrowth rate was due to the sharp decline in the growth rate in rural areas since 1991.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m345\u001b[0m\u001b[32m]\u001b[0m\u001b[32m According to the 2011 \u001b[0m\n", "\u001b[32mcensus, there are 53 million-plus urban agglomerations in India; among them Mumbai, Delhi, Kolkata, Chennai, \u001b[0m\n", "\u001b[32mBengaluru, Hyderabad and Ahmedabad, in decreasing order by population.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m346\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The literacy rate in 2011 was 74.04%: \u001b[0m\n", "\u001b[32m65.46% among females and 82.14% among males.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m347\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The rural-urban literacy gap, which was 21.2 percentage points in\u001b[0m\n", "\u001b[32m2001, dropped to 16.1 percentage points in 2011. The improvement in the rural literacy rate is twice that of urban \u001b[0m\n", "\u001b[32mareas.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m345\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Kerala is the most literate state with 93.91% literacy; while Bihar the least with \u001b[0m\n", "\u001b[32m63.82%.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m347\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nAmong speakers of the Indian languages, 74% speak Indo-Aryan languages, the easternmost branch of \u001b[0m\n", "\u001b[32mthe Indo-European languages; 24% speak Dravidian languages, indigenous to South Asia and spoken widely before the \u001b[0m\n", "\u001b[32mspread of Indo-Aryan languages and 2% speak Austroasiatic languages or the Sino-Tibetan languages. India has no \u001b[0m\n", "\u001b[32mnational language.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m348\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Hindi, with the largest number of speakers, is the official language of the English is \u001b[0m\n", "\u001b[32mused extensively in business and administration and has the status of a \"subsidiary official language\";\u001b[0m\u001b[32m[\u001b[0m\u001b[32m6\u001b[0m\u001b[32m]\u001b[0m\u001b[32m it is \u001b[0m\n", "\u001b[32mimportant in education, especially as a medium of higher education. Each state and union territory has one or more \u001b[0m\n", "\u001b[32mofficial languages, and the constitution recognises in particular 22 \"scheduled languages\".\\n\\nThe 2011 census \u001b[0m\n", "\u001b[32mreported the religion in India with the largest number of followers was Hinduism \u001b[0m\u001b[32m(\u001b[0m\u001b[32m79.80% of the population\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, \u001b[0m\n", "\u001b[32mfollowed by Islam \u001b[0m\u001b[32m(\u001b[0m\u001b[32m14.23%\u001b[0m\u001b[32m)\u001b[0m\u001b[32m; the remaining were Christianity \u001b[0m\u001b[32m(\u001b[0m\u001b[32m2.30%\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, Sikhism \u001b[0m\u001b[32m(\u001b[0m\u001b[32m1.72%\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, Buddhism \u001b[0m\u001b[32m(\u001b[0m\u001b[32m0.70%\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, Jainism \u001b[0m\n", "\u001b[32m(\u001b[0m\u001b[32m0.36%\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and others\u001b[0m\u001b[32m[\u001b[0m\u001b[32mq\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\u001b[32m(\u001b[0m\u001b[32m0.9%\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m11\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has the third-largest Muslim populationâ\\x80\\x94the largest for a \u001b[0m\n", "\u001b[32mnon-Muslim majority country.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m351\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m352\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nCulture\\n-------\\n\\nMain article: Culture of India\\n\\n### Visual \u001b[0m\n", "\u001b[32mart\\n\\nMain article: Indian art\\n\\nIndia has a very ancient tradition of art, which has exchanged many influences \u001b[0m\n", "\u001b[32mwith the rest of Eurasia, especially in the first millennium, when Buddhist art spread with Indian religions to \u001b[0m\n", "\u001b[32mCentral, East and Southeast Asia, the last also greatly influenced by Hindu art.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m353\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Thousands of seals from the \u001b[0m\n", "\u001b[32mIndus Valley Civilization of the third millennium BCE have been found, usually carved with animals, but also some \u001b[0m\n", "\u001b[32mwith human figures. The Pashupati seal, excavated in Mohenjo-daro, Pakistan, in 1928â\\x80\\x9329, is the best \u001b[0m\n", "\u001b[32mknown.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m354\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m355\u001b[0m\u001b[32m]\u001b[0m\u001b[32m After this there is a long period with virtually nothing surviving.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m355\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m356\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Almost all surviving\u001b[0m\n", "\u001b[32mancient Indian art thereafter is in various forms of religious sculpture in durable materials, or coins. There was \u001b[0m\n", "\u001b[32mprobably originally far more in wood, which is lost. In north India Mauryan art is the first imperial In the first\u001b[0m\n", "\u001b[32mmillennium CE, Buddhist art spread with Indian religions to Central, East and Southeast Asia, the last also greatly\u001b[0m\n", "\u001b[32minfluenced by Hindu art.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m360\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Over the following centuries a distinctly Indian style of sculpting the human figure \u001b[0m\n", "\u001b[32mdeveloped, with less interest in articulating precise anatomy than ancient Greek sculpture but showing smoothly \u001b[0m\n", "\u001b[32mflowing forms expressing *prana* \u001b[0m\u001b[32m(\u001b[0m\u001b[32m\"breath\" or This is often complicated by the need to give figures multiple arms \u001b[0m\n", "\u001b[32mor heads, or represent different genders on the left and right of figures, as with the Ardhanarishvara form of \u001b[0m\n", "\u001b[32mShiva and Parvati.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m363\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m364\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nMost of the earliest large sculpture is Buddhist, either excavated from Buddhist \u001b[0m\n", "\u001b[32mstupas such as Sanchi, Sarnath and Amaravati,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m365\u001b[0m\u001b[32m]\u001b[0m\u001b[32m or is rock cut reliefs at sites such as Ajanta, Karla and \u001b[0m\n", "\u001b[32mEllora. Hindu and Jain sites appear rather later.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m366\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m367\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In spite of this complex mixture of religious \u001b[0m\n", "\u001b[32mtraditions, generally, the prevailing artistic style at any time and place has been shared by the major religious \u001b[0m\n", "\u001b[32mgroups, and sculptors probably usually served all communities.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m368\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Gupta art, at its peak \u001b[0m\n", "\u001b[32mc.â\\x80\\x89300\\xa0CE\\xa0â\\x80\\x93 c.â\\x80\\x89500\\xa0CE, is often regarded as a classical period whose influence \u001b[0m\n", "\u001b[32mlingered for many centuries after; it saw a new dominance of Hindu sculpture, as at the Elephanta Caves.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m369\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m370\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mAcross the north, this became rather stiff and formulaic after c.â\\x80\\x89800\\xa0CE, though rich with finely carved\u001b[0m\n", "\u001b[32mdetail in the surrounds of statues.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m371\u001b[0m\u001b[32m]\u001b[0m\u001b[32m But in the South, under the Pallava and Chola dynasties, sculpture in both\u001b[0m\n", "\u001b[32mstone and bronze had a sustained period of great achievement; the large bronzes with Shiva as Nataraja have become \u001b[0m\n", "\u001b[32man iconic symbol of India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m372\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m373\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nAncient paintings have only survived at a few sites, of which the crowded \u001b[0m\n", "\u001b[32mscenes of court life in the Ajanta Caves are some of the most important.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m374\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m375\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Painted manuscripts of religious\u001b[0m\n", "\u001b[32mtexts survive from Eastern India from 10th century onwards, most of the earliest being Buddhist and later Jain. \u001b[0m\n", "\u001b[32mThese significantly influenced later artistic styles.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m376\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The Persian-derived Deccan painting, starting just \u001b[0m\n", "\u001b[32mbefore the Mughal miniature, between them give the first large body of secular painting, with an emphasis on \u001b[0m\n", "\u001b[32mportraits, and the recording of princely pleasures and wars.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m377\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m378\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The style spread to Hindu courts, especially\u001b[0m\n", "\u001b[32mamong the Rajputs, and developed a variety of styles, with the smaller courts often the most innovative, with \u001b[0m\n", "\u001b[32mfigures such as Nihâl Chand and Nainsukh.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m379\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m380\u001b[0m\u001b[32m]\u001b[0m\u001b[32m As a market developed among European residents, it was \u001b[0m\n", "\u001b[32msupplied by Company painting by Indian artists with considerable Western influence.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m381\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m382\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In the 19th century, \u001b[0m\n", "\u001b[32mcheap Kalighat paintings of gods and everyday life, done on paper, were urban folk art from Calcutta, which later \u001b[0m\n", "\u001b[32msaw the Bengal School of Art, reflecting the art colleges founded by the British, the first movement in modern \u001b[0m\n", "\u001b[32mIndian Society\\n\\nMain articles: Caste system in India and Gender inequality in India\\n\\n\\n\\nMuslims offer *namaz*\u001b[0m\n", "\u001b[32mat a mosque in Srinagar, Jammu and Kashmir.\\n\\nThe Indian caste system embodies much of the social stratification \u001b[0m\n", "\u001b[32mand many of the social restrictions found on the Indian subcontinent. Social classes are defined by thousands of \u001b[0m\n", "\u001b[32mendogamous hereditary groups, often termed as *jÄ\\x81tis*, or \"castes\".\u001b[0m\u001b[32m[\u001b[0m\u001b[32m385\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India abolished untouchability in 1950\u001b[0m\n", "\u001b[32mwith the adoption of the constitution and has since enacted other anti-discriminatory laws and social welfare \u001b[0m\n", "\u001b[32minitiatives.\u001b[0m\u001b[32m[\u001b[0m\u001b[32mr\u001b[0m\u001b[32m]\u001b[0m\u001b[32m However, the system continues to be dominant in India, and caste-based inequality, discrimination, \u001b[0m\n", "\u001b[32msegregation, and violence persist.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m387\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m388\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nMulti-generational patrilineal joint families have been the norm in\u001b[0m\n", "\u001b[32mIndia, though nuclear families are becoming common in urban areas.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m389\u001b[0m\u001b[32m]\u001b[0m\u001b[32m An overwhelming majority of Indians have \u001b[0m\n", "\u001b[32mtheir marriages arranged by their parents or other family elders.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m390\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Marriage is thought to be for life,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m390\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and\u001b[0m\n", "\u001b[32mthe divorce rate is extremely low,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m391\u001b[0m\u001b[32m]\u001b[0m\u001b[32m with less than one in a thousand marriages ending in divorce.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m392\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Child \u001b[0m\n", "\u001b[32mmarriages are common, especially in rural areas; many women wed before reaching 18, which is their legal \u001b[0m\n", "\u001b[32mmarriageable age.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m393\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Female infanticide in India, and lately female foeticide, have created skewed gender ratios;\u001b[0m\n", "\u001b[32mthe number of missing women in the country quadrupled from 15 million to 63\\xa0million in the 50 years ending in \u001b[0m\n", "\u001b[32m2014, faster than the population growth during the same period.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m394\u001b[0m\u001b[32m]\u001b[0m\u001b[32m According to an Indian government study, an \u001b[0m\n", "\u001b[32madditional 21 million girls are unwanted and do not receive adequate care.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m395\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Despite a government ban on \u001b[0m\n", "\u001b[32msex-selective foeticide, the practice remains commonplace in India, the result of a preference for boys in a \u001b[0m\n", "\u001b[32mpatriarchal society.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m396\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The payment of dowry, although illegal, remains widespread across class lines.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m397\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mDeaths resulting from dowry, mostly from bride burning, are on the rise, despite stringent anti-dowry \u001b[0m\n", "\u001b[32mlaws.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m398\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### Education\\n\\nMain article: Education in India\\n\\nSee also: Literacy in India and History of \u001b[0m\n", "\u001b[32meducation in the Indian subcontinent\\n\\n\\n\\nChildren awaiting school lunch in Rayka \u001b[0m\u001b[32m(\u001b[0m\u001b[32malso Raika\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, a village in \u001b[0m\n", "\u001b[32mrural Gujarat. The salutation *Jai Bhim* written on the blackboard honours the jurist, social reformer, and Dalit \u001b[0m\n", "\u001b[32mleader B. R. Ambedkar.\\n\\nIn the 2011 census, about 73% of the population was literate, with 81% for men and 65% \u001b[0m\n", "\u001b[32mfor women. This compares to 1981 when the respective rates were 41%, 53% and 29%. In 1951 the rates were 18%, 27% \u001b[0m\n", "\u001b[32mand 9%. In 1921 the rates 7%, 12% and 2%. In 1891 they were 5%, 9% and 1%,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m399\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m400\u001b[0m\u001b[32m]\u001b[0m\u001b[32m According to Latika Chaudhary,\u001b[0m\n", "\u001b[32min 1911 there were under three primary schools for every ten villages. Statistically, more caste and religious \u001b[0m\n", "\u001b[32mdiversity reduced private spending. Primary schools taught literacy, so local diversity limited its \u001b[0m\n", "\u001b[32mgrowth.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m401\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe education system of India is the world\\'s second-largest.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m402\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has over 900 universities,\u001b[0m\n", "\u001b[32m40,000 colleges\u001b[0m\u001b[32m[\u001b[0m\u001b[32m403\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and 1.5\\xa0million schools.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m404\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In India\\'s higher education system, a significant number of \u001b[0m\n", "\u001b[32mseats are reserved under affirmative action policies for the historically disadvantaged. In recent decades India\\'s\u001b[0m\n", "\u001b[32mimproved education system is often cited as one of the main contributors to its economic \\n\\n### Clothing\\n\\nMain \u001b[0m\n", "\u001b[32marticle: Clothing in India\\n\\n\\n\\nWomen in sari at an adult literacy class in Tamil Nadu\\n\\n\\n\\nWomen \u001b[0m\u001b[32m(\u001b[0m\u001b[32mfrom left to\u001b[0m\n", "\u001b[32mright\u001b[0m\u001b[32m)\u001b[0m\u001b[32m in churidars and kameez \u001b[0m\u001b[32m(\u001b[0m\u001b[32mwith back to the camera\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, jeans and sweater, and pink shalwar kameez\\n\\nFrom \u001b[0m\n", "\u001b[32mancient times until the advent of the modern, the most widely worn traditional dress in India was draped.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m407\u001b[0m\u001b[32m]\u001b[0m\u001b[32m For \u001b[0m\n", "\u001b[32mwomen it took the form of a sari, a single piece of cloth many yards long.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m407\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The sari was traditionally wrapped \u001b[0m\n", "\u001b[32maround the lower body and the shoulder.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m407\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In its modern form, it is combined with an underskirt, or Indian \u001b[0m\n", "\u001b[32mpetticoat, and tucked in the waist band for more secure fastening. It is also commonly worn with an Indian blouse, \u001b[0m\n", "\u001b[32mor choli, which serves as the primary upper-body garment, the sari\\'s endâ\\x80\\x94passing over the \u001b[0m\n", "\u001b[32mshoulderâ\\x80\\x94covering the midriff and obscuring the upper body\\'s contours.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m407\u001b[0m\u001b[32m]\u001b[0m\u001b[32m For men, a similar but shorter\u001b[0m\n", "\u001b[32mlength of cloth, the dhoti, has served as a lower-body garment.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m408\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe use of stitched clothes became \u001b[0m\n", "\u001b[32mwidespread after Muslim rule was established at first by the Delhi sultanate \u001b[0m\u001b[32m(\u001b[0m\u001b[32mc.â\\x80\\x891300 CE\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and then \u001b[0m\n", "\u001b[32mcontinued by the Mughal Empire \u001b[0m\u001b[32m(\u001b[0m\u001b[32mc.â\\x80\\x891525 CE\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m409\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Among the garments introduced during this time and still \u001b[0m\n", "\u001b[32mcommonly worn are: the shalwars and pyjamas, both styles of trousers, and the tunics kurta and kameez.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m409\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In \u001b[0m\n", "\u001b[32msouthern India, the traditional draped garments were to see much longer continuous use.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m409\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nSalwars are \u001b[0m\n", "\u001b[32matypically wide at the waist but narrow to a cuffed bottom. They are held up by a drawstring, which causes them to \u001b[0m\n", "\u001b[32mbecome pleated around the waist.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m410\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The pants can be wide and baggy, or they can be cut quite narrow, on the \u001b[0m\n", "\u001b[32mbias, in which case they are called churidars. When they are ordinarily wide at the waist and their bottoms are \u001b[0m\n", "\u001b[32mhemmed but not cuffed, they are called pyjamas. The kameez is a long shirt or tunic,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m411\u001b[0m\u001b[32m]\u001b[0m\u001b[32m its side seams left open \u001b[0m\n", "\u001b[32mbelow the waistline.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m412\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The kurta is traditionally collarless and made of cotton or silk; it is worn plain or \u001b[0m\n", "\u001b[32mwith embroidered decoration, such as chikan; and typically falls to either just above or just below the wearer\\'s \u001b[0m\n", "\u001b[32mknees.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m413\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIn the last 50 years, fashions have changed a great deal in India. Increasingly, in urban northern \u001b[0m\n", "\u001b[32mIndia, the sari is no longer the apparel of everyday wear, though they remain popular on formal occasions.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m414\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The\u001b[0m\n", "\u001b[32mtraditional shalwar kameez is rarely worn by younger urban women, who favour churidars or jeans.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m414\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In office \u001b[0m\n", "\u001b[32msettings, ubiquitous air conditioning allows men to wear sports jackets year-round.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m414\u001b[0m\u001b[32m]\u001b[0m\u001b[32m For weddings and formal \u001b[0m\n", "\u001b[32moccasions, men in the middle and upper classes often wear bandgala, or short Nehru jackets, with pants, with the \u001b[0m\n", "\u001b[32mgroom and his groomsmen sporting sherwanis and churidars.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m414\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The dhoti, once the universal garment of Hindu \u001b[0m\n", "\u001b[32mmales, the wearing of which in the homespun and handwoven khadi allowed Gandhi to bring Indian nationalism to the \u001b[0m\n", "\u001b[32mmillions,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m415\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\nis seldom seen in the cities.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m414\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### Cuisine\\n\\nMain article: Indian cuisine\\n\\n\\n\\nSouth \u001b[0m\n", "\u001b[32mIndian vegetarian thali, or platter\\n\\nThe foundation of a typical Indian meal is a cereal cooked plainly and \u001b[0m\n", "\u001b[32mcomplemented with flavourful savoury dishes.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m416\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The cooked cereal could be steamed rice; chapati, a thin \u001b[0m\n", "\u001b[32munleavened bread;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m417\u001b[0m\u001b[32m]\u001b[0m\u001b[32m the idli, a steamed breakfast cake; or dosa, a griddled pancake.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m418\u001b[0m\u001b[32m]\u001b[0m\u001b[32m The savoury dishes \u001b[0m\n", "\u001b[32mmight include lentils, pulses and vegetables commonly spiced with ginger and garlic, but also with a combination of\u001b[0m\n", "\u001b[32mspices that may include coriander, cumin, turmeric, cinnamon, cardamon and others.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m416\u001b[0m\u001b[32m]\u001b[0m\u001b[32m They might also include \u001b[0m\n", "\u001b[32mpoultry, fish, or meat dishes. In some instances, the ingredients may be mixed during the cooking \u001b[0m\n", "\u001b[32mprocess.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m419\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nA platter, or thali, used for eating usually has a central place reserved for the cooked cereal, \u001b[0m\n", "\u001b[32mand peripheral ones for the flavourful accompaniments. The cereal and its accompaniments are eaten simultaneously \u001b[0m\n", "\u001b[32mrather than a piecemeal manner. This is accomplished by mixingâ\\x80\\x94for example of rice and lentilsâ\\x80\\x94or \u001b[0m\n", "\u001b[32mfolding, wrapping, scooping or dippingâ\\x80\\x94such as chapati and cooked vegetables.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m416\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n\\n\\nA tandoor chef in\u001b[0m\n", "\u001b[32mthe Turkman Gate, Old Delhi, makes Khameeri roti \u001b[0m\u001b[32m(\u001b[0m\u001b[32ma Muslim-influenced style of leavened bread\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m420\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nIndia has \u001b[0m\n", "\u001b[32mdistinctive vegetarian cuisines, each a feature of the geographical and cultural histories of its adherents.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m421\u001b[0m\u001b[32m]\u001b[0m\u001b[32m \u001b[0m\n", "\u001b[32mAbout 20% to 39% of India\\'s population consists of Much of this stems from caste hierarchy, as upper castes, such\u001b[0m\n", "\u001b[32mas the Brahmins, consider vegetarian food to be \"pure\".\u001b[0m\u001b[32m[\u001b[0m\u001b[32m424\u001b[0m\u001b[32m]\u001b[0m\u001b[32m[\u001b[0m\u001b[32m425\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Although meat is eaten widely in India, the \u001b[0m\n", "\u001b[32mproportional consumption of meat in the overall diet is low.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m426\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Unlike China, which has increased its per capita \u001b[0m\n", "\u001b[32mmeat consumption substantially in its years of increased economic growth, in India the strong dietary traditions \u001b[0m\n", "\u001b[32mhave contributed to dairy, rather than meat, becoming the preferred form of animal protein consumption.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m427\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nThe\u001b[0m\n", "\u001b[32mmost significant import of cooking techniques into India during the last millennium occurred during the Mughal \u001b[0m\n", "\u001b[32mEmpire. Dishes such as the pilaf,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m428\u001b[0m\u001b[32m]\u001b[0m\u001b[32m developed in the Abbasid caliphate,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m429\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and cooking techniques such as the \u001b[0m\n", "\u001b[32mmarinating of meat in yogurt, spread into northern India from regions to its northwest.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m430\u001b[0m\u001b[32m]\u001b[0m\u001b[32m To the simple yogurt \u001b[0m\n", "\u001b[32mmarinade of Persia, onions, garlic, almonds, and spices began to be added in India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m430\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Rice was partially cooked \u001b[0m\n", "\u001b[32mand layered alternately with the sauteed meat, the pot sealed tightly, and slow cooked according to another Persian\u001b[0m\n", "\u001b[32mcooking technique, to produce what has today become biryani,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m430\u001b[0m\u001b[32m]\u001b[0m\u001b[32m a feature of festive dining in many parts of \u001b[0m\n", "\u001b[32mIndia.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m431\u001b[0m\u001b[32m]\u001b[0m\u001b[32m In the food served in Indian restaurants worldwide, the diversity of Indian food has been partially \u001b[0m\n", "\u001b[32mconcealed by the dominance of Punjabi cuisine. The popularity of tandoori chickenâ\\x80\\x94cooked in the tandoor \u001b[0m\n", "\u001b[32moven, which had traditionally been used for baking bread in the rural Punjab and the Delhi region, especially among\u001b[0m\n", "\u001b[32mMuslims, but which is originally from Central Asiaâ\\x80\\x94dates to the 1950s, and was caused in large part by an \u001b[0m\n", "\u001b[32mentrepreneurial response among people from the Punjab who had been displaced by the 1947 partition.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m421\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\n### \u001b[0m\n", "\u001b[32mSports and recreation\\n\\nMain article: Sport in India\\n\\nSee also: Indian physical culture\\n\\n\\n\\nGirls play \u001b[0m\n", "\u001b[32mhopscotch in Jaora, Madhya Pradesh. Hopscotch has been commonly played by girls in rural India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m432\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nSeveral \u001b[0m\n", "\u001b[32mtraditional sportsâ\\x80\\x94such as *kabaddi*, *kho kho*, pehlwani, *gilli-danda,* hopscotch and martial arts such \u001b[0m\n", "\u001b[32mas *Kalarippayattu* and *marma adiâ\\x80\\x94*remain popular. Chess is commonly held to have originated in India as \u001b[0m\n", "\u001b[32m*chaturaá¹\\x85ga*;\u001b[0m\u001b[32m[\u001b[0m\u001b[32m433\u001b[0m\u001b[32m]\u001b[0m\u001b[32m in recent years, there has been a rise in the number of Indian grandmasters,\u001b[0m\u001b[32m[\u001b[0m\u001b[32m434\u001b[0m\u001b[32m]\u001b[0m\u001b[32m and world\u001b[0m\n", "\u001b[32mchampions.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m435\u001b[0m\u001b[32m]\u001b[0m\u001b[32m Parcheesi is derived from *Pachisi*, another traditional Indian pastime, which in early modern \u001b[0m\n", "\u001b[32mtimes was played on a giant marble court by Mughal emperor Akbar the Great.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m436\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nCricket is the most popular \u001b[0m\n", "\u001b[32msport in India.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m437\u001b[0m\u001b[32m]\u001b[0m\u001b[32m India has won two Cricket World Cups, the 1983 edition and the 2011 edition. India has won \u001b[0m\n", "\u001b[32meight field hockey gold medals in the summer Olympics.\u001b[0m\u001b[32m[\u001b[0m\u001b[32m438\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\\n\\nSee \u001b[0m\n", "\u001b[32malso\\n--------Notes\\n-----\\n\\nReferences\\n----------\\n\\nBibliography\\n------------\\n\\n### Overview\\n\\n### \u001b[0m\n", "\u001b[32mEtymology\\n\\n### History\\n\\n### Geography\\n\\n### Biodiversity\\n\\n### Politics\\n\\n### Foreign relations and \u001b[0m\n", "\u001b[32mmilitary\\n\\n### Economy\\n\\n### Demographics\\n\\n### Art\\n\\n### Culture\\n\\nExternal \u001b[0m\n", "\u001b[32mlinks\\n--------------\\n\\n**India** at Wikipedia\\'s sister projects\\n\\n information**| India topics | |\\n| --- | ---\u001b[0m\n", "\u001b[32m|\\n| | History | | | --- | --- | | | | | | --- | --- | | Overviews | | | Ancient | | | Middle Kingdoms | | | \u001b[0m\n", "\u001b[32mMiddle Ages | | | Early Modern | | | Late modern | | | Republic | | | Contemporary | | | | | |\\n| | Geography \u001b[0m\n", "\u001b[32m| | | --- | --- | | | | | | --- | --- | | Geology | | | Heritage | | | Environment | | | Landforms | | | \u001b[0m\n", "\u001b[32mRegions | | | Subdivisions | | | See also | | | | | |\\n| | Politics | | | --- | --- | | | | | | --- | --- | | \u001b[0m\n", "\u001b[32mGovernment | | | Law | | | | | --- | --- | | | | | Enforcement | | | | | --- | --- | | Federal | | | \u001b[0m\n", "\u001b[32mIntelligence | | | | | Military | | | Politics | | | | | |\\n| | Economy | | | --- | --- | | | | | | --- | --- \u001b[0m\n", "\u001b[32m| | Companies | | | Governance | | | Currency | | | Financial services | | | History | | | People | | | \u001b[0m\n", "\u001b[32mStates | | | Sectors | | | Regulator | | | Other | | | | | |\\n| | | | | --- | --- | | | | | | --- | --- | | \u001b[0m\n", "\u001b[32mSociety | | | Culture | | | | | |\\n\\n| Related topics | |\\n| --- | --- |\\n| | States and union territories of \u001b[0m\n", "\u001b[32mIndia | | | --- | --- | | States | | | Union territories | | | | | | South Asian topics | | | --- | --- | | \u001b[0m\n", "\u001b[32mCountries and regions | | | Ethnic groups | | | Culture | | | Environment | | | Economy and Politics | | | \u001b[0m\n", "\u001b[32mHistory | | | Religion | | | Sports | | | Education | | | Military | | | Science and technology | | | \u001b[0m\n", "\u001b[32mMembers of the Commonwealth of Nations | | | --- | --- | | Sovereign states \u001b[0m\u001b[32m(\u001b[0m\u001b[32mmembers\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | | | Associated states | |\u001b[0m\n", "\u001b[32m| Dependent territories | | | | | --- | --- | | Australia | | | New Zealand | | | United Kingdom | | | | \u001b[0m\n", "\u001b[32mSource: Commonwealth Secretariat â\\x80\\x93 Member Countries | | | South Asian Association for Regional \u001b[0m\n", "\u001b[32mCooperation \u001b[0m\u001b[32m(\u001b[0m\u001b[32mSAARC\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | | | --- | --- | | Agreements | South Asian Free Trade Area | | Summits | | | Members | | | \u001b[0m\n", "\u001b[32mObservers | | | Guests | | | Specialised agencies | | | Related Articles | | | Group of Eight \u001b[0m\u001b[32m(\u001b[0m\u001b[32mG8\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and Group\u001b[0m\n", "\u001b[32mof Eight + Five \u001b[0m\u001b[32m(\u001b[0m\u001b[32mG8+5\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | | | --- | --- | | G8 members | | | Representative | | | G8+5 | | | See also | | | \u001b[0m\n", "\u001b[32mG20 major economies | | | --- | --- | | | | | BRICS | | | --- | --- | | Membership | | | Summits | | | \u001b[0m\n", "\u001b[32mLeaders | | | Sports | | | Related | | | East Asia Summit \u001b[0m\u001b[32m(\u001b[0m\u001b[32mEAS\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | | | --- | --- | | | | | | | | Shanghai\u001b[0m\n", "\u001b[32mCooperation Organisation \u001b[0m\u001b[32m(\u001b[0m\u001b[32mSCO\u001b[0m\u001b[32m)\u001b[0m\u001b[32m | | | --- | --- | | Summits | | | Member states | | | Observer states | | | \u001b[0m\n", "\u001b[32mDialogue partners | | | Guests | | | Applicants | | | See also | | | Countries and dependencies of Asia | | \u001b[0m\n", "\u001b[32m| --- | --- | | Sovereign states | | | States with limited recognition | | | Dependent territories | | | | | \u001b[0m\n", "\u001b[32m--- | --- | | Australia | | | Greece | | | United Kingdom | | | | Special administrative regions of China | | |\u001b[0m\n", "\u001b[32m| | | |\\n\\nPortals:\\n\\n| Authority control databases Edit this at Wikidata | |\\n| --- | --- |\\n| International | \u001b[0m\n", "\u001b[32m|\\n| National | |\\n| Geographic | |\\n| Academics | |\\n| Artists | |\\n| People | |\\n| Other | |\\n\\n21°N \u001b[0m\n", "\u001b[32m78°E / 21°N 78°E / 21; 78\\n\\n\\n\\nRetrieved from \\n\\nCategories:\\n\\nHidden \u001b[0m\n", "\u001b[32mcategories:\\n\\nSearch\\n\\nSearch\\n\\nIndia\\n\\n305 languages\\n\\nAdd topic'\u001b[0m\n", "\u001b[1m)\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Scrape content from URLs and convert to documents\n", "docs = await urls_to_docs([\n", " \"https://en.wikipedia.org/wiki/India\",\n", " \"https://en.wikipedia.org/wiki/Bangalore\"\n", "])\n", "print(f\"Loaded {len(docs)} documents.\")\n", "print(docs[0])" ] }, { "cell_type": "markdown", "id": "2215615d", "metadata": {}, "source": [ "## 6. Using Generative Models\n", "\n", "Initialize and use generative models like `ChatGoogleGenerativeAI` and `ChatOpenAI` for text generation tasks. The `get_generative_model` function helps you select and configure the model.\n", "\n", "\n", "### For local llms\n", "\n", "```python\n", "llmlocal = get_generative_model(\n", " model_name=\"google/gemma-3-12b\",\n", " type='local',\n", " base_url=\"http://127.0.0.1:1234/v1\", # for an example if you are running lmstudio locally\n", " _tools=None,\n", " kwargs={\n", " \"temperature\": 0.1, # Sampling temperature for generation.\n", " \"max_tokens\": None, # Maximum number of tokens to generate (None for default).\n", " \"timeout\": None, # Timeout for API requests (None for default).\n", " \"max_retries\": 2, # Maximum number of retries for failed requests.\n", " \"api_key\": \"dummy\", # API key for authentication.\n", " }\n", ")\n", "```\n", "\n", "You can even load local models from ollama etc, just configure openai compatible API server base url arg\n", "For other proprietary models as well, just configure the base_url arg accordingly with \"others\" as type\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "b2bbe90b", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[2025-09-01 01:32:28,531] WARNING langchain_google_genai.chat_models: Unexpected argument 'generation_config' provided to ChatGoogleGenerativeAI.\n", "[2025-09-01 01:32:28,531] WARNING langchain_google_genai.chat_models: Unexpected argument 'generation_config' provided to ChatGoogleGenerativeAI.\n", "/var/folders/sh/v0nx5vbx4mv07k1h4mxmwxcw0000gn/T/ipykernel_18168/4124600085.py:1: UserWarning: WARNING! generation_config is not default parameter.\n", " generation_config was transferred to model_kwargs.\n", " Please confirm that generation_config is what you intended.\n", " llmgoogle = get_generative_model(model_name='gemini-1.5-flash',\n" ] } ], "source": [ "llmgoogle = get_generative_model(model_name='gemini-1.5-flash',\n", " type='google',\n", " _tools=None,\n", " kwargs={'temperature': 0.1, 'max_tokens': None, 'timeout': None, 'max_retries': 2, \n", " 'api_key': os.environ['GOOGLE_API_KEY'],\n", " 'generation_config':{\"response_mime_type\": \"application/json\"}})" ] }, { "cell_type": "markdown", "id": "197edaf9", "metadata": {}, "source": [ "# 7. Query -> Search -> Scrape -> Response \n", "```query_web_response```, intelligently choses between to RAG and Summary of full page based on the request" ] }, { "cell_type": "code", "execution_count": 13, "id": "e5889dba", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[2025-07-27 12:06:02,440] INFO utils.answer_generation: Summary:True,subquery:['Top science news today', 'Top technology news today', 'Links to news articles', 'Summary of science news', 'Summary of technology news', 'Date of news articles'], iscoverd:False\n", "[2025-07-27 12:06:02,440] INFO utils.answer_generation: Summary:True,subquery:['Top science news today', 'Top technology news today', 'Links to news articles', 'Summary of science news', 'Summary of technology news', 'Date of news articles'], iscoverd:False\n", "[2025-07-27 12:06:02,442] INFO utils.websearch_utils: Search phrases for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line': ['top science news today', 'top technology news today', 'links to news articles', 'summary of science news', 'summary of technology news', 'date of news articles']\n", "[2025-07-27 12:06:02,442] INFO utils.websearch_utils: Search phrases for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line': ['top science news today', 'top technology news today', 'links to news articles', 'summary of science news', 'summary of technology news', 'date of news articles']\n", "[2025-07-27 12:06:03,262] INFO utils.websearch_utils: Search results for query 'top science news today': [{'snippet': 'Science News features news articles, videos and more about the latest scientific advances. Independent, accurate nonprofit news since 1921.', 'title': 'Science News | The latest news from all areas of science', 'link': 'https://www.sciencenews.org/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:03,262] INFO utils.websearch_utils: Search results for query 'top science news today': [{'snippet': 'Science News features news articles, videos and more about the latest scientific advances. Independent, accurate nonprofit news since 1921.', 'title': 'Science News | The latest news from all areas of science', 'link': 'https://www.sciencenews.org/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:03,264] INFO utils.websearch_utils: Search results fetched for subquery: top science news today\n", "[2025-07-27 12:06:03,264] INFO utils.websearch_utils: Search results fetched for subquery: top science news today\n", "[2025-07-27 12:06:04,509] INFO utils.websearch_utils: Search results for query 'top technology news today': [{'snippet': \"TECHNOLOGY NEWS · Meet Lumo, the new AI chatbot that protects user privacy · Huawei shows off AI computing system to rival Nvidia's top product · Under Rs 30,000: ...\", 'title': 'Technology News - Gadgets', 'link': 'https://indianexpress.com/section/technology/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:04,509] INFO utils.websearch_utils: Search results for query 'top technology news today': [{'snippet': \"TECHNOLOGY NEWS · Meet Lumo, the new AI chatbot that protects user privacy · Huawei shows off AI computing system to rival Nvidia's top product · Under Rs 30,000: ...\", 'title': 'Technology News - Gadgets', 'link': 'https://indianexpress.com/section/technology/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:04,510] INFO utils.websearch_utils: Search results fetched for subquery: top technology news today\n", "[2025-07-27 12:06:04,510] INFO utils.websearch_utils: Search results fetched for subquery: top technology news today\n", "[2025-07-27 12:06:05,089] INFO utils.websearch_utils: Search results for query 'links to news articles': [{'snippet': \"Today's news: Get latest and Breaking News on Politics, Business, Lifestyle, Entertainment and Sports along with News updates from around the world.\", 'title': 'Latest News Today: Breaking News and Top Headlines from ...', 'link': 'https://indianexpress.com/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:05,089] INFO utils.websearch_utils: Search results for query 'links to news articles': [{'snippet': \"Today's news: Get latest and Breaking News on Politics, Business, Lifestyle, Entertainment and Sports along with News updates from around the world.\", 'title': 'Latest News Today: Breaking News and Top Headlines from ...', 'link': 'https://indianexpress.com/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:05,091] INFO utils.websearch_utils: Search results fetched for subquery: links to news articles\n", "[2025-07-27 12:06:05,091] INFO utils.websearch_utils: Search results fetched for subquery: links to news articles\n", "[2025-07-27 12:06:05,707] INFO utils.websearch_utils: Search results for query 'summary of science news': [{'snippet': 'Science News features news articles, videos and more about the latest scientific advances. Independent, accurate nonprofit news since 1921.', 'title': 'Science News | The latest news from all areas of science', 'link': 'https://www.sciencenews.org/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:05,707] INFO utils.websearch_utils: Search results for query 'summary of science news': [{'snippet': 'Science News features news articles, videos and more about the latest scientific advances. Independent, accurate nonprofit news since 1921.', 'title': 'Science News | The latest news from all areas of science', 'link': 'https://www.sciencenews.org/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:05,709] INFO utils.websearch_utils: Search results fetched for subquery: summary of science news\n", "[2025-07-27 12:06:05,709] INFO utils.websearch_utils: Search results fetched for subquery: summary of science news\n", "[2025-07-27 12:06:06,176] INFO utils.websearch_utils: Search results for query 'summary of technology news': [{'snippet': \"TECHNOLOGY NEWS · Meet Lumo, the new AI chatbot that protects user privacy · Huawei shows off AI computing system to rival Nvidia's top product · Under Rs 30,000: ...\", 'title': 'Technology News - Gadgets', 'link': 'https://indianexpress.com/section/technology/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:06,176] INFO utils.websearch_utils: Search results for query 'summary of technology news': [{'snippet': \"TECHNOLOGY NEWS · Meet Lumo, the new AI chatbot that protects user privacy · Huawei shows off AI computing system to rival Nvidia's top product · Under Rs 30,000: ...\", 'title': 'Technology News - Gadgets', 'link': 'https://indianexpress.com/section/technology/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:06,178] INFO utils.websearch_utils: Search results fetched for subquery: summary of technology news\n", "[2025-07-27 12:06:06,178] INFO utils.websearch_utils: Search results fetched for subquery: summary of technology news\n", "[2025-07-27 12:06:06,755] INFO utils.websearch_utils: Search results for query 'date of news articles': [{'snippet': 'Breaking News in India: Read Latest News on Sports, Business, Entertainment, Blogs and Opinions from leading columnists. Times of India brings the Breaking ...', 'title': 'Times of India: News - Breaking News, Latest News, India ...', 'link': 'https://timesofindia.indiatimes.com/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:06,755] INFO utils.websearch_utils: Search results for query 'date of news articles': [{'snippet': 'Breaking News in India: Read Latest News on Sports, Business, Entertainment, Blogs and Opinions from leading columnists. Times of India brings the Breaking ...', 'title': 'Times of India: News - Breaking News, Latest News, India ...', 'link': 'https://timesofindia.indiatimes.com/', 'engines': ['google'], 'category': 'general'}]\n", "[2025-07-27 12:06:06,757] INFO utils.websearch_utils: Search results fetched for subquery: date of news articles\n", "[2025-07-27 12:06:06,757] INFO utils.websearch_utils: Search results fetched for subquery: date of news articles\n", "[2025-07-27 12:06:06,758] INFO utils.websearch_utils: Created Document for source: https://www.sciencenews.org/\n", "[2025-07-27 12:06:06,758] INFO utils.websearch_utils: Created Document for source: https://www.sciencenews.org/\n", "[2025-07-27 12:06:06,759] INFO utils.websearch_utils: Created Document for source: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:06,759] INFO utils.websearch_utils: Created Document for source: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:06,760] INFO utils.websearch_utils: Created Document for source: https://indianexpress.com/\n", "[2025-07-27 12:06:06,760] INFO utils.websearch_utils: Created Document for source: https://indianexpress.com/\n", "[2025-07-27 12:06:06,761] INFO utils.websearch_utils: Created Document for source: https://www.sciencenews.org/\n", "[2025-07-27 12:06:06,761] INFO utils.websearch_utils: Created Document for source: https://www.sciencenews.org/\n", "[2025-07-27 12:06:06,762] INFO utils.websearch_utils: Created Document for source: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:06,762] INFO utils.websearch_utils: Created Document for source: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:06,763] INFO utils.websearch_utils: Created Document for source: https://timesofindia.indiatimes.com/\n", "[2025-07-27 12:06:06,763] INFO utils.websearch_utils: Created Document for source: https://timesofindia.indiatimes.com/\n", "[2025-07-27 12:06:06,764] INFO utils.websearch_utils: Search results fetched for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line'.\n", "[2025-07-27 12:06:06,764] INFO utils.websearch_utils: Search results fetched for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line'.\n", "[2025-07-27 12:06:06,764] INFO utils.websearch_utils: Starting context_to_docs for 6 URL groups.\n", "[2025-07-27 12:06:06,764] INFO utils.websearch_utils: Starting context_to_docs for 6 URL groups.\n", "/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n", " warnings.warn('resource_tracker: process died unexpectedly, '\n", "[2025-07-27 12:06:06,786] INFO utils.websearch_utils: Fetching URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:06,786] INFO utils.websearch_utils: Fetching URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:06,788] INFO utils.websearch_utils: Fetching URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:06,788] INFO utils.websearch_utils: Fetching URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:06,792] INFO utils.websearch_utils: Fetching URL: https://indianexpress.com/\n", "[2025-07-27 12:06:06,792] INFO utils.websearch_utils: Fetching URL: https://indianexpress.com/\n", "[2025-07-27 12:06:06,793] INFO utils.websearch_utils: Fetching URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:06,793] INFO utils.websearch_utils: Fetching URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:06,796] INFO utils.websearch_utils: Fetching URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:06,796] INFO utils.websearch_utils: Fetching URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:06,797] ERROR utils.websearch_utils: Error processing https://timesofindia.indiatimes.com/: [Errno 32] Broken pipe\n", "[2025-07-27 12:06:06,797] ERROR utils.websearch_utils: Error processing https://timesofindia.indiatimes.com/: [Errno 32] Broken pipe\n", "[2025-07-27 12:06:06,802] ERROR utils.websearch_utils: An error occurred with URL https://timesofindia.indiatimes.com/: 'NoneType' object has no attribute 'replace'\n", "[2025-07-27 12:06:06,802] ERROR utils.websearch_utils: An error occurred with URL https://timesofindia.indiatimes.com/: 'NoneType' object has no attribute 'replace'\n", "[2025-07-27 12:06:06,875] INFO utils.websearch_utils: Fetched content from https://indianexpress.com/section/technology/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:06,875] INFO utils.websearch_utils: Fetched content from https://indianexpress.com/section/technology/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:06,908] INFO utils.websearch_utils: Fetched content from https://indianexpress.com/section/technology/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:06,908] INFO utils.websearch_utils: Fetched content from https://indianexpress.com/section/technology/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:06,911] INFO utils.websearch_utils: Fetched content from https://indianexpress.com/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:06,911] INFO utils.websearch_utils: Fetched content from https://indianexpress.com/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:08,111] INFO utils.websearch_utils: Fetched content from https://www.sciencenews.org/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:08,111] INFO utils.websearch_utils: Fetched content from https://www.sciencenews.org/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:08,179] INFO utils.websearch_utils: Fetched content from https://www.sciencenews.org/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:08,179] INFO utils.websearch_utils: Fetched content from https://www.sciencenews.org/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:08,778] INFO utils.websearch_utils: Processed markdown for: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:08,778] INFO utils.websearch_utils: Processed markdown for: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:08,781] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:08,781] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:08,828] INFO utils.websearch_utils: Processed markdown for: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:08,828] INFO utils.websearch_utils: Processed markdown for: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:08,830] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:08,830] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:08,868] INFO utils.websearch_utils: Processed markdown for: https://indianexpress.com/\n", "[2025-07-27 12:06:08,868] INFO utils.websearch_utils: Processed markdown for: https://indianexpress.com/\n", "[2025-07-27 12:06:08,869] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://indianexpress.com/\n", "[2025-07-27 12:06:08,869] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://indianexpress.com/\n", "[2025-07-27 12:06:09,314] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:09,314] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:09,321] INFO utils.websearch_utils: Processed 1 docs for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:09,321] INFO utils.websearch_utils: Processed 1 docs for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:09,322] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:09,322] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:09,323] INFO utils.websearch_utils: Encoding start for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:09,323] INFO utils.websearch_utils: Encoding start for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:09,327] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,327] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,327] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,377] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:09,377] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:09,378] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:09,378] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:09,386] INFO utils.websearch_utils: Processed 1 docs for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:09,386] INFO utils.websearch_utils: Processed 1 docs for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:09,386] INFO utils.websearch_utils: Processed 1 docs for URL: https://indianexpress.com/\n", "[2025-07-27 12:06:09,386] INFO utils.websearch_utils: Processed 1 docs for URL: https://indianexpress.com/\n", "[2025-07-27 12:06:09,387] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:09,387] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:09,392] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:09,392] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:09,393] INFO utils.websearch_utils: Encoding start for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:09,394] INFO utils.websearch_utils: Encoding start for URL: https://indianexpress.com/\n", "[2025-07-27 12:06:09,393] INFO utils.websearch_utils: Encoding start for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:09,396] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,394] INFO utils.websearch_utils: Encoding start for URL: https://indianexpress.com/\n", "[2025-07-27 12:06:09,396] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,397] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,396] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,397] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,406] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,397] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,406] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,406] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:09,950] INFO utils.websearch_utils: Processed markdown for: https://www.sciencenews.org/\n", "[2025-07-27 12:06:09,950] INFO utils.websearch_utils: Processed markdown for: https://www.sciencenews.org/\n", "[2025-07-27 12:06:09,950] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:09,950] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,029] INFO utils.websearch_utils: Processed markdown for: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,029] INFO utils.websearch_utils: Processed markdown for: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,030] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,030] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,286] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:10,286] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:10,289] INFO utils.websearch_utils: Processed 1 docs for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,289] INFO utils.websearch_utils: Processed 1 docs for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,290] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:10,290] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:10,291] INFO utils.websearch_utils: Encoding start for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,291] INFO utils.websearch_utils: Encoding start for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,293] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:10,293] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:10,293] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:10,412] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:10,412] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:10,416] INFO utils.websearch_utils: Processed 1 docs for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,416] INFO utils.websearch_utils: Processed 1 docs for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,417] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:10,417] INFO utils.websearch_utils: URLs and markdown links removed from text.\n", "[2025-07-27 12:06:10,417] INFO utils.websearch_utils: Encoding start for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,417] INFO utils.websearch_utils: Encoding start for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:10,418] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:10,418] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:10,418] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:11,019] INFO utils.websearch_utils: Encoding end for URL: https://indianexpress.com/section/technology/, Time taken: 1.63 seconds\n", "[2025-07-27 12:06:11,019] INFO utils.websearch_utils: Encoding end for URL: https://indianexpress.com/section/technology/, Time taken: 1.63 seconds\n", "[2025-07-27 12:06:11,029] INFO utils.websearch_utils: Encoding end for URL: https://www.sciencenews.org/, Time taken: 0.74 seconds\n", "[2025-07-27 12:06:11,035] INFO utils.websearch_utils: Encoding end for URL: https://indianexpress.com/section/technology/, Time taken: 1.71 seconds\n", "[2025-07-27 12:06:11,029] INFO utils.websearch_utils: Encoding end for URL: https://www.sciencenews.org/, Time taken: 0.74 seconds\n", "[2025-07-27 12:06:11,036] INFO utils.websearch_utils: Reranking start for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:11,035] INFO utils.websearch_utils: Encoding end for URL: https://indianexpress.com/section/technology/, Time taken: 1.71 seconds\n", "[2025-07-27 12:06:11,036] INFO utils.websearch_utils: Reranking start for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:11,036] INFO utils.websearch_utils: Reranking start for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:11,037] INFO utils.websearch_utils: Reranking start for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:11,036] INFO utils.websearch_utils: Reranking start for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:11,037] INFO utils.websearch_utils: Reranking end for URL: https://indianexpress.com/section/technology/, Time taken: 0.00 seconds\n", "[2025-07-27 12:06:11,037] INFO utils.websearch_utils: Reranking start for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:11,038] INFO utils.websearch_utils: Reranking end for URL: https://www.sciencenews.org/, Time taken: 0.00 seconds\n", "[2025-07-27 12:06:11,037] INFO utils.websearch_utils: Reranking end for URL: https://indianexpress.com/section/technology/, Time taken: 0.00 seconds\n", "[2025-07-27 12:06:11,038] INFO utils.websearch_utils: Reranking end for URL: https://indianexpress.com/section/technology/, Time taken: 0.00 seconds\n", "[2025-07-27 12:06:11,038] INFO utils.websearch_utils: Reranking end for URL: https://www.sciencenews.org/, Time taken: 0.00 seconds\n", "[2025-07-27 12:06:11,038] INFO utils.websearch_utils: Reranking end for URL: https://indianexpress.com/section/technology/, Time taken: 0.00 seconds\n", "[2025-07-27 12:06:11,253] INFO utils.websearch_utils: Encoding end for URL: https://indianexpress.com/, Time taken: 1.86 seconds\n", "[2025-07-27 12:06:11,253] INFO utils.websearch_utils: Encoding end for URL: https://indianexpress.com/, Time taken: 1.86 seconds\n", "[2025-07-27 12:06:11,254] INFO utils.websearch_utils: Reranking start for URL: https://indianexpress.com/\n", "[2025-07-27 12:06:11,254] INFO utils.websearch_utils: Reranking start for URL: https://indianexpress.com/\n", "[2025-07-27 12:06:11,254] INFO utils.websearch_utils: Reranking end for URL: https://indianexpress.com/, Time taken: 0.00 seconds\n", "[2025-07-27 12:06:11,254] INFO utils.websearch_utils: Reranking end for URL: https://indianexpress.com/, Time taken: 0.00 seconds\n", "[2025-07-27 12:06:11,866] INFO utils.websearch_utils: Encoding end for URL: https://www.sciencenews.org/, Time taken: 1.45 seconds\n", "[2025-07-27 12:06:11,866] INFO utils.websearch_utils: Encoding end for URL: https://www.sciencenews.org/, Time taken: 1.45 seconds\n", "[2025-07-27 12:06:11,867] INFO utils.websearch_utils: Reranking start for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:11,867] INFO utils.websearch_utils: Reranking start for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:11,868] INFO utils.websearch_utils: Reranking end for URL: https://www.sciencenews.org/, Time taken: 0.00 seconds\n", "[2025-07-27 12:06:11,868] INFO utils.websearch_utils: Reranking end for URL: https://www.sciencenews.org/, Time taken: 0.00 seconds\n", "Batches: 100%|██████████| 1/1 [00:00<00:00, 12.64it/s]\n", "[2025-07-27 12:06:12,186] INFO utils.websearch_utils: Retrieved 1 docs for https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,186] INFO utils.websearch_utils: Retrieved 1 docs for https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,187] INFO utils.websearch_utils: Built context for https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,187] INFO utils.websearch_utils: Built context for https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,188] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,188] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://indianexpress.com/section/technology/\n", "Batches: 0%| | 0/1 [00:00, ?it/s]\n", "Batches: 100%|██████████| 1/1 [00:00<00:00, 8.71it/s]\n", "[2025-07-27 12:06:12,833] INFO utils.websearch_utils: Retrieved 1 docs for https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,833] INFO utils.websearch_utils: Retrieved 1 docs for https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,834] INFO utils.websearch_utils: Built context for https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,834] INFO utils.websearch_utils: Built context for https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,835] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://indianexpress.com/section/technology/\n", "[2025-07-27 12:06:12,835] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://indianexpress.com/section/technology/\n", "\n", "Batches: 100%|██████████| 1/1 [00:00<00:00, 3.94it/s]\n", "[2025-07-27 12:06:12,838] INFO utils.websearch_utils: Retrieved 1 docs for https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,838] INFO utils.websearch_utils: Retrieved 1 docs for https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,839] INFO utils.websearch_utils: Built context for https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,839] INFO utils.websearch_utils: Built context for https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,840] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,840] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://www.sciencenews.org/\n", "Batches: 100%|██████████| 1/1 [00:00<00:00, 3.42it/s]\n", "[2025-07-27 12:06:12,892] INFO utils.websearch_utils: Retrieved 1 docs for https://indianexpress.com/\n", "[2025-07-27 12:06:12,892] INFO utils.websearch_utils: Retrieved 1 docs for https://indianexpress.com/\n", "[2025-07-27 12:06:12,940] INFO utils.websearch_utils: Built context for https://indianexpress.com/\n", "[2025-07-27 12:06:12,940] INFO utils.websearch_utils: Built context for https://indianexpress.com/\n", "[2025-07-27 12:06:12,942] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://indianexpress.com/\n", "[2025-07-27 12:06:12,942] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://indianexpress.com/\n", "Batches: 100%|██████████| 1/1 [00:00<00:00, 5.79it/s]\n", "[2025-07-27 12:06:12,963] INFO utils.websearch_utils: Retrieved 1 docs for https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,963] INFO utils.websearch_utils: Retrieved 1 docs for https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,965] INFO utils.websearch_utils: Built context for https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,965] INFO utils.websearch_utils: Built context for https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,973] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,973] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://www.sciencenews.org/\n", "[2025-07-27 12:06:12,976] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 5, total docs: 5\n", "[2025-07-27 12:06:12,976] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 5, total docs: 5\n", "[2025-07-27 12:06:12,976] INFO utils.websearch_utils: Context generated to answer query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line'.\n", "[2025-07-27 12:06:12,976] INFO utils.websearch_utils: Context generated to answer query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line'.\n", "[2025-07-27 12:06:12,977] INFO utils.utils: Logging results for query: Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line\n", "[2025-07-27 12:06:12,977] INFO utils.utils: Logging results for query: Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line\n", "[2025-07-27 12:06:12,979] INFO utils.websearch_utils: Logged results for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line'.\n", "[2025-07-27 12:06:12,979] INFO utils.websearch_utils: Logged results for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line'.\n", "[2025-07-27 12:06:12,980] INFO utils.websearch_utils: Generating summary for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line' using summarizer.\n", "[2025-07-27 12:06:12,980] INFO utils.websearch_utils: Generating summary for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line' using summarizer.\n", "[2025-07-27 12:06:12,980] INFO utils.answer_generation: Deduping docs: 5\n", "[2025-07-27 12:06:12,980] INFO utils.answer_generation: Deduping docs: 5\n", "[2025-07-27 12:06:12,981] WARNING utils.answer_generation: Capping max words to 6000\n", "[2025-07-27 12:06:12,981] WARNING utils.answer_generation: Capping max words to 6000\n", "[2025-07-27 12:06:12,981] INFO utils.answer_generation: Arrived Len of Docs: 3\n", "[2025-07-27 12:06:12,981] INFO utils.answer_generation: Arrived Len of Docs: 3\n" ] }, { "data": { "text/html": [ "
Summarising using 3 documents\n",
"\n"
],
"text/plain": [
"Summarising using \u001b[1;36m3\u001b[0m documents\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:06:19,947] INFO utils.websearch_utils: Response generated for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line'.\n",
"[2025-07-27 12:06:19,947] INFO utils.websearch_utils: Response generated for query 'Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line'.\n"
]
},
{
"data": {
"text/html": [
"Top Science and Technology News of Today (July 27, 2025):\n", "\n", "**Note:** The provided text does not contain specific dates for most articles, so I'm assuming today's date, July \n", "27th, 2025, for all entries. Links are not directly provided in the text, only source websites. I will provide \n", "summaries in one line where possible.\n", "\n", "\n", "**From ScienceNews.org:**\n", "\n", "1. **Maggots may have been on the Neandertal menu:** A study suggests Neandertals may have eaten maggots for \n", "nutritional benefits. [Link: https://www.sciencenews.org/](This link is only the website, not a direct article \n", "link.)\n", "2. **This desert beetle runs to cool off:** A desert beetle uses running to regulate its body temperature. [Link:\n", "https://www.sciencenews.org/](This link is only the website, not a direct article link.)\n", "3. **AI is designing proteins that could help treat cancer:** Artificial intelligence is being used to develop \n", "cancer-fighting proteins. [Link: https://www.sciencenews.org/](This link is only the website, not a direct article \n", "link.)\n", "4. **An injected gel could make drugs like Ozempic last longer:** A new gel could extend the effectiveness of \n", "medications like Ozempic. [Link: https://www.sciencenews.org/](This link is only the website, not a direct article \n", "link.)\n", "5. **How many steps a day do you really need to take?:** A discussion on the optimal number of daily steps for \n", "health benefits. [Link: https://www.sciencenews.org/](This link is only the website, not a direct article link.)\n", "6. **Climate change may be pushing fungal allergy season earlier:** Climate change is potentially affecting the \n", "timing of fungal allergy seasons. [Link: https://www.sciencenews.org/](This link is only the website, not a direct \n", "article link.)\n", "7. **AI reveals new details about a famous Latin inscription:** Artificial intelligence helps uncover new \n", "information from an ancient Latin inscription. [Link: https://www.sciencenews.org/](This link is only the website, \n", "not a direct article link.)\n", "\n", "\n", "**From IndianExpress.com (Technology Section):**\n", "\n", "1. **Amazfit Active 2 (Square) review:** A review of the Amazfit Active 2 Square smartwatch. [Link: \n", "https://indianexpress.com/section/technology/](This link is only the website, not a direct article link.)\n", "2. **Gemini on Galaxy Watch review:** A user experience review of using the Gemini AI assistant on a Galaxy \n", "Watch. [Link: https://indianexpress.com/section/technology/](This link is only the website, not a direct article \n", "link.)\n", "3. **SpaceX launches more Starlink satellites:** SpaceX added 52 more Starlink satellites to its constellation. \n", "[Link: https://indianexpress.com/section/technology/](This link is only the website, not a direct article link.)\n", "4. **New theory predicts a Big Crunch:** A new cosmological theory suggests a potential \"Big Crunch\" in the \n", "distant future. [Link: https://indianexpress.com/section/technology/](This link is only the website, not a direct \n", "article link.)\n", "\n", "\n", "**Assumptions Made:**\n", "\n", "* All articles from both sources are assumed to be from July 27, 2025, as the provided text lacks specific dates \n", "for most articles.\n", "* The links provided are to the source websites, not direct links to individual articles. Finding the exact \n", "articles would require navigating the websites.\n", "\n" ], "text/plain": [ "Top Science and Technology News of Today \u001b[1m(\u001b[0mJuly \u001b[1;36m27\u001b[0m, \u001b[1;36m2025\u001b[0m\u001b[1m)\u001b[0m:\n", "\n", "**Note:** The provided text does not contain specific dates for most articles, so I'm assuming today's date, July \n", "27th, \u001b[1;36m2025\u001b[0m, for all entries. Links are not directly provided in the text, only source websites. I will provide \n", "summaries in one line where possible.\n", "\n", "\n", "**From ScienceNews.org:**\n", "\n", "\u001b[1;36m1\u001b[0m. **Maggots may have been on the Neandertal menu:** A study suggests Neandertals may have eaten maggots for \n", "nutritional benefits. \u001b[1m[\u001b[0mLink: \u001b[4;94mhttps://www.sciencenews.org/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct article \n", "link.\u001b[1m)\u001b[0m\n", "\u001b[1;36m2\u001b[0m. **This desert beetle runs to cool off:** A desert beetle uses running to regulate its body temperature. \u001b[1m[\u001b[0mLink:\n", "\u001b[4;94mhttps://www.sciencenews.org/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct article link.\u001b[1m)\u001b[0m\n", "\u001b[1;36m3\u001b[0m. **AI is designing proteins that could help treat cancer:** Artificial intelligence is being used to develop \n", "cancer-fighting proteins. \u001b[1m[\u001b[0mLink: \u001b[4;94mhttps://www.sciencenews.org/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct article \n", "link.\u001b[1m)\u001b[0m\n", "\u001b[1;36m4\u001b[0m. **An injected gel could make drugs like Ozempic last longer:** A new gel could extend the effectiveness of \n", "medications like Ozempic. \u001b[1m[\u001b[0mLink: \u001b[4;94mhttps://www.sciencenews.org/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct article \n", "link.\u001b[1m)\u001b[0m\n", "\u001b[1;36m5\u001b[0m. **How many steps a day do you really need to take?:** A discussion on the optimal number of daily steps for \n", "health benefits. \u001b[1m[\u001b[0mLink: \u001b[4;94mhttps://www.sciencenews.org/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct article link.\u001b[1m)\u001b[0m\n", "\u001b[1;36m6\u001b[0m. **Climate change may be pushing fungal allergy season earlier:** Climate change is potentially affecting the \n", "timing of fungal allergy seasons. \u001b[1m[\u001b[0mLink: \u001b[4;94mhttps://www.sciencenews.org/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct \n", "article link.\u001b[1m)\u001b[0m\n", "\u001b[1;36m7\u001b[0m. **AI reveals new details about a famous Latin inscription:** Artificial intelligence helps uncover new \n", "information from an ancient Latin inscription. \u001b[1m[\u001b[0mLink: \u001b[4;94mhttps://www.sciencenews.org/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, \n", "not a direct article link.\u001b[1m)\u001b[0m\n", "\n", "\n", "**From IndianExpress.com \u001b[1m(\u001b[0mTechnology Section\u001b[1m)\u001b[0m:**\n", "\n", "\u001b[1;36m1\u001b[0m. **Amazfit Active \u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mSquare\u001b[1m)\u001b[0m review:** A review of the Amazfit Active \u001b[1;36m2\u001b[0m Square smartwatch. \u001b[1m[\u001b[0mLink: \n", "\u001b[4;94mhttps://indianexpress.com/section/technology/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct article link.\u001b[1m)\u001b[0m\n", "\u001b[1;36m2\u001b[0m. **Gemini on Galaxy Watch review:** A user experience review of using the Gemini AI assistant on a Galaxy \n", "Watch. \u001b[1m[\u001b[0mLink: \u001b[4;94mhttps://indianexpress.com/section/technology/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct article \n", "link.\u001b[1m)\u001b[0m\n", "\u001b[1;36m3\u001b[0m. **SpaceX launches more Starlink satellites:** SpaceX added \u001b[1;36m52\u001b[0m more Starlink satellites to its constellation. \n", "\u001b[1m[\u001b[0mLink: \u001b[4;94mhttps://indianexpress.com/section/technology/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct article link.\u001b[1m)\u001b[0m\n", "\u001b[1;36m4\u001b[0m. **New theory predicts a Big Crunch:** A new cosmological theory suggests a potential \u001b[32m\"Big Crunch\"\u001b[0m in the \n", "distant future. \u001b[1m[\u001b[0mLink: \u001b[4;94mhttps://indianexpress.com/section/technology/\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0mThis link is only the website, not a direct \n", "article link.\u001b[1m)\u001b[0m\n", "\n", "\n", "**Assumptions Made:**\n", "\n", "* All articles from both sources are assumed to be from July \u001b[1;36m27\u001b[0m, \u001b[1;36m2025\u001b[0m, as the provided text lacks specific dates \n", "for most articles.\n", "* The links provided are to the source websites, not direct links to individual articles. Finding the exact \n", "articles would require navigating the websites.\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "web_response = await query_web_response(\n", " \"Top news of today in science and technology with date and link to original article as hyperlink and summary of each in one line\",\n", " '26-07-2025',\n", " 'Saturday',\n", " searcher,\n", " hf_embeddings,\n", " True,\n", " cross_encoder,\n", " llmgoogle,\n", " text_model=llmgoogle,\n", " num_results=1,\n", " document_paths=[],\n", " local_mode=False,\n", " split=False\n", ")\n", "print(web_response[0])" ] }, { "cell_type": "markdown", "id": "ddc1bafd", "metadata": {}, "source": [ "# 8. Summarise/QA any web page\n", "You can even summarise any url, and get the response tailored to your specific query" ] }, { "cell_type": "code", "execution_count": 14, "id": "5964bb06", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n", " warnings.warn('resource_tracker: process died unexpectedly, '\n", "[2025-07-27 12:06:29,297] INFO utils.websearch_utils: Fetching URL: https://www.twofortheworld.com/andaman-itinerary/\n", "[2025-07-27 12:06:29,297] INFO utils.websearch_utils: Fetching URL: https://www.twofortheworld.com/andaman-itinerary/\n", "[2025-07-27 12:06:31,514] INFO utils.websearch_utils: Fetched content from https://www.twofortheworld.com/andaman-itinerary/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:31,514] INFO utils.websearch_utils: Fetched content from https://www.twofortheworld.com/andaman-itinerary/ with type text/html; charset=UTF-8\n", "[2025-07-27 12:06:33,154] INFO utils.websearch_utils: Processed markdown for: https://www.twofortheworld.com/andaman-itinerary/\n", "[2025-07-27 12:06:33,154] INFO utils.websearch_utils: Processed markdown for: https://www.twofortheworld.com/andaman-itinerary/\n", "[2025-07-27 12:06:33,156] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://www.twofortheworld.com/andaman-itinerary/\n", "[2025-07-27 12:06:33,156] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://www.twofortheworld.com/andaman-itinerary/\n", "[2025-07-27 12:06:33,411] INFO utils.websearch_utils: Total URLs processed: 1\n", "[2025-07-27 12:06:33,411] INFO utils.websearch_utils: Total URLs processed: 1\n" ] }, { "data": { "text/html": [ "
This 10-day Andaman and Nicobar Islands itinerary focuses on three islands: South Andaman (Port Blair), Havelock, \n", "and Neil. A 5-day trip would require significant adjustments, prioritizing fewer locations.\n", "\n", "**Possible 5-Day Itinerary (requiring flexibility):**\n", "\n", "* **Days 1-2: Port Blair:** Explore Cellular Jail, Ross Island, and the Zonal Anthropology Museum. Consider a \n", "shorter trip to Chidiya Tapu Beach if time allows. Skip Baratang Limestone Caves due to ethical concerns regarding\n", "the Jarawa tribe.\n", "* **Days 3-4: Havelock Island:** Focus on either Radhanagar Beach (famous sunset) or Elephant Beach (jungle trek, \n", "tide dependent). Scuba diving is possible but may need pre-booking and depends on weather.\n", "* **Day 5: Neil Island:** Choose one beach (Laxmanpur II for sunset and rock pools or Sitapur for sunrise and a \n", "relaxed atmosphere). Return to Port Blair for your departure.\n", "\n", "**Important Considerations:**\n", "\n", "* **Ferries:** Ferry travel between islands is crucial and can be unpredictable, especially during monsoon season \n", "(May-September). Book private ferries (Makruzz or Green Ocean) in advance for more reliability, though they are \n", "more expensive than government ferries.\n", "* **Weather:** October to May is the best time to visit. Be prepared for potential delays and adjust your itinerary\n", "accordingly.\n", "* **Time Constraints:** A 5-day trip necessitates prioritizing locations. Choosing between Havelock and Neil might\n", "be necessary for a more relaxed experience.\n", "\n", "\n", "This condensed itinerary sacrifices some of the exploration offered in the original 10-day plan but provides a \n", "framework for a shorter, impactful Andaman experience. Remember to check ferry schedules and weather forecasts \n", "before and during your trip.\n", "\n" ], "text/plain": [ "This \u001b[1;36m10\u001b[0m-day Andaman and Nicobar Islands itinerary focuses on three islands: South Andaman \u001b[1m(\u001b[0mPort Blair\u001b[1m)\u001b[0m, Havelock, \n", "and Neil. A \u001b[1;36m5\u001b[0m-day trip would require significant adjustments, prioritizing fewer locations.\n", "\n", "**Possible \u001b[1;36m5\u001b[0m-Day Itinerary \u001b[1m(\u001b[0mrequiring flexibility\u001b[1m)\u001b[0m:**\n", "\n", "* **Days \u001b[1;36m1\u001b[0m-\u001b[1;36m2\u001b[0m: Port Blair:** Explore Cellular Jail, Ross Island, and the Zonal Anthropology Museum. Consider a \n", "shorter trip to Chidiya Tapu Beach if time allows. Skip Baratang Limestone Caves due to ethical concerns regarding\n", "the Jarawa tribe.\n", "* **Days \u001b[1;36m3\u001b[0m-\u001b[1;36m4\u001b[0m: Havelock Island:** Focus on either Radhanagar Beach \u001b[1m(\u001b[0mfamous sunset\u001b[1m)\u001b[0m or Elephant Beach \u001b[1m(\u001b[0mjungle trek, \n", "tide dependent\u001b[1m)\u001b[0m. Scuba diving is possible but may need pre-booking and depends on weather.\n", "* **Day \u001b[1;36m5\u001b[0m: Neil Island:** Choose one beach \u001b[1m(\u001b[0mLaxmanpur II for sunset and rock pools or Sitapur for sunrise and a \n", "relaxed atmosphere\u001b[1m)\u001b[0m. Return to Port Blair for your departure.\n", "\n", "**Important Considerations:**\n", "\n", "* **Ferries:** Ferry travel between islands is crucial and can be unpredictable, especially during monsoon season \n", "\u001b[1m(\u001b[0mMay-September\u001b[1m)\u001b[0m. Book private ferries \u001b[1m(\u001b[0mMakruzz or Green Ocean\u001b[1m)\u001b[0m in advance for more reliability, though they are \n", "more expensive than government ferries.\n", "* **Weather:** October to May is the best time to visit. Be prepared for potential delays and adjust your itinerary\n", "accordingly.\n", "* **Time Constraints:** A \u001b[1;36m5\u001b[0m-day trip necessitates prioritizing locations. Choosing between Havelock and Neil might\n", "be necessary for a more relaxed experience.\n", "\n", "\n", "This condensed itinerary sacrifices some of the exploration offered in the original \u001b[1;36m10\u001b[0m-day plan but provides a \n", "framework for a shorter, impactful Andaman experience. Remember to check ferry schedules and weather forecasts \n", "before and during your trip.\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "summary = await summary_of_url(\"Plan my 5 day trip to andaman and nicobar based on this\",\n", " \"https://www.twofortheworld.com/andaman-itinerary/\",\n", " llmgoogle)\n", "print(summary)" ] }, { "cell_type": "markdown", "id": "5f9fea81", "metadata": {}, "source": [ " \n", "# Summarise or QA any folder, file (including images/pdfs/excels/csv/pptx/etc), or code-file" ] }, { "cell_type": "code", "execution_count": 15, "id": "a23bff2a", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[2025-07-27 12:06:58,344] INFO utils.answer_generation: Summary:True,subquery:['List files in DOCUMENT folder', 'Describe content of each file in DOCUMENT folder'], iscoverd:False\n", "[2025-07-27 12:06:58,344] INFO utils.answer_generation: Summary:True,subquery:['List files in DOCUMENT folder', 'Describe content of each file in DOCUMENT folder'], iscoverd:False\n", "[2025-07-27 12:06:58,346] INFO utils.websearch_utils: Search phrases for query 'Whats all in DOCUMENT folder, enlist name with content in detail': ['list files in document folder', 'describe content of each file in document folder']\n", "[2025-07-27 12:06:58,346] INFO utils.websearch_utils: Search phrases for query 'Whats all in DOCUMENT folder, enlist name with content in detail': ['list files in document folder', 'describe content of each file in document folder']\n", "[2025-07-27 12:06:58,347] WARNING utils.websearch_utils: Please add list of paths as input, earlier it used to be list of list\n", "[2025-07-27 12:06:58,347] WARNING utils.websearch_utils: Please add list of paths as input, earlier it used to be list of list\n", "[2025-07-27 12:06:58,350] INFO utils.websearch_utils: Total paths for 'Whats all in DOCUMENT folder, enlist name with content in detail': [['documents', 'documents/1706.03762v7.pdf']]\n", "[2025-07-27 12:06:58,350] INFO utils.websearch_utils: Total paths for 'Whats all in DOCUMENT folder, enlist name with content in detail': [['documents', 'documents/1706.03762v7.pdf']]\n", "[2025-07-27 12:06:58,350] WARNING utils.websearch_utils: No websearcher provided; using document_paths only.\n", "[2025-07-27 12:06:58,350] WARNING utils.websearch_utils: No websearcher provided; using document_paths only.\n", "[2025-07-27 12:06:58,351] INFO utils.websearch_utils: Starting context_to_docs for 2 URL groups.\n", "[2025-07-27 12:06:58,351] INFO utils.websearch_utils: Starting context_to_docs for 2 URL groups.\n", "/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n", " warnings.warn('resource_tracker: process died unexpectedly, '\n", "[2025-07-27 12:06:58,369] ERROR utils.websearch_utils: The file documents does not exist.\n", "[2025-07-27 12:06:58,369] ERROR utils.websearch_utils: The file documents does not exist.\n", "[2025-07-27 12:06:58,369] ERROR utils.websearch_utils: The file documents does not exist.\n", "[2025-07-27 12:06:58,369] ERROR utils.websearch_utils: The file documents does not exist.\n", "[2025-07-27 12:06:58,370] INFO utils.websearch_utils: Processing local file: documents/1706.03762v7.pdf\n", "[2025-07-27 12:06:58,370] INFO utils.websearch_utils: Processing local file: documents/1706.03762v7.pdf\n", "[2025-07-27 12:06:58,370] INFO utils.websearch_utils: Processing local file: documents/1706.03762v7.pdf\n", "[2025-07-27 12:06:58,370] INFO utils.websearch_utils: Processing local file: documents/1706.03762v7.pdf\n", "[2025-07-27 12:06:58,371] ERROR utils.websearch_utils: File not found: The file documents does not exist.\n", "[2025-07-27 12:06:58,371] ERROR utils.websearch_utils: File not found: The file documents does not exist.\n", "[2025-07-27 12:06:58,372] ERROR utils.websearch_utils: File not found: The file documents does not exist.\n", "[2025-07-27 12:06:58,372] ERROR utils.websearch_utils: File not found: The file documents does not exist.\n", "[2025-07-27 12:06:58,387] WARNING utils.websearch_utils: No content returned for URL documents\n", "[2025-07-27 12:06:58,387] WARNING utils.websearch_utils: No content returned for URL documents\n", "[2025-07-27 12:06:58,409] WARNING utils.websearch_utils: No content returned for URL documents\n", "[2025-07-27 12:06:58,409] WARNING utils.websearch_utils: No content returned for URL documents\n", "[2025-07-27 12:06:58,417] INFO utils.websearch_utils: Total URLs processed: 0\n", "[2025-07-27 12:06:58,417] INFO utils.websearch_utils: Total URLs processed: 0\n", "[2025-07-27 12:06:58,446] INFO utils.websearch_utils: Total URLs processed: 0\n", "[2025-07-27 12:06:58,446] INFO utils.websearch_utils: Total URLs processed: 0\n", "[2025-07-27 12:06:58,448] INFO utils.websearch_utils: Processed 0 docs for URL: documents\n", "[2025-07-27 12:06:58,448] INFO utils.websearch_utils: Processed 0 docs for URL: documents\n", "[2025-07-27 12:06:58,449] INFO utils.websearch_utils: Processed 0 docs for URL: documents\n", "[2025-07-27 12:06:58,449] INFO utils.websearch_utils: Encoding start for URL: documents\n", "[2025-07-27 12:06:58,449] INFO utils.websearch_utils: Processed 0 docs for URL: documents\n", "[2025-07-27 12:06:58,449] INFO utils.websearch_utils: Encoding start for URL: documents\n", "[2025-07-27 12:06:58,449] INFO utils.websearch_utils: Encoding start for URL: documents\n", "[2025-07-27 12:06:58,449] INFO utils.websearch_utils: Encoding start for URL: documents\n", "[2025-07-27 12:06:58,451] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:58,451] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:58,451] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:58,451] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:58,451] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:58,461] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:58,451] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:58,461] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:58,461] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:06:58,639] ERROR utils.websearch_utils: Error setting up retrievers for documents: Expected Embeddings to be non-empty list or numpy array, got [] in upsert.\n", "[2025-07-27 12:06:58,639] ERROR utils.websearch_utils: Error setting up retrievers for documents: Expected Embeddings to be non-empty list or numpy array, got [] in upsert.\n", "[2025-07-27 12:06:58,640] ERROR utils.websearch_utils: Error setting up retrievers for documents: Expected Embeddings to be non-empty list or numpy array, got [] in upsert.\n", "[2025-07-27 12:06:58,640] ERROR utils.websearch_utils: Error setting up retrievers for documents: Expected Embeddings to be non-empty list or numpy array, got [] in upsert.\n", "[2025-07-27 12:06:58,642] WARNING utils.websearch_utils: No valid docs/context for URL: documents\n", "[2025-07-27 12:06:58,642] WARNING utils.websearch_utils: No valid docs/context for URL: documents\n", "[2025-07-27 12:06:58,645] WARNING utils.websearch_utils: No valid docs/context for URL: documents\n", "[2025-07-27 12:06:58,645] WARNING utils.websearch_utils: No valid docs/context for URL: documents\n", "[2025-07-27 12:07:02,121] INFO utils.websearch_utils: Processed markdown for: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,121] INFO utils.websearch_utils: Processed markdown for: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,124] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,124] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,129] INFO utils.websearch_utils: Processed markdown for: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,129] INFO utils.websearch_utils: Processed markdown for: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,131] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,131] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,467] INFO utils.websearch_utils: Total URLs processed: 2\n", "[2025-07-27 12:07:02,467] INFO utils.websearch_utils: Total URLs processed: 2\n", "[2025-07-27 12:07:02,471] INFO utils.websearch_utils: Processed 2 docs for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,471] INFO utils.websearch_utils: Processed 2 docs for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,474] INFO utils.websearch_utils: Total URLs processed: 2\n", "[2025-07-27 12:07:02,474] INFO utils.websearch_utils: Total URLs processed: 2\n", "[2025-07-27 12:07:02,476] INFO utils.websearch_utils: Encoding start for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,476] INFO utils.websearch_utils: Encoding start for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,478] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:07:02,478] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:07:02,479] INFO utils.websearch_utils: Processed 2 docs for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,479] INFO utils.websearch_utils: Processed 2 docs for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,479] INFO utils.websearch_utils: Encoding start for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,478] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:07:02,479] INFO utils.websearch_utils: Encoding start for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:02,487] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:07:02,487] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:07:02,487] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:07:04,411] INFO utils.websearch_utils: Encoding end for URL: documents/1706.03762v7.pdf, Time taken: 1.93 seconds\n", "[2025-07-27 12:07:04,411] INFO utils.websearch_utils: Encoding end for URL: documents/1706.03762v7.pdf, Time taken: 1.93 seconds\n", "[2025-07-27 12:07:04,412] INFO utils.websearch_utils: Reranking start for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:04,412] INFO utils.websearch_utils: Reranking start for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:04,412] INFO utils.websearch_utils: Reranking end for URL: documents/1706.03762v7.pdf, Time taken: 0.00 seconds\n", "[2025-07-27 12:07:04,412] INFO utils.websearch_utils: Reranking end for URL: documents/1706.03762v7.pdf, Time taken: 0.00 seconds\n", "[2025-07-27 12:07:04,793] INFO utils.websearch_utils: Encoding end for URL: documents/1706.03762v7.pdf, Time taken: 2.31 seconds\n", "[2025-07-27 12:07:04,793] INFO utils.websearch_utils: Encoding end for URL: documents/1706.03762v7.pdf, Time taken: 2.31 seconds\n", "[2025-07-27 12:07:04,794] INFO utils.websearch_utils: Reranking start for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:04,794] INFO utils.websearch_utils: Reranking start for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:04,794] INFO utils.websearch_utils: Reranking end for URL: documents/1706.03762v7.pdf, Time taken: 0.00 seconds\n", "[2025-07-27 12:07:04,794] INFO utils.websearch_utils: Reranking end for URL: documents/1706.03762v7.pdf, Time taken: 0.00 seconds\n", "Batches: 100%|██████████| 1/1 [00:00<00:00, 1.68it/s]\n", "Batches: 100%|██████████| 1/1 [00:00<00:00, 4.78it/s]\n", "[2025-07-27 12:07:06,485] INFO utils.websearch_utils: Retrieved 2 docs for documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,485] INFO utils.websearch_utils: Retrieved 2 docs for documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,486] INFO utils.websearch_utils: Retrieved 2 docs for documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,486] INFO utils.websearch_utils: Retrieved 2 docs for documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,487] INFO utils.websearch_utils: Built context for documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,487] INFO utils.websearch_utils: Built context for documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,488] INFO utils.websearch_utils: Built context for documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,488] INFO utils.websearch_utils: Built context for documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,488] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,488] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,489] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,489] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: documents/1706.03762v7.pdf\n", "[2025-07-27 12:07:06,491] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 2, total docs: 4\n", "[2025-07-27 12:07:06,491] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 2, total docs: 4\n", "[2025-07-27 12:07:06,492] INFO utils.websearch_utils: Context generated to answer query 'Whats all in DOCUMENT folder, enlist name with content in detail'.\n", "[2025-07-27 12:07:06,492] INFO utils.websearch_utils: Context generated to answer query 'Whats all in DOCUMENT folder, enlist name with content in detail'.\n", "[2025-07-27 12:07:06,492] INFO utils.utils: Logging results for query: Whats all in DOCUMENT folder, enlist name with content in detail\n", "[2025-07-27 12:07:06,492] INFO utils.utils: Logging results for query: Whats all in DOCUMENT folder, enlist name with content in detail\n", "[2025-07-27 12:07:06,493] INFO utils.websearch_utils: Logged results for query 'Whats all in DOCUMENT folder, enlist name with content in detail'.\n", "[2025-07-27 12:07:06,493] INFO utils.websearch_utils: Logged results for query 'Whats all in DOCUMENT folder, enlist name with content in detail'.\n", "[2025-07-27 12:07:06,494] INFO utils.websearch_utils: Generating summary for query 'Whats all in DOCUMENT folder, enlist name with content in detail' using summarizer.\n", "[2025-07-27 12:07:06,494] INFO utils.websearch_utils: Generating summary for query 'Whats all in DOCUMENT folder, enlist name with content in detail' using summarizer.\n", "[2025-07-27 12:07:06,494] INFO utils.answer_generation: Deduping docs: 4\n", "[2025-07-27 12:07:06,494] INFO utils.answer_generation: Deduping docs: 4\n", "[2025-07-27 12:07:06,495] WARNING utils.answer_generation: Capping max words to 6000\n", "[2025-07-27 12:07:06,495] WARNING utils.answer_generation: Capping max words to 6000\n", "[2025-07-27 12:07:06,496] INFO utils.answer_generation: Arrived Len of Docs: 2\n", "[2025-07-27 12:07:06,496] INFO utils.answer_generation: Arrived Len of Docs: 2\n" ] }, { "data": { "text/html": [ "
Summarising using 2 documents\n",
"\n"
],
"text/plain": [
"Summarising using \u001b[1;36m2\u001b[0m documents\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:07:12,104] INFO utils.websearch_utils: Response generated for query 'Whats all in DOCUMENT folder, enlist name with content in detail'.\n",
"[2025-07-27 12:07:12,104] INFO utils.websearch_utils: Response generated for query 'Whats all in DOCUMENT folder, enlist name with content in detail'.\n"
]
},
{
"data": {
"text/html": [
"The DOCUMENT folder contains one file: `documents/1706.03762v7.pdf`. This PDF is a research paper titled \n", "\"Attention is All You Need,\" detailing the Transformer model architecture.\n", "\n", "The paper's content includes:\n", "\n", "* **Authors and Affiliations:** A list of authors and their affiliations (Google Research and Google Brain \n", "primarily, with one author from the University of Toronto). Their individual contributions are also specified.\n", "\n", "* **Abstract:** A summary of the paper, highlighting the introduction of the Transformer model, its superior \n", "performance and parallelization capabilities compared to recurrent and convolutional neural networks in machine \n", "translation tasks, and its successful application to English constituency parsing.\n", "\n", "* **Introduction:** Background on sequence transduction models, particularly recurrent neural networks (RNNs) and \n", "their limitations regarding parallelization. It introduces the Transformer as a solution that relies solely on \n", "attention mechanisms.\n", "\n", "* **Background:** A review of related work, including convolutional neural networks (CNNs) and self-attention \n", "mechanisms.\n", "\n", "* **Model Architecture:** A detailed explanation of the Transformer architecture, including:\n", " * Encoder and Decoder Stacks: The structure of the encoder and decoder, composed of stacked layers with \n", "self-attention and feed-forward networks.\n", " * Attention: A description of the scaled dot-product attention and multi-head attention mechanisms.\n", " * Position-wise Feed-Forward Networks: Explanation of the fully connected feed-forward networks applied to \n", "each position.\n", " * Embeddings and Softmax: Details on token embedding and probability prediction.\n", " * Positional Encoding: How positional information is incorporated into the model.\n", "\n", "* **Why Self-Attention:** A comparison of self-attention with recurrent and convolutional layers, focusing on \n", "computational complexity, parallelization, and path length for long-range dependencies.\n", "\n", "* **Training:** Details on the training data (WMT 2014 English-German and English-French datasets), hardware (8 \n", "NVIDIA P100 GPUs), optimizer (Adam), and regularization techniques (residual dropout and label smoothing).\n", "\n", "* **Results:** Presentation of results on machine translation tasks (English-to-German and English-to-French), \n", "showing state-of-the-art BLEU scores achieved by the Transformer model. Results on English constituency parsing \n", "are also included, demonstrating the model's generalizability.\n", "\n", "* **Model Variations:** An analysis of different variations of the Transformer architecture and their impact on \n", "performance.\n", "\n", "* **Conclusion:** Summary of the findings and future research directions.\n", "\n", "* **References:** A list of cited works.\n", "\n", "* **Appendix (partially shown):** Attention visualizations illustrating the model's attention mechanisms.\n", "\n", "\n", "**Assumptions Made:**\n", "\n", "No assumptions were made beyond what is explicitly stated or implied within the provided document. The summary is \n", "purely based on the content of the research paper.\n", "\n" ], "text/plain": [ "The DOCUMENT folder contains one file: `documents/\u001b[1;36m1706.\u001b[0m03762v7.pdf`. This PDF is a research paper titled \n", "\u001b[32m\"Attention is All You Need,\"\u001b[0m detailing the Transformer model architecture.\n", "\n", "The paper's content includes:\n", "\n", "* **Authors and Affiliations:** A list of authors and their affiliations \u001b[1m(\u001b[0mGoogle Research and Google Brain \n", "primarily, with one author from the University of Toronto\u001b[1m)\u001b[0m. Their individual contributions are also specified.\n", "\n", "* **Abstract:** A summary of the paper, highlighting the introduction of the Transformer model, its superior \n", "performance and parallelization capabilities compared to recurrent and convolutional neural networks in machine \n", "translation tasks, and its successful application to English constituency parsing.\n", "\n", "* **Introduction:** Background on sequence transduction models, particularly recurrent neural networks \u001b[1m(\u001b[0mRNNs\u001b[1m)\u001b[0m and \n", "their limitations regarding parallelization. It introduces the Transformer as a solution that relies solely on \n", "attention mechanisms.\n", "\n", "* **Background:** A review of related work, including convolutional neural networks \u001b[1m(\u001b[0mCNNs\u001b[1m)\u001b[0m and self-attention \n", "mechanisms.\n", "\n", "* **Model Architecture:** A detailed explanation of the Transformer architecture, including:\n", " * Encoder and Decoder Stacks: The structure of the encoder and decoder, composed of stacked layers with \n", "self-attention and feed-forward networks.\n", " * Attention: A description of the scaled dot-product attention and multi-head attention mechanisms.\n", " * Position-wise Feed-Forward Networks: Explanation of the fully connected feed-forward networks applied to \n", "each position.\n", " * Embeddings and Softmax: Details on token embedding and probability prediction.\n", " * Positional Encoding: How positional information is incorporated into the model.\n", "\n", "* **Why Self-Attention:** A comparison of self-attention with recurrent and convolutional layers, focusing on \n", "computational complexity, parallelization, and path length for long-range dependencies.\n", "\n", "* **Training:** Details on the training data \u001b[1m(\u001b[0mWMT \u001b[1;36m2014\u001b[0m English-German and English-French datasets\u001b[1m)\u001b[0m, hardware \u001b[1m(\u001b[0m\u001b[1;36m8\u001b[0m \n", "NVIDIA P100 GPUs\u001b[1m)\u001b[0m, optimizer \u001b[1m(\u001b[0mAdam\u001b[1m)\u001b[0m, and regularization techniques \u001b[1m(\u001b[0mresidual dropout and label smoothing\u001b[1m)\u001b[0m.\n", "\n", "* **Results:** Presentation of results on machine translation tasks \u001b[1m(\u001b[0mEnglish-to-German and English-to-French\u001b[1m)\u001b[0m, \n", "showing state-of-the-art BLEU scores achieved by the Transformer model. Results on English constituency parsing \n", "are also included, demonstrating the model's generalizability.\n", "\n", "* **Model Variations:** An analysis of different variations of the Transformer architecture and their impact on \n", "performance.\n", "\n", "* **Conclusion:** Summary of the findings and future research directions.\n", "\n", "* **References:** A list of cited works.\n", "\n", "* **Appendix \u001b[1m(\u001b[0mpartially shown\u001b[1m)\u001b[0m:** Attention visualizations illustrating the model's attention mechanisms.\n", "\n", "\n", "**Assumptions Made:**\n", "\n", "No assumptions were made beyond what is explicitly stated or implied within the provided document. The summary is \n", "purely based on the content of the research paper.\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#FOLDER\n", "web_response = await query_web_response(\n", " \"Whats all in DOCUMENT folder, enlist name with content in detail\",\n", " '26-07-2025',\n", " 'Saturday',\n", " searcher,\n", " hf_embeddings,\n", " True,\n", " cross_encoder,\n", " llmgoogle,\n", " text_model=llmgoogle,\n", " num_results=1,\n", " document_paths=['documents'],\n", " local_mode=True,\n", " split=False\n", ")\n", "print(web_response[0])" ] }, { "cell_type": "code", "execution_count": 16, "id": "a1fe0074", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[2025-07-27 12:07:20,155] INFO utils.answer_generation: Summary:True,subquery:['App capabilities markdown table'], iscoverd:False\n", "[2025-07-27 12:07:20,155] INFO utils.answer_generation: Summary:True,subquery:['App capabilities markdown table'], iscoverd:False\n", "[2025-07-27 12:07:20,157] INFO utils.websearch_utils: Search phrases for query 'Explain me the capabilties of this app in markdown table format': ['app capabilities markdown table']\n", "[2025-07-27 12:07:20,157] INFO utils.websearch_utils: Search phrases for query 'Explain me the capabilties of this app in markdown table format': ['app capabilities markdown table']\n", "[2025-07-27 12:07:20,158] WARNING utils.websearch_utils: Please add list of paths as input, earlier it used to be list of list\n", "[2025-07-27 12:07:20,158] WARNING utils.websearch_utils: Please add list of paths as input, earlier it used to be list of list\n", "[2025-07-27 12:07:20,159] INFO utils.websearch_utils: Total paths for 'Explain me the capabilties of this app in markdown table format': [['app.py']]\n", "[2025-07-27 12:07:20,159] INFO utils.websearch_utils: Total paths for 'Explain me the capabilties of this app in markdown table format': [['app.py']]\n", "[2025-07-27 12:07:20,159] WARNING utils.websearch_utils: No websearcher provided; using document_paths only.\n", "[2025-07-27 12:07:20,159] WARNING utils.websearch_utils: No websearcher provided; using document_paths only.\n", "[2025-07-27 12:07:20,160] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n", "[2025-07-27 12:07:20,160] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n", "/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n", " warnings.warn('resource_tracker: process died unexpectedly, '\n", "[2025-07-27 12:07:23,193] INFO utils.websearch_utils: Processing local file: app.py\n", "[2025-07-27 12:07:23,193] INFO utils.websearch_utils: Processing local file: app.py\n", "[2025-07-27 12:07:24,673] INFO utils.websearch_utils: Processed markdown for: app.py\n", "[2025-07-27 12:07:24,673] INFO utils.websearch_utils: Processed markdown for: app.py\n", "[2025-07-27 12:07:24,675] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: app.py\n", "[2025-07-27 12:07:24,675] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: app.py\n", "[2025-07-27 12:07:24,960] INFO utils.websearch_utils: Total URLs processed: 4\n", "[2025-07-27 12:07:24,960] INFO utils.websearch_utils: Total URLs processed: 4\n", "[2025-07-27 12:07:24,962] INFO utils.websearch_utils: Processed 4 docs for URL: app.py\n", "[2025-07-27 12:07:24,962] INFO utils.websearch_utils: Processed 4 docs for URL: app.py\n", "[2025-07-27 12:07:24,963] INFO utils.websearch_utils: Encoding start for URL: app.py\n", "[2025-07-27 12:07:24,963] INFO utils.websearch_utils: Encoding start for URL: app.py\n", "[2025-07-27 12:07:24,965] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:07:24,965] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:07:24,965] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n", "[2025-07-27 12:07:25,548] INFO utils.websearch_utils: Encoding end for URL: app.py, Time taken: 0.59 seconds\n", "[2025-07-27 12:07:25,548] INFO utils.websearch_utils: Encoding end for URL: app.py, Time taken: 0.59 seconds\n", "[2025-07-27 12:07:25,550] INFO utils.websearch_utils: Reranking start for URL: app.py\n", "[2025-07-27 12:07:25,550] INFO utils.websearch_utils: Reranking start for URL: app.py\n", "[2025-07-27 12:07:25,550] INFO utils.websearch_utils: Reranking end for URL: app.py, Time taken: 0.00 seconds\n", "[2025-07-27 12:07:25,550] INFO utils.websearch_utils: Reranking end for URL: app.py, Time taken: 0.00 seconds\n", "Batches: 100%|██████████| 1/1 [00:00<00:00, 2.01it/s]\n", "[2025-07-27 12:07:27,152] INFO utils.websearch_utils: Retrieved 2 docs for app.py\n", "[2025-07-27 12:07:27,152] INFO utils.websearch_utils: Retrieved 2 docs for app.py\n", "[2025-07-27 12:07:27,153] INFO utils.websearch_utils: Built context for app.py\n", "[2025-07-27 12:07:27,153] INFO utils.websearch_utils: Built context for app.py\n", "[2025-07-27 12:07:27,153] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: app.py\n", "[2025-07-27 12:07:27,153] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: app.py\n", "[2025-07-27 12:07:27,154] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 1, total docs: 4\n", "[2025-07-27 12:07:27,154] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 1, total docs: 4\n", "[2025-07-27 12:07:27,155] INFO utils.websearch_utils: Context generated to answer query 'Explain me the capabilties of this app in markdown table format'.\n", "[2025-07-27 12:07:27,155] INFO utils.websearch_utils: Context generated to answer query 'Explain me the capabilties of this app in markdown table format'.\n", "[2025-07-27 12:07:27,156] INFO utils.utils: Logging results for query: Explain me the capabilties of this app in markdown table format\n", "[2025-07-27 12:07:27,156] INFO utils.utils: Logging results for query: Explain me the capabilties of this app in markdown table format\n", "[2025-07-27 12:07:27,157] INFO utils.websearch_utils: Logged results for query 'Explain me the capabilties of this app in markdown table format'.\n", "[2025-07-27 12:07:27,157] INFO utils.websearch_utils: Logged results for query 'Explain me the capabilties of this app in markdown table format'.\n", "[2025-07-27 12:07:27,157] INFO utils.websearch_utils: Generating summary for query 'Explain me the capabilties of this app in markdown table format' using summarizer.\n", "[2025-07-27 12:07:27,157] INFO utils.websearch_utils: Generating summary for query 'Explain me the capabilties of this app in markdown table format' using summarizer.\n", "[2025-07-27 12:07:27,158] INFO utils.answer_generation: Deduping docs: 4\n", "[2025-07-27 12:07:27,158] INFO utils.answer_generation: Deduping docs: 4\n", "[2025-07-27 12:07:27,159] WARNING utils.answer_generation: Capping max words to 6000\n", "[2025-07-27 12:07:27,159] WARNING utils.answer_generation: Capping max words to 6000\n", "[2025-07-27 12:07:27,159] INFO utils.answer_generation: Arrived Len of Docs: 4\n", "[2025-07-27 12:07:27,159] INFO utils.answer_generation: Arrived Len of Docs: 4\n" ] }, { "data": { "text/html": [ "
Summarising using 4 documents\n",
"\n"
],
"text/plain": [
"Summarising using \u001b[1;36m4\u001b[0m documents\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:07:33,982] INFO utils.websearch_utils: Response generated for query 'Explain me the capabilties of this app in markdown table format'.\n",
"[2025-07-27 12:07:33,982] INFO utils.websearch_utils: Response generated for query 'Explain me the capabilties of this app in markdown table format'.\n"
]
},
{
"data": {
"text/html": [
"## CoexistAI App Capabilities\n",
"\n",
"The CoexistAI application offers a range of functionalities, all powered by a large language model (LLM) and \n",
"various supporting tools. The following table summarizes its capabilities:\n",
"\n",
"| Feature | Description \n",
"| Input Parameters \n",
"| Output | \n",
"Assumptions |\n",
"|----------------------|-------------------------------------------------------------------------------------------\n",
"-------------------------------------------------------------------------------------------------------------------\n",
"-------------------------|-----------------------------------------------------------------------------------------\n",
"--------------------------------|----------------------------------------------------------------------------------\n",
"---------------------------|---------------------------------------------------------------------------------------\n",
"----------------------|\n",
"| Web Search | Performs a web search using SearxNG, retrieves results, and generates a response based on \n",
"those results. Includes options for reranking and local document processing. \n",
"| `query`, `rerank`, `num_results`, `local_mode`, `split`, `document_paths` \n",
"| Generated response, sources, search results, retrieved documents, and context. | \n",
"SearxNG docker container is either running or can be started automatically. |\n",
"| Web Summarization | Generates a summary of a web page based on a provided query and URL. \n",
"| `query`, `url`, `local_mode` \n",
"| Summary and sources | \n",
"A suitable summarization model is available and configured. |\n",
"| YouTube Search | Performs a YouTube search, retrieves transcripts, and generates summaries of the videos \n",
"based on a given query or URL. \n",
"| `query` (URL or search term), `prompt`, `n` (number of videos) \n",
"| Summaries of YouTube transcripts | \n",
"YouTube transcripts are accessible and can be processed. |\n",
"| Reddit Search | Performs a Reddit search and retrieves posts based on specified parameters (subreddit, \n",
"search query, time filter, etc.). \n",
"| `subreddit`, `url_type`, `n`, `k`, `custom_url`, `time_filter`, `search_query`, `sort_type` \n",
"| Reddit posts and comments | \n",
"Reddit API access is configured correctly. |\n",
"| Map Search | Performs a map search to find routes and points of interest (POIs) between two locations. \n",
"| `start_location`, `end_location`, `pois_radius`, `amenities`, `limit`, `task` \n",
"| Location(s), route, and POIs | \n",
"Map data is accessible and can be processed. |\n",
"| Git Repository Search | Retrieves the directory tree structure or specific content from a GitHub or local Git \n",
"repository and answers user queries based on the fetched content. \n",
"| (Git Tree): `repobaseurl` (Git Search): `repobaseurl`, `parttoresearch`, `query`, `type` \n",
"| Directory tree structure or response to the query based on fetched content | \n",
"Git repository is accessible (either via URL or local path). |\n",
"| Local Folder Tree | Generates a markdown representation of a local folder's directory tree structure. \n",
"| `folder_path`, `level`, `prefix` \n",
"| Markdown tree string | \n",
"Appropriate permissions to access the specified folder path. |\n",
"| Response Check | Evaluates the completeness of information gathered by the agent to answer a user's query, \n",
"providing suggestions for improvement if needed. \n",
"| `query`, `toolsshorthand` |\n",
"Suggestions for improvement or confirmation of completeness | \n",
"The LLM can effectively assess the completeness of information. |\n",
"| Clickable Element Extraction | Extracts top-k clickable elements from a given URL based on a query, useful for \n",
"finding deeper links within a webpage. \n",
"| `url`, `query`, `topk` \n",
"| List of clickable elements with title, URL, and score. | \n",
"The underlying method (`get_topk_bm25_clickable_elements`) functions correctly and has access to necessary \n",
"resources. |\n",
"\n",
"\n",
"**Note:** The application uses a configurable LLM (`llm`), embedding model (`hf_embeddings`), and cross-encoder \n",
"(`cross_encoder`) for various tasks. The specific models used are defined in a `model_config` file. Error \n",
"handling and input validation are not explicitly detailed in the provided code snippets.\n",
"\n"
],
"text/plain": [
"## CoexistAI App Capabilities\n",
"\n",
"The CoexistAI application offers a range of functionalities, all powered by a large language model \u001b[1m(\u001b[0mLLM\u001b[1m)\u001b[0m and \n",
"various supporting tools. The following table summarizes its capabilities:\n",
"\n",
"| Feature | Description \n",
"| Input Parameters \n",
"| Output | \n",
"Assumptions |\n",
"|----------------------|-------------------------------------------------------------------------------------------\n",
"-------------------------------------------------------------------------------------------------------------------\n",
"-------------------------|-----------------------------------------------------------------------------------------\n",
"--------------------------------|----------------------------------------------------------------------------------\n",
"---------------------------|---------------------------------------------------------------------------------------\n",
"----------------------|\n",
"| Web Search | Performs a web search using SearxNG, retrieves results, and generates a response based on \n",
"those results. Includes options for reranking and local document processing. \n",
"| `query`, `rerank`, `num_results`, `local_mode`, `split`, `document_paths` \n",
"| Generated response, sources, search results, retrieved documents, and context. | \n",
"SearxNG docker container is either running or can be started automatically. |\n",
"| Web Summarization | Generates a summary of a web page based on a provided query and URL. \n",
"| `query`, `url`, `local_mode` \n",
"| Summary and sources | \n",
"A suitable summarization model is available and configured. |\n",
"| YouTube Search | Performs a YouTube search, retrieves transcripts, and generates summaries of the videos \n",
"based on a given query or URL. \n",
"| `query` \u001b[1m(\u001b[0mURL or search term\u001b[1m)\u001b[0m, `prompt`, `n` \u001b[1m(\u001b[0mnumber of videos\u001b[1m)\u001b[0m \n",
"| Summaries of YouTube transcripts | \n",
"YouTube transcripts are accessible and can be processed. |\n",
"| Reddit Search | Performs a Reddit search and retrieves posts based on specified parameters \u001b[1m(\u001b[0msubreddit, \n",
"search query, time filter, etc.\u001b[1m)\u001b[0m. \n",
"| `subreddit`, `url_type`, `n`, `k`, `custom_url`, `time_filter`, `search_query`, `sort_type` \n",
"| Reddit posts and comments | \n",
"Reddit API access is configured correctly. |\n",
"| Map Search | Performs a map search to find routes and points of interest \u001b[1m(\u001b[0mPOIs\u001b[1m)\u001b[0m between two locations. \n",
"| `start_location`, `end_location`, `pois_radius`, `amenities`, `limit`, `task` \n",
"| \u001b[1;35mLocation\u001b[0m\u001b[1m(\u001b[0ms\u001b[1m)\u001b[0m, route, and POIs | \n",
"Map data is accessible and can be processed. |\n",
"| Git Repository Search | Retrieves the directory tree structure or specific content from a GitHub or local Git \n",
"repository and answers user queries based on the fetched content. \n",
"| \u001b[1m(\u001b[0mGit Tree\u001b[1m)\u001b[0m: `repobaseurl` \u001b[1m(\u001b[0mGit Search\u001b[1m)\u001b[0m: `repobaseurl`, `parttoresearch`, `query`, `type` \n",
"| Directory tree structure or response to the query based on fetched content | \n",
"Git repository is accessible \u001b[1m(\u001b[0meither via URL or local path\u001b[1m)\u001b[0m. |\n",
"| Local Folder Tree | Generates a markdown representation of a local folder's directory tree structure. \n",
"| `folder_path`, `level`, `prefix` \n",
"| Markdown tree string | \n",
"Appropriate permissions to access the specified folder path. |\n",
"| Response Check | Evaluates the completeness of information gathered by the agent to answer a user's query, \n",
"providing suggestions for improvement if needed. \n",
"| `query`, `toolsshorthand` |\n",
"Suggestions for improvement or confirmation of completeness | \n",
"The LLM can effectively assess the completeness of information. |\n",
"| Clickable Element Extraction | Extracts top-k clickable elements from a given URL based on a query, useful for \n",
"finding deeper links within a webpage. \n",
"| `url`, `query`, `topk` \n",
"| List of clickable elements with title, URL, and score. | \n",
"The underlying method \u001b[1m(\u001b[0m`get_topk_bm25_clickable_elements`\u001b[1m)\u001b[0m functions correctly and has access to necessary \n",
"resources. |\n",
"\n",
"\n",
"**Note:** The application uses a configurable LLM \u001b[1m(\u001b[0m`llm`\u001b[1m)\u001b[0m, embedding model \u001b[1m(\u001b[0m`hf_embeddings`\u001b[1m)\u001b[0m, and cross-encoder \n",
"\u001b[1m(\u001b[0m`cross_encoder`\u001b[1m)\u001b[0m for various tasks. The specific models used are defined in a `model_config` file. Error \n",
"handling and input validation are not explicitly detailed in the provided code snippets.\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# FILE\n",
"web_response = await query_web_response(\n",
" \"Explain me the capabilties of this app in markdown table format\",\n",
" '26-07-2025',\n",
" 'Saturday',\n",
" searcher,\n",
" hf_embeddings,\n",
" True,\n",
" cross_encoder,\n",
" llmgoogle,\n",
" text_model=llmgoogle,\n",
" num_results=1,\n",
" document_paths=['app.py'],\n",
" local_mode=True,\n",
" split=False\n",
")\n",
"print(web_response[0])"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "3dbe001f",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:07:47,909] INFO utils.answer_generation: Summary:False,subquery:['artistic view logo'], iscoverd:False\n",
"[2025-07-27 12:07:47,909] INFO utils.answer_generation: Summary:False,subquery:['artistic view logo'], iscoverd:False\n",
"[2025-07-27 12:07:47,911] INFO utils.websearch_utils: Search phrases for query 'Give me your artistic view on this logo': ['artistic view logo']\n",
"[2025-07-27 12:07:47,911] INFO utils.websearch_utils: Search phrases for query 'Give me your artistic view on this logo': ['artistic view logo']\n",
"[2025-07-27 12:07:47,912] WARNING utils.websearch_utils: Please add list of paths as input, earlier it used to be list of list\n",
"[2025-07-27 12:07:47,912] WARNING utils.websearch_utils: Please add list of paths as input, earlier it used to be list of list\n",
"[2025-07-27 12:07:47,913] INFO utils.websearch_utils: Total paths for 'Give me your artistic view on this logo': [['artifacts/logo.jpeg']]\n",
"[2025-07-27 12:07:47,913] INFO utils.websearch_utils: Total paths for 'Give me your artistic view on this logo': [['artifacts/logo.jpeg']]\n",
"[2025-07-27 12:07:47,915] WARNING utils.websearch_utils: No websearcher provided; using document_paths only.\n",
"[2025-07-27 12:07:47,915] WARNING utils.websearch_utils: No websearcher provided; using document_paths only.\n",
"[2025-07-27 12:07:47,916] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n",
"[2025-07-27 12:07:47,916] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n",
"/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n",
" warnings.warn('resource_tracker: process died unexpectedly, '\n",
"[2025-07-27 12:07:47,954] INFO utils.websearch_utils: Processing local file: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:47,954] INFO utils.websearch_utils: Processing local file: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,194] INFO utils.websearch_utils: Processed markdown for: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,194] INFO utils.websearch_utils: Processed markdown for: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,197] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,197] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,489] INFO utils.websearch_utils: Total URLs processed: 2\n",
"[2025-07-27 12:07:55,489] INFO utils.websearch_utils: Total URLs processed: 2\n",
"[2025-07-27 12:07:55,492] INFO utils.websearch_utils: Processed 2 docs for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,492] INFO utils.websearch_utils: Processed 2 docs for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,492] INFO utils.websearch_utils: Encoding start for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,492] INFO utils.websearch_utils: Encoding start for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,494] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:07:55,494] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:07:55,494] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:07:55,946] INFO utils.websearch_utils: Encoding end for URL: artifacts/logo.jpeg, Time taken: 0.45 seconds\n",
"[2025-07-27 12:07:55,946] INFO utils.websearch_utils: Encoding end for URL: artifacts/logo.jpeg, Time taken: 0.45 seconds\n",
"[2025-07-27 12:07:55,948] INFO utils.websearch_utils: Reranking start for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,948] INFO utils.websearch_utils: Reranking start for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:55,949] INFO utils.websearch_utils: Reranking end for URL: artifacts/logo.jpeg, Time taken: 0.00 seconds\n",
"[2025-07-27 12:07:55,949] INFO utils.websearch_utils: Reranking end for URL: artifacts/logo.jpeg, Time taken: 0.00 seconds\n",
"Batches: 100%|██████████| 1/1 [00:00<00:00, 5.00it/s]\n",
"[2025-07-27 12:07:57,297] INFO utils.websearch_utils: Retrieved 2 docs for artifacts/logo.jpeg\n",
"[2025-07-27 12:07:57,297] INFO utils.websearch_utils: Retrieved 2 docs for artifacts/logo.jpeg\n",
"[2025-07-27 12:07:57,298] INFO utils.websearch_utils: Built context for artifacts/logo.jpeg\n",
"[2025-07-27 12:07:57,298] INFO utils.websearch_utils: Built context for artifacts/logo.jpeg\n",
"[2025-07-27 12:07:57,298] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:57,298] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: artifacts/logo.jpeg\n",
"[2025-07-27 12:07:57,299] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 1, total docs: 2\n",
"[2025-07-27 12:07:57,299] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 1, total docs: 2\n",
"[2025-07-27 12:07:57,300] INFO utils.websearch_utils: Context generated to answer query 'Give me your artistic view on this logo'.\n",
"[2025-07-27 12:07:57,300] INFO utils.websearch_utils: Context generated to answer query 'Give me your artistic view on this logo'.\n",
"[2025-07-27 12:07:57,300] INFO utils.utils: Logging results for query: Give me your artistic view on this logo\n",
"[2025-07-27 12:07:57,300] INFO utils.utils: Logging results for query: Give me your artistic view on this logo\n",
"[2025-07-27 12:07:57,301] INFO utils.websearch_utils: Logged results for query 'Give me your artistic view on this logo'.\n",
"[2025-07-27 12:07:57,301] INFO utils.websearch_utils: Logged results for query 'Give me your artistic view on this logo'.\n",
"[2025-07-27 12:07:57,301] INFO utils.websearch_utils: Generating Answer for query 'Give me your artistic view on this logo' using response gen.\n",
"[2025-07-27 12:07:57,301] INFO utils.websearch_utils: Generating Answer for query 'Give me your artistic view on this logo' using response gen.\n",
"[2025-07-27 12:07:57,302] INFO utils.answer_generation: Generating Answer for query: Give me your artistic view on this logo\n",
"[2025-07-27 12:07:57,302] INFO utils.answer_generation: Generating Answer for query: Give me your artistic view on this logo\n",
"[2025-07-27 12:07:59,171] INFO utils.answer_generation: Structured response generated successfully.\n",
"[2025-07-27 12:07:59,171] INFO utils.answer_generation: Structured response generated successfully.\n",
"[2025-07-27 12:07:59,172] INFO utils.websearch_utils: Response generated for query 'Give me your artistic view on this logo'.\n",
"[2025-07-27 12:07:59,172] INFO utils.websearch_utils: Response generated for query 'Give me your artistic view on this logo'.\n"
]
},
{
"data": {
"text/html": [
"#### Answer: \n",
"The logo is a vibrant and imaginative illustration blending nature, science, and everyday life. A lion in a suit \n",
"holding coffee represents power and sophistication, while a blue brain above symbolizes intellect. Two bulls, one \n",
"blue and one black and white, represent contrasting perspectives. The background features interconnected tech \n",
"icons (gears, test tubes, cameras, circuits), suggesting innovation and the complexity of the mind. Stars add a \n",
"whimsical touch. The overall artistic effect is a thought-provoking exploration of balance, intelligence, and \n",
"diverse forces shaping our world. It's not just a logo; it's a visual narrative.\n",
"\n",
"#### Next steps:\n",
"None\n",
"\n"
],
"text/plain": [
"#### Answer: \n",
"The logo is a vibrant and imaginative illustration blending nature, science, and everyday life. A lion in a suit \n",
"holding coffee represents power and sophistication, while a blue brain above symbolizes intellect. Two bulls, one \n",
"blue and one black and white, represent contrasting perspectives. The background features interconnected tech \n",
"icons \u001b[1m(\u001b[0mgears, test tubes, cameras, circuits\u001b[1m)\u001b[0m, suggesting innovation and the complexity of the mind. Stars add a \n",
"whimsical touch. The overall artistic effect is a thought-provoking exploration of balance, intelligence, and \n",
"diverse forces shaping our world. It's not just a logo; it's a visual narrative.\n",
"\n",
"#### Next steps:\n",
"\u001b[3;35mNone\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# FILE\n",
"web_response = await query_web_response(\n",
" \"Give me your artistic view on this logo\",\n",
" '26-07-2025',\n",
" 'Saturday',\n",
" searcher,\n",
" hf_embeddings,\n",
" True,\n",
" cross_encoder,\n",
" llmgoogle,\n",
" text_model=llmgoogle,\n",
" num_results=1,\n",
" document_paths=['artifacts/logo.jpeg'],\n",
" local_mode=True,\n",
" split=False\n",
")\n",
"print(web_response[0])"
]
},
{
"cell_type": "markdown",
"id": "f962c291",
"metadata": {},
"source": [
"## 10. YouTube Transcript Summarization\n",
"\n",
"Summarize YouTube video transcripts using the `youtube_transcript_response` function. This is useful for extracting insights from long videos."
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "ef41b810",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Generated YouTube context for query 'https://www.youtube.com/watch?v=o8NiE3XMPrM&t=6648s': \n", "\n", "Video: https://www.youtube.com/watch?v=o8NiE3XMPrM&t=6648s\n", "Transcript Summary: content='This is a comprehensive summary of the Google I/O \\'25 Keynote based on the provided \n", "metadata and transcript.\\n\\n**Key Announcements and Highlights:**\\n\\n* **Gemini 2.5:** Google announced \n", "significant advancements in its Gemini model, boasting improved performance across various benchmarks (LMArena, \n", "WebDev Arena) and highlighting its capabilities in coding, reasoning, and multi-modal tasks. Gemini 2.5 Pro and \n", "Gemini 2.5 Flash were both detailed, with Flash emphasizing speed and efficiency. A new \"Deep Think\" mode was also\n", "teased, promising even greater performance but with a focus on further safety evaluations before wider \n", "release.\\n\\n* **Gemini App Updates:** The Gemini app received major updates, including:\\n * **Agent Mode:** \n", "Allows the app to perform multi-step tasks on behalf of the user (e.g., finding apartments, booking \n", "appointments).\\n * **Personalized Smart Replies:** Generates email replies in the user\\'s style and tone using \n", "personal context.\\n * **Gemini Live Enhancements:** Added camera and screen sharing capabilities, along with \n", "integration with other Google apps.\\n\\n* **Google Search Enhancements:**\\n * **AI Overviews:** Continued growth\n", "and expansion, now reaching over 1.5 billion users monthly.\\n * **AI Mode:** A complete reimagining of Google \n", "Search, leveraging Gemini 2.5 for more complex queries, conversational follow-ups, and dynamic UI adaptation. \n", "Features like Deep Search (for in-depth research) and personalized suggestions based on user context were \n", "highlighted. Agentic capabilities were also integrated, allowing Search to perform tasks like booking tickets and \n", "making reservations.\\n * **Multimodal Search (Search Live):** Allows users to use their camera to ask questions\n", "about the real world in real-time.\\n\\n* **Generative Media Advancements:**\\n * **Lyria 2:** An improved music \n", "generation model capable of creating high-fidelity music with vocals.\\n * **Imagen 4:** A significantly \n", "improved image generation model with enhanced quality, speed, and text capabilities.\\n * **Veo 3:** A new video\n", "generation model with Native Audio generation, allowing for the creation of videos with realistic sound effects and\n", "dialogue.\\n * **Flow:** A new AI filmmaking tool combining Veo, Imagen, and Gemini, designed to streamline the \n", "creative process for filmmakers.\\n\\n* **Android XR:** Google showcased its Android XR platform, designed for a \n", "range of devices including headsets and glasses. The platform integrates Gemini for enhanced contextual awareness \n", "and assistance. Partnerships with Samsung, Gentle Monster, and Warby Parker were announced for headset and glasses\n", "development. A live demo showcased the capabilities of Android XR glasses.\\n\\n* **Project Astra and Mariner:** \n", "These research projects, previously showcased in earlier I/O events, are now being integrated into various Google \n", "products, demonstrating the transition of research prototypes into real-world applications.\\n\\n* **New AI \n", "Subscription Plans:** Google announced two new AI subscription plans: Google AI Pro and Google AI Ultra, offering \n", "varying levels of access to AI features and capabilities.\\n\\n**Overall Tone and Message:**\\n\\nThe keynote \n", "emphasized Google\\'s significant progress in AI, particularly with Gemini, and its commitment to integrating AI \n", "into its existing products and creating new experiences. The focus was on making AI more personal, proactive, and \n", "powerful for users, while also highlighting the potential of AI to accelerate scientific discovery and address \n", "societal challenges. The keynote also stressed collaboration with developers and the creative community to shape \n", "the future of AI.' additional_kwargs={} response_metadata={'prompt_feedback': {'block_reason': 0, 'safety_ratings':\n", "[]}, 'finish_reason': 'STOP', 'model_name': 'gemini-1.5-flash', 'safety_ratings': []} \n", "id='run--b7e022e0-d8e3-41d9-a73c-a2c90ad5a013-0' usage_metadata={'input_tokens': 21590, 'output_tokens': 733, \n", "'total_tokens': 22323, 'input_token_details': {'cache_read': 0}}\n", "\n", "\n", "\n" ], "text/plain": [ "Generated YouTube context for query \u001b[32m'https://www.youtube.com/watch?\u001b[0m\u001b[32mv\u001b[0m\u001b[32m=\u001b[0m\u001b[32mo8NiE3XMPrM\u001b[0m\u001b[32m&\u001b[0m\u001b[32mt\u001b[0m\u001b[32m=\u001b[0m\u001b[32m6648s\u001b[0m\u001b[32m'\u001b[0m: \n", "\n", "Video: \u001b[4;94mhttps://www.youtube.com/watch?\u001b[0m\u001b[4;94mv\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94mo8NiE3XMPrM\u001b[0m\u001b[4;94m&\u001b[0m\u001b[4;94mt\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94m6648s\u001b[0m\n", "Transcript Summary: \u001b[33mcontent\u001b[0m=\u001b[32m'This is a comprehensive summary of the Google I/O \\'25 Keynote based on the provided \u001b[0m\n", "\u001b[32mmetadata and transcript.\\n\\n**Key Announcements and Highlights:**\\n\\n* **Gemini 2.5:** Google announced \u001b[0m\n", "\u001b[32msignificant advancements in its Gemini model, boasting improved performance across various benchmarks \u001b[0m\u001b[32m(\u001b[0m\u001b[32mLMArena, \u001b[0m\n", "\u001b[32mWebDev Arena\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and highlighting its capabilities in coding, reasoning, and multi-modal tasks. Gemini 2.5 Pro and \u001b[0m\n", "\u001b[32mGemini 2.5 Flash were both detailed, with Flash emphasizing speed and efficiency. A new \"Deep Think\" mode was also\u001b[0m\n", "\u001b[32mteased, promising even greater performance but with a focus on further safety evaluations before wider \u001b[0m\n", "\u001b[32mrelease.\\n\\n* **Gemini App Updates:** The Gemini app received major updates, including:\\n * **Agent Mode:** \u001b[0m\n", "\u001b[32mAllows the app to perform multi-step tasks on behalf of the user \u001b[0m\u001b[32m(\u001b[0m\u001b[32me.g., finding apartments, booking \u001b[0m\n", "\u001b[32mappointments\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\\n * **Personalized Smart Replies:** Generates email replies in the user\\'s style and tone using \u001b[0m\n", "\u001b[32mpersonal context.\\n * **Gemini Live Enhancements:** Added camera and screen sharing capabilities, along with \u001b[0m\n", "\u001b[32mintegration with other Google apps.\\n\\n* **Google Search Enhancements:**\\n * **AI Overviews:** Continued growth\u001b[0m\n", "\u001b[32mand expansion, now reaching over 1.5 billion users monthly.\\n * **AI Mode:** A complete reimagining of Google \u001b[0m\n", "\u001b[32mSearch, leveraging Gemini 2.5 for more complex queries, conversational follow-ups, and dynamic UI adaptation. \u001b[0m\n", "\u001b[32mFeatures like Deep Search \u001b[0m\u001b[32m(\u001b[0m\u001b[32mfor in-depth research\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and personalized suggestions based on user context were \u001b[0m\n", "\u001b[32mhighlighted. Agentic capabilities were also integrated, allowing Search to perform tasks like booking tickets and \u001b[0m\n", "\u001b[32mmaking reservations.\\n * **Multimodal Search \u001b[0m\u001b[32m(\u001b[0m\u001b[32mSearch Live\u001b[0m\u001b[32m)\u001b[0m\u001b[32m:** Allows users to use their camera to ask questions\u001b[0m\n", "\u001b[32mabout the real world in real-time.\\n\\n* **Generative Media Advancements:**\\n * **Lyria 2:** An improved music \u001b[0m\n", "\u001b[32mgeneration model capable of creating high-fidelity music with vocals.\\n * **Imagen 4:** A significantly \u001b[0m\n", "\u001b[32mimproved image generation model with enhanced quality, speed, and text capabilities.\\n * **Veo 3:** A new video\u001b[0m\n", "\u001b[32mgeneration model with Native Audio generation, allowing for the creation of videos with realistic sound effects and\u001b[0m\n", "\u001b[32mdialogue.\\n * **Flow:** A new AI filmmaking tool combining Veo, Imagen, and Gemini, designed to streamline the \u001b[0m\n", "\u001b[32mcreative process for filmmakers.\\n\\n* **Android XR:** Google showcased its Android XR platform, designed for a \u001b[0m\n", "\u001b[32mrange of devices including headsets and glasses. The platform integrates Gemini for enhanced contextual awareness \u001b[0m\n", "\u001b[32mand assistance. Partnerships with Samsung, Gentle Monster, and Warby Parker were announced for headset and glasses\u001b[0m\n", "\u001b[32mdevelopment. A live demo showcased the capabilities of Android XR glasses.\\n\\n* **Project Astra and Mariner:** \u001b[0m\n", "\u001b[32mThese research projects, previously showcased in earlier I/O events, are now being integrated into various Google \u001b[0m\n", "\u001b[32mproducts, demonstrating the transition of research prototypes into real-world applications.\\n\\n* **New AI \u001b[0m\n", "\u001b[32mSubscription Plans:** Google announced two new AI subscription plans: Google AI Pro and Google AI Ultra, offering \u001b[0m\n", "\u001b[32mvarying levels of access to AI features and capabilities.\\n\\n**Overall Tone and Message:**\\n\\nThe keynote \u001b[0m\n", "\u001b[32memphasized Google\\'s significant progress in AI, particularly with Gemini, and its commitment to integrating AI \u001b[0m\n", "\u001b[32minto its existing products and creating new experiences. The focus was on making AI more personal, proactive, and \u001b[0m\n", "\u001b[32mpowerful for users, while also highlighting the potential of AI to accelerate scientific discovery and address \u001b[0m\n", "\u001b[32msocietal challenges. The keynote also stressed collaboration with developers and the creative community to shape \u001b[0m\n", "\u001b[32mthe future of AI.'\u001b[0m \u001b[33madditional_kwargs\u001b[0m=\u001b[1m{\u001b[0m\u001b[1m}\u001b[0m \u001b[33mresponse_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'prompt_feedback'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'block_reason'\u001b[0m: \u001b[1;36m0\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m:\n", "\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m, \u001b[32m'finish_reason'\u001b[0m: \u001b[32m'STOP'\u001b[0m, \u001b[32m'model_name'\u001b[0m: \u001b[32m'gemini-1.5-flash'\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m \n", "\u001b[33mid\u001b[0m=\u001b[32m'run--b7e022e0-d8e3-41d9-a73c-a2c90ad5a013-0'\u001b[0m \u001b[33musage_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'input_tokens'\u001b[0m: \u001b[1;36m21590\u001b[0m, \u001b[32m'output_tokens'\u001b[0m: \u001b[1;36m733\u001b[0m, \n", "\u001b[32m'total_tokens'\u001b[0m: \u001b[1;36m22323\u001b[0m, \u001b[32m'input_token_details'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'cache_read'\u001b[0m: \u001b[1;36m0\u001b[0m\u001b[1m}\u001b[0m\u001b[1m}\u001b[0m\n", "\n", "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n",
"\n",
"Video: https://www.youtube.com/watch?v=o8NiE3XMPrM&t=6648s\n",
"Transcript Summary: content='This is a comprehensive summary of the Google I/O \\'25 Keynote based on the provided \n",
"metadata and transcript.\\n\\n**Key Announcements and Highlights:**\\n\\n* **Gemini 2.5:** Google announced \n",
"significant advancements in its Gemini model, boasting improved performance across various benchmarks (LMArena, \n",
"WebDev Arena) and highlighting its capabilities in coding, reasoning, and multi-modal tasks. Gemini 2.5 Pro and \n",
"Gemini 2.5 Flash were both detailed, with Flash emphasizing speed and efficiency. A new \"Deep Think\" mode was also\n",
"teased, promising even greater performance but with a focus on further safety evaluations before wider \n",
"release.\\n\\n* **Gemini App Updates:** The Gemini app received major updates, including:\\n * **Agent Mode:** \n",
"Allows the app to perform multi-step tasks on behalf of the user (e.g., finding apartments, booking \n",
"appointments).\\n * **Personalized Smart Replies:** Generates email replies in the user\\'s style and tone using \n",
"personal context.\\n * **Gemini Live Enhancements:** Added camera and screen sharing capabilities, along with \n",
"integration with other Google apps.\\n\\n* **Google Search Enhancements:**\\n * **AI Overviews:** Continued growth\n",
"and expansion, now reaching over 1.5 billion users monthly.\\n * **AI Mode:** A complete reimagining of Google \n",
"Search, leveraging Gemini 2.5 for more complex queries, conversational follow-ups, and dynamic UI adaptation. \n",
"Features like Deep Search (for in-depth research) and personalized suggestions based on user context were \n",
"highlighted. Agentic capabilities were also integrated, allowing Search to perform tasks like booking tickets and \n",
"making reservations.\\n * **Multimodal Search (Search Live):** Allows users to use their camera to ask questions\n",
"about the real world in real-time.\\n\\n* **Generative Media Advancements:**\\n * **Lyria 2:** An improved music \n",
"generation model capable of creating high-fidelity music with vocals.\\n * **Imagen 4:** A significantly \n",
"improved image generation model with enhanced quality, speed, and text capabilities.\\n * **Veo 3:** A new video\n",
"generation model with Native Audio generation, allowing for the creation of videos with realistic sound effects and\n",
"dialogue.\\n * **Flow:** A new AI filmmaking tool combining Veo, Imagen, and Gemini, designed to streamline the \n",
"creative process for filmmakers.\\n\\n* **Android XR:** Google showcased its Android XR platform, designed for a \n",
"range of devices including headsets and glasses. The platform integrates Gemini for enhanced contextual awareness \n",
"and assistance. Partnerships with Samsung, Gentle Monster, and Warby Parker were announced for headset and glasses\n",
"development. A live demo showcased the capabilities of Android XR glasses.\\n\\n* **Project Astra and Mariner:** \n",
"These research projects, previously showcased in earlier I/O events, are now being integrated into various Google \n",
"products, demonstrating the transition of research prototypes into real-world applications.\\n\\n* **New AI \n",
"Subscription Plans:** Google announced two new AI subscription plans: Google AI Pro and Google AI Ultra, offering \n",
"varying levels of access to AI features and capabilities.\\n\\n**Overall Tone and Message:**\\n\\nThe keynote \n",
"emphasized Google\\'s significant progress in AI, particularly with Gemini, and its commitment to integrating AI \n",
"into its existing products and creating new experiences. The focus was on making AI more personal, proactive, and \n",
"powerful for users, while also highlighting the potential of AI to accelerate scientific discovery and address \n",
"societal challenges. The keynote also stressed collaboration with developers and the creative community to shape \n",
"the future of AI.' additional_kwargs={} response_metadata={'prompt_feedback': {'block_reason': 0, 'safety_ratings':\n",
"[]}, 'finish_reason': 'STOP', 'model_name': 'gemini-1.5-flash', 'safety_ratings': []} \n",
"id='run--b7e022e0-d8e3-41d9-a73c-a2c90ad5a013-0' usage_metadata={'input_tokens': 21590, 'output_tokens': 733, \n",
"'total_tokens': 22323, 'input_token_details': {'cache_read': 0}}\n",
"\n",
"\n",
"\n"
],
"text/plain": [
"\n",
"\n",
"Video: \u001b[4;94mhttps://www.youtube.com/watch?\u001b[0m\u001b[4;94mv\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94mo8NiE3XMPrM\u001b[0m\u001b[4;94m&\u001b[0m\u001b[4;94mt\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94m6648s\u001b[0m\n",
"Transcript Summary: \u001b[33mcontent\u001b[0m=\u001b[32m'This is a comprehensive summary of the Google I/O \\'25 Keynote based on the provided \u001b[0m\n",
"\u001b[32mmetadata and transcript.\\n\\n**Key Announcements and Highlights:**\\n\\n* **Gemini 2.5:** Google announced \u001b[0m\n",
"\u001b[32msignificant advancements in its Gemini model, boasting improved performance across various benchmarks \u001b[0m\u001b[32m(\u001b[0m\u001b[32mLMArena, \u001b[0m\n",
"\u001b[32mWebDev Arena\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and highlighting its capabilities in coding, reasoning, and multi-modal tasks. Gemini 2.5 Pro and \u001b[0m\n",
"\u001b[32mGemini 2.5 Flash were both detailed, with Flash emphasizing speed and efficiency. A new \"Deep Think\" mode was also\u001b[0m\n",
"\u001b[32mteased, promising even greater performance but with a focus on further safety evaluations before wider \u001b[0m\n",
"\u001b[32mrelease.\\n\\n* **Gemini App Updates:** The Gemini app received major updates, including:\\n * **Agent Mode:** \u001b[0m\n",
"\u001b[32mAllows the app to perform multi-step tasks on behalf of the user \u001b[0m\u001b[32m(\u001b[0m\u001b[32me.g., finding apartments, booking \u001b[0m\n",
"\u001b[32mappointments\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\\n * **Personalized Smart Replies:** Generates email replies in the user\\'s style and tone using \u001b[0m\n",
"\u001b[32mpersonal context.\\n * **Gemini Live Enhancements:** Added camera and screen sharing capabilities, along with \u001b[0m\n",
"\u001b[32mintegration with other Google apps.\\n\\n* **Google Search Enhancements:**\\n * **AI Overviews:** Continued growth\u001b[0m\n",
"\u001b[32mand expansion, now reaching over 1.5 billion users monthly.\\n * **AI Mode:** A complete reimagining of Google \u001b[0m\n",
"\u001b[32mSearch, leveraging Gemini 2.5 for more complex queries, conversational follow-ups, and dynamic UI adaptation. \u001b[0m\n",
"\u001b[32mFeatures like Deep Search \u001b[0m\u001b[32m(\u001b[0m\u001b[32mfor in-depth research\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and personalized suggestions based on user context were \u001b[0m\n",
"\u001b[32mhighlighted. Agentic capabilities were also integrated, allowing Search to perform tasks like booking tickets and \u001b[0m\n",
"\u001b[32mmaking reservations.\\n * **Multimodal Search \u001b[0m\u001b[32m(\u001b[0m\u001b[32mSearch Live\u001b[0m\u001b[32m)\u001b[0m\u001b[32m:** Allows users to use their camera to ask questions\u001b[0m\n",
"\u001b[32mabout the real world in real-time.\\n\\n* **Generative Media Advancements:**\\n * **Lyria 2:** An improved music \u001b[0m\n",
"\u001b[32mgeneration model capable of creating high-fidelity music with vocals.\\n * **Imagen 4:** A significantly \u001b[0m\n",
"\u001b[32mimproved image generation model with enhanced quality, speed, and text capabilities.\\n * **Veo 3:** A new video\u001b[0m\n",
"\u001b[32mgeneration model with Native Audio generation, allowing for the creation of videos with realistic sound effects and\u001b[0m\n",
"\u001b[32mdialogue.\\n * **Flow:** A new AI filmmaking tool combining Veo, Imagen, and Gemini, designed to streamline the \u001b[0m\n",
"\u001b[32mcreative process for filmmakers.\\n\\n* **Android XR:** Google showcased its Android XR platform, designed for a \u001b[0m\n",
"\u001b[32mrange of devices including headsets and glasses. The platform integrates Gemini for enhanced contextual awareness \u001b[0m\n",
"\u001b[32mand assistance. Partnerships with Samsung, Gentle Monster, and Warby Parker were announced for headset and glasses\u001b[0m\n",
"\u001b[32mdevelopment. A live demo showcased the capabilities of Android XR glasses.\\n\\n* **Project Astra and Mariner:** \u001b[0m\n",
"\u001b[32mThese research projects, previously showcased in earlier I/O events, are now being integrated into various Google \u001b[0m\n",
"\u001b[32mproducts, demonstrating the transition of research prototypes into real-world applications.\\n\\n* **New AI \u001b[0m\n",
"\u001b[32mSubscription Plans:** Google announced two new AI subscription plans: Google AI Pro and Google AI Ultra, offering \u001b[0m\n",
"\u001b[32mvarying levels of access to AI features and capabilities.\\n\\n**Overall Tone and Message:**\\n\\nThe keynote \u001b[0m\n",
"\u001b[32memphasized Google\\'s significant progress in AI, particularly with Gemini, and its commitment to integrating AI \u001b[0m\n",
"\u001b[32minto its existing products and creating new experiences. The focus was on making AI more personal, proactive, and \u001b[0m\n",
"\u001b[32mpowerful for users, while also highlighting the potential of AI to accelerate scientific discovery and address \u001b[0m\n",
"\u001b[32msocietal challenges. The keynote also stressed collaboration with developers and the creative community to shape \u001b[0m\n",
"\u001b[32mthe future of AI.'\u001b[0m \u001b[33madditional_kwargs\u001b[0m=\u001b[1m{\u001b[0m\u001b[1m}\u001b[0m \u001b[33mresponse_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'prompt_feedback'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'block_reason'\u001b[0m: \u001b[1;36m0\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m:\n",
"\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m, \u001b[32m'finish_reason'\u001b[0m: \u001b[32m'STOP'\u001b[0m, \u001b[32m'model_name'\u001b[0m: \u001b[32m'gemini-1.5-flash'\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m \n",
"\u001b[33mid\u001b[0m=\u001b[32m'run--b7e022e0-d8e3-41d9-a73c-a2c90ad5a013-0'\u001b[0m \u001b[33musage_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'input_tokens'\u001b[0m: \u001b[1;36m21590\u001b[0m, \u001b[32m'output_tokens'\u001b[0m: \u001b[1;36m733\u001b[0m, \n",
"\u001b[32m'total_tokens'\u001b[0m: \u001b[1;36m22323\u001b[0m, \u001b[32m'input_token_details'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'cache_read'\u001b[0m: \u001b[1;36m0\u001b[0m\u001b[1m}\u001b[0m\u001b[1m}\u001b[0m\n",
"\n",
"\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"summary = youtube_transcript_response(\"https://www.youtube.com/watch?v=o8NiE3XMPrM&t=6648s\", \n",
" 'summarize in bullets and themes', llmgoogle)\n",
"print(summary)"
]
},
{
"cell_type": "markdown",
"id": "7a00c605",
"metadata": {},
"source": [
"You can also now do simple phrase search and get summarise of topk videos relevant to the search phrase "
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "1d4a028c",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:08:47,538] INFO utils.websearch_utils: Found YouTube video: Qwen 3 Coder: NEW Agentic Coding LLM! Insanely Powerful, Fast, & Free! (Opensource) by WorldofAI at https://www.youtube.com/watch?v=8jBw0CVPZPM\n",
"[2025-07-27 12:08:47,538] INFO utils.websearch_utils: Found YouTube video: Qwen 3 Coder: NEW Agentic Coding LLM! Insanely Powerful, Fast, & Free! (Opensource) by WorldofAI at https://www.youtube.com/watch?v=8jBw0CVPZPM\n",
"[2025-07-27 12:08:55,593] INFO utils.websearch_utils: Found YouTube video: Qwen Code CLI + Qwen-3 Coder 🔥 | Better Than Claude Code? - Full Tutorial by Astro K Joseph at https://www.youtube.com/watch?v=kv57HqEb2j8\n",
"[2025-07-27 12:08:55,593] INFO utils.websearch_utils: Found YouTube video: Qwen Code CLI + Qwen-3 Coder 🔥 | Better Than Claude Code? - Full Tutorial by Astro K Joseph at https://www.youtube.com/watch?v=kv57HqEb2j8\n",
"[2025-07-27 12:09:04,635] INFO utils.websearch_utils: Found YouTube video: QWEN 3 CODER is Unleashed... better than KIMI K2 by Wes Roth at https://www.youtube.com/watch?v=feAc83Qlx4Q\n",
"[2025-07-27 12:09:04,635] INFO utils.websearch_utils: Found YouTube video: QWEN 3 CODER is Unleashed... better than KIMI K2 by Wes Roth at https://www.youtube.com/watch?v=feAc83Qlx4Q\n"
]
},
{
"data": {
"text/html": [
"Generated YouTube context for query 'Qwen 3 coder reviews': \n", "\n", "Video: Qwen 3 Coder: NEW Agentic Coding LLM! Insanely Powerful, Fast, & Free! (Opensource) by WorldofAI\n", "URL: https://www.youtube.com/watch?v=8jBw0CVPZPM\n", "Transcript Summary: content='This is a detailed analysis of the YouTube video metadata and transcript.\\n\\n**Video \n", "Overview:**\\n\\nThe video is a review and demonstration of Qwen3-Coder, a new open-source agentic coding large \n", "language model (LLM) from Alibaba. The presenter highlights its capabilities, including its large context window \n", "(256K tokens, scalable to 1M), its strong performance on coding benchmarks (outperforming some closed-source \n", "models), and its accompanying command-line interface (CLI), Qwen Code. The video includes several live demos \n", "showcasing Qwen3-Coder\\'s ability to generate code for various tasks, such as creating animations, interactive \n", "dashboards, and neural network visualizers. A key selling point is that the model and its tools are completely \n", "free and open-source.\\n\\n**Strengths of the Video:**\\n\\n* **Clear and Concise Introduction:** The video clearly \n", "introduces Qwen3-Coder and its key features early on.\\n* **Compelling Visuals:** The demos are engaging and \n", "effectively demonstrate the model\\'s capabilities. The visual results of the code generation are shown, making the\n", "power of the LLM clear to viewers.\\n* **Benchmark Comparisons:** The presenter provides benchmark comparisons to \n", "other LLMs, establishing Qwen3-Coder\\'s competitive advantage.\\n* **Multiple Access Methods:** The video explains \n", "multiple ways to access and use Qwen3-Coder (chatbot, API, local installation).\\n* **Well-Structured Content:** The\n", "video is logically organized, moving from an introduction to demos and concluding with a call to action.\\n* \n", "**Effective Use of Keywords and Hashtags:** The metadata and description are well-optimized for search, using \n", "relevant keywords and hashtags.\\n* **Sponsor Integration:** The sponsor message is integrated naturally and \n", "doesn\\'t disrupt the flow of the video.\\n\\n\\n**Areas for Improvement:**\\n\\n* **Transcript Accuracy:** While the \n", "transcript is generally accurate, there are a few minor typos and inconsistencies (e.g., \"Coin 3\" instead of \"Qwen \n", "3\" in several places). A thorough proofread would improve the quality.\\n* **Demo Complexity:** While the demos are\n", "impressive, some viewers might find them too advanced. Including simpler demos could broaden the appeal to a wider\n", "audience.\\n* **Technical Depth:** The video could benefit from a slightly deeper dive into the technical aspects \n", "of Qwen3-Coder\\'s architecture (Mixture of Experts) for a more technically inclined audience. A brief explanation \n", "of how the 256K context window works would also be beneficial.\\n* **Call to Action Clarity:** While the video has \n", "multiple calls to action (subscribe, donate, join Discord), consolidating them might make them more \n", "impactful.\\n\\n\\n**Overall:**\\n\\nThe YouTube video is well-produced and effectively communicates the value \n", "proposition of Qwen3-Coder. The engaging demos and clear explanations make it a valuable resource for developers \n", "and AI enthusiasts interested in open-source coding LLMs. Addressing the minor areas for improvement would further\n", "enhance its impact and reach.' additional_kwargs={} response_metadata={'prompt_feedback': {'block_reason': 0, \n", "'safety_ratings': []}, 'finish_reason': 'STOP', 'model_name': 'gemini-1.5-flash', 'safety_ratings': []} \n", "id='run--327884b3-8a87-417e-ba81-0e0e748223e1-0' usage_metadata={'input_tokens': 3267, 'output_tokens': 624, \n", "'total_tokens': 3891, 'input_token_details': {'cache_read': 0}}\n", "\n", "\n", "\n", "Video: Qwen Code CLI + Qwen-3 Coder 🔥 | Better Than Claude Code? - Full Tutorial by Astro K Joseph\n", "URL: https://www.youtube.com/watch?v=kv57HqEb2j8\n", "Transcript Summary: content='Here\\'s a breakdown of the YouTube video transcript, organized for clarity and \n", "SEO:\\n\\n**Title:** Qwen Code CLI + Qwen-3 Coder 🔥 | Better Than Claude Code? - Full Tutorial\\n\\n**Meta \n", "Description:** Learn how to set up and use the new Qwen Code CLI with the Qwen-3 Coder AI model. This full tutorial\n", "covers installation, API key configuration, and practical examples. Is it better than Claude Code? Find \n", "out!\\n\\n**Tags:** Qwen Code CLI, Qwen-3 Coder, AI powered CLI, AI coding, code generation, tutorial, OpenRouter, \n", "large language model, LLM, coding assistant, Gemini Code, Claude Code, software development, programming, AI \n", "tools, NodeJS, npm\\n\\n\\n**Video Summary:**\\n\\nThis tutorial demonstrates how to set up and use the newly released \n", "Qwen Code CLI, an AI-powered command-line interface, with the Qwen-3 Coder AI model. The video compares it \n", "implicitly to other AI CLIs like Claude Code and Gemini Code. The presenter walks viewers through the installation\n", "process (requiring NodeJS), API key configuration using OpenRouter, and provides practical examples of generating \n", "code for a tic-tac-toe game and a landing page. The video also explores using Qwen Code to analyze existing \n", "codebases and understand their architecture. While initially showcasing smooth code generation, the video later \n", "encounters some challenges with longer, more complex prompts, highlighting potential limitations.\\n\\n\\n**Key \n", "Sections & Timestamps (estimated, based on transcript length):**\\n\\n* **0:00-2:00:** Introduction – Announcing Qwen\n", "Code CLI and Qwen-3 Coder, highlighting the trend of AI-powered CLIs.\\n* **2:00-4:00:** Installation – Explaining \n", "the prerequisites (NodeJS) and providing the `npm` installation command.\\n* **4:00-6:00:** API Key Setup – Showing\n", "how to obtain an API key from OpenRouter and configure environment variables.\\n* **6:00-8:00:** Basic Usage – \n", "Demonstrating simple interactions with the CLI and generating a basic tic-tac-toe game.\\n* **8:00-11:00:** Landing\n", "Page Example – Attempting to generate a more complex landing page, encountering some delays and issues. This \n", "section highlights potential limitations and the need for iterative refinement of prompts.\\n* **11:00-12:00:** Code\n", "Analysis – Using Qwen Code to analyze an existing Next.js project and generate a summary of its architecture.\\n* \n", "**12:00-12:45:** Conclusion – Recap of the process, additional features mentioned (like MCP integration), and call\n", "to action.\\n\\n\\n**Improvements for the Video:**\\n\\n* **Address the \"Better than Claude Code?\" question directly:** \n", "The video title raises this question, but the comparison is implicit. A more direct comparison, perhaps with \n", "side-by-side examples, would strengthen the video.\\n* **Troubleshooting the Landing Page Issue:** The video \n", "encounters difficulties generating the landing page. Addressing this directly, perhaps by showing successful \n", "generation after prompt refinement or explaining potential reasons for the delay, would improve the tutorial\\'s \n", "completeness.\\n* **Time Stamps:** Adding timestamps to the video description would greatly improve user \n", "experience.\\n* **Show more advanced features:** The video briefly mentions MCP integration. Demonstrating this or\n", "other advanced features would add value.\\n* **Visuals:** The video could benefit from more visual aids, such as \n", "screen recordings showing the code being generated in real-time.\\n\\n\\nBy addressing these points, the video would \n", "become a more comprehensive and compelling tutorial on using Qwen Code CLI.' additional_kwargs={} \n", "response_metadata={'prompt_feedback': {'block_reason': 0, 'safety_ratings': []}, 'finish_reason': 'STOP', \n", "'model_name': 'gemini-1.5-flash', 'safety_ratings': []} id='run--8949b5c8-f8a8-49d3-a091-c0f356eceefc-0' \n", "usage_metadata={'input_tokens': 3493, 'output_tokens': 784, 'total_tokens': 4277, 'input_token_details': \n", "{'cache_read': 0}}\n", "\n", "\n", "\n", "Video: QWEN 3 CODER is Unleashed... better than KIMI K2 by Wes Roth\n", "URL: https://www.youtube.com/watch?v=feAc83Qlx4Q\n", "Transcript Summary: content='This is a detailed summary of the YouTube video about Qwen-3-Coder, an open-source AI \n", "coding model.\\n\\n**Key Points:**\\n\\n* **Qwen-3-Coder\\'s Superiority:** The video highlights Qwen-3-Coder\\'s \n", "performance surpassing other models like Kim K2, GPT-4.1, and even showing competitiveness with Claude Sonnet in \n", "various benchmarks. Its strength lies in agentic coding tasks, involving multi-turn interactions and tool \n", "use.\\n\\n* **Model Size and Architecture:** Qwen-3-Coder is a 480B parameter model, but utilizes a Mixture of \n", "Experts approach, keeping only 35B parameters active during inference. It\\'s described as an \"instruct\" model, \n", "meaning it\\'s designed for helpful and friendly interactions.\\n\\n* **Reinforcement Learning (RL) Training:** A \n", "significant portion of the video focuses on the model\\'s RL training. Unlike other models focusing on \n", "competition-style coding problems, Qwen-3-Coder was trained on real-world coding tasks, leading to improved \n", "generalization across various tasks (code generation, math problems, etc.). The training involved a scalable \n", "system running 20,000 parallel environments.\\n\\n* **Agentic Capabilities and Tools:** The model\\'s ability to \n", "perform agentic coding is emphasized. It seamlessly integrates with tools like Qwen Code (a CLI tool forked from \n", "Gemini Code) and Claude Code, enabling complex interactions with the environment.\\n\\n* **Real-World \n", "Demonstrations:** The video showcases several impressive demonstrations of Qwen-3-Coder\\'s capabilities, including \n", "building simulations, game creation (a drone game, Minecraft clone), and interactive visualizations.\\n\\n* \n", "**Open-Source Availability:** The model and associated tools are open-source, available on Hugging Face and \n", "GitHub, fostering community contributions and development.\\n\\n* **Future Implications:** The presenter expresses \n", "surprise at the rapid advancement of open-source AI, suggesting it\\'s closing the gap with leading proprietary \n", "models much faster than anticipated.\\n\\n\\n**Overall:**\\n\\nThe video presents a very positive and enthusiastic \n", "review of Qwen-3-Coder, emphasizing its impressive performance, innovative training methodology, and open-source \n", "nature. It positions the model as a significant advancement in the field of large language models and agentic \n", "coding. The presenter\\'s hands-on demonstrations further solidify this positive assessment.' additional_kwargs={} \n", "response_metadata={'prompt_feedback': {'block_reason': 0, 'safety_ratings': []}, 'finish_reason': 'STOP', \n", "'model_name': 'gemini-1.5-flash', 'safety_ratings': []} id='run--59f2073a-7d87-4ff0-9a2e-aa2dea885451-0' \n", "usage_metadata={'input_tokens': 2078, 'output_tokens': 495, 'total_tokens': 2573, 'input_token_details': \n", "{'cache_read': 0}}\n", "\n", "\n", "\n" ], "text/plain": [ "Generated YouTube context for query \u001b[32m'Qwen 3 coder reviews'\u001b[0m: \n", "\n", "Video: Qwen \u001b[1;36m3\u001b[0m Coder: NEW Agentic Coding LLM! Insanely Powerful, Fast, & Free! \u001b[1m(\u001b[0mOpensource\u001b[1m)\u001b[0m by WorldofAI\n", "URL: \u001b[4;94mhttps://www.youtube.com/watch?\u001b[0m\u001b[4;94mv\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94m8jBw0CVPZPM\u001b[0m\n", "Transcript Summary: \u001b[33mcontent\u001b[0m=\u001b[32m'This is a detailed analysis of the YouTube video metadata and transcript.\\n\\n**Video \u001b[0m\n", "\u001b[32mOverview:**\\n\\nThe video is a review and demonstration of Qwen3-Coder, a new open-source agentic coding large \u001b[0m\n", "\u001b[32mlanguage model \u001b[0m\u001b[32m(\u001b[0m\u001b[32mLLM\u001b[0m\u001b[32m)\u001b[0m\u001b[32m from Alibaba. The presenter highlights its capabilities, including its large context window \u001b[0m\n", "\u001b[32m(\u001b[0m\u001b[32m256K tokens, scalable to 1M\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, its strong performance on coding benchmarks \u001b[0m\u001b[32m(\u001b[0m\u001b[32moutperforming some closed-source \u001b[0m\n", "\u001b[32mmodels\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, and its accompanying command-line interface \u001b[0m\u001b[32m(\u001b[0m\u001b[32mCLI\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, Qwen Code. The video includes several live demos \u001b[0m\n", "\u001b[32mshowcasing Qwen3-Coder\\'s ability to generate code for various tasks, such as creating animations, interactive \u001b[0m\n", "\u001b[32mdashboards, and neural network visualizers. A key selling point is that the model and its tools are completely \u001b[0m\n", "\u001b[32mfree and open-source.\\n\\n**Strengths of the Video:**\\n\\n* **Clear and Concise Introduction:** The video clearly \u001b[0m\n", "\u001b[32mintroduces Qwen3-Coder and its key features early on.\\n* **Compelling Visuals:** The demos are engaging and \u001b[0m\n", "\u001b[32meffectively demonstrate the model\\'s capabilities. The visual results of the code generation are shown, making the\u001b[0m\n", "\u001b[32mpower of the LLM clear to viewers.\\n* **Benchmark Comparisons:** The presenter provides benchmark comparisons to \u001b[0m\n", "\u001b[32mother LLMs, establishing Qwen3-Coder\\'s competitive advantage.\\n* **Multiple Access Methods:** The video explains \u001b[0m\n", "\u001b[32mmultiple ways to access and use Qwen3-Coder \u001b[0m\u001b[32m(\u001b[0m\u001b[32mchatbot, API, local installation\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\\n* **Well-Structured Content:** The\u001b[0m\n", "\u001b[32mvideo is logically organized, moving from an introduction to demos and concluding with a call to action.\\n* \u001b[0m\n", "\u001b[32m**Effective Use of Keywords and Hashtags:** The metadata and description are well-optimized for search, using \u001b[0m\n", "\u001b[32mrelevant keywords and hashtags.\\n* **Sponsor Integration:** The sponsor message is integrated naturally and \u001b[0m\n", "\u001b[32mdoesn\\'t disrupt the flow of the video.\\n\\n\\n**Areas for Improvement:**\\n\\n* **Transcript Accuracy:** While the \u001b[0m\n", "\u001b[32mtranscript is generally accurate, there are a few minor typos and inconsistencies \u001b[0m\u001b[32m(\u001b[0m\u001b[32me.g., \"Coin 3\" instead of \"Qwen \u001b[0m\n", "\u001b[32m3\" in several places\u001b[0m\u001b[32m)\u001b[0m\u001b[32m. A thorough proofread would improve the quality.\\n* **Demo Complexity:** While the demos are\u001b[0m\n", "\u001b[32mimpressive, some viewers might find them too advanced. Including simpler demos could broaden the appeal to a wider\u001b[0m\n", "\u001b[32maudience.\\n* **Technical Depth:** The video could benefit from a slightly deeper dive into the technical aspects \u001b[0m\n", "\u001b[32mof Qwen3-Coder\\'s architecture \u001b[0m\u001b[32m(\u001b[0m\u001b[32mMixture of Experts\u001b[0m\u001b[32m)\u001b[0m\u001b[32m for a more technically inclined audience. A brief explanation \u001b[0m\n", "\u001b[32mof how the 256K context window works would also be beneficial.\\n* **Call to Action Clarity:** While the video has \u001b[0m\n", "\u001b[32mmultiple calls to action \u001b[0m\u001b[32m(\u001b[0m\u001b[32msubscribe, donate, join Discord\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, consolidating them might make them more \u001b[0m\n", "\u001b[32mimpactful.\\n\\n\\n**Overall:**\\n\\nThe YouTube video is well-produced and effectively communicates the value \u001b[0m\n", "\u001b[32mproposition of Qwen3-Coder. The engaging demos and clear explanations make it a valuable resource for developers \u001b[0m\n", "\u001b[32mand AI enthusiasts interested in open-source coding LLMs. Addressing the minor areas for improvement would further\u001b[0m\n", "\u001b[32menhance its impact and reach.'\u001b[0m \u001b[33madditional_kwargs\u001b[0m=\u001b[1m{\u001b[0m\u001b[1m}\u001b[0m \u001b[33mresponse_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'prompt_feedback'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'block_reason'\u001b[0m: \u001b[1;36m0\u001b[0m, \n", "\u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m, \u001b[32m'finish_reason'\u001b[0m: \u001b[32m'STOP'\u001b[0m, \u001b[32m'model_name'\u001b[0m: \u001b[32m'gemini-1.5-flash'\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m \n", "\u001b[33mid\u001b[0m=\u001b[32m'run--327884b3-8a87-417e-ba81-0e0e748223e1-0'\u001b[0m \u001b[33musage_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'input_tokens'\u001b[0m: \u001b[1;36m3267\u001b[0m, \u001b[32m'output_tokens'\u001b[0m: \u001b[1;36m624\u001b[0m, \n", "\u001b[32m'total_tokens'\u001b[0m: \u001b[1;36m3891\u001b[0m, \u001b[32m'input_token_details'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'cache_read'\u001b[0m: \u001b[1;36m0\u001b[0m\u001b[1m}\u001b[0m\u001b[1m}\u001b[0m\n", "\n", "\n", "\n", "Video: Qwen Code CLI + Qwen-\u001b[1;36m3\u001b[0m Coder 🔥 | Better Than Claude Code? - Full Tutorial by Astro K Joseph\n", "URL: \u001b[4;94mhttps://www.youtube.com/watch?\u001b[0m\u001b[4;94mv\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94mkv57HqEb2j8\u001b[0m\n", "Transcript Summary: \u001b[33mcontent\u001b[0m=\u001b[32m'Here\\'s a breakdown of the YouTube video transcript, organized for clarity and \u001b[0m\n", "\u001b[32mSEO:\\n\\n**Title:** Qwen Code CLI + Qwen-3 Coder 🔥 | Better Than Claude Code? - Full Tutorial\\n\\n**Meta \u001b[0m\n", "\u001b[32mDescription:** Learn how to set up and use the new Qwen Code CLI with the Qwen-3 Coder AI model. This full tutorial\u001b[0m\n", "\u001b[32mcovers installation, API key configuration, and practical examples. Is it better than Claude Code? Find \u001b[0m\n", "\u001b[32mout!\\n\\n**Tags:** Qwen Code CLI, Qwen-3 Coder, AI powered CLI, AI coding, code generation, tutorial, OpenRouter, \u001b[0m\n", "\u001b[32mlarge language model, LLM, coding assistant, Gemini Code, Claude Code, software development, programming, AI \u001b[0m\n", "\u001b[32mtools, NodeJS, npm\\n\\n\\n**Video Summary:**\\n\\nThis tutorial demonstrates how to set up and use the newly released \u001b[0m\n", "\u001b[32mQwen Code CLI, an AI-powered command-line interface, with the Qwen-3 Coder AI model. The video compares it \u001b[0m\n", "\u001b[32mimplicitly to other AI CLIs like Claude Code and Gemini Code. The presenter walks viewers through the installation\u001b[0m\n", "\u001b[32mprocess \u001b[0m\u001b[32m(\u001b[0m\u001b[32mrequiring NodeJS\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, API key configuration using OpenRouter, and provides practical examples of generating \u001b[0m\n", "\u001b[32mcode for a tic-tac-toe game and a landing page. The video also explores using Qwen Code to analyze existing \u001b[0m\n", "\u001b[32mcodebases and understand their architecture. While initially showcasing smooth code generation, the video later \u001b[0m\n", "\u001b[32mencounters some challenges with longer, more complex prompts, highlighting potential limitations.\\n\\n\\n**Key \u001b[0m\n", "\u001b[32mSections & Timestamps \u001b[0m\u001b[32m(\u001b[0m\u001b[32mestimated, based on transcript length\u001b[0m\u001b[32m)\u001b[0m\u001b[32m:**\\n\\n* **0:00-2:00:** Introduction – Announcing Qwen\u001b[0m\n", "\u001b[32mCode CLI and Qwen-3 Coder, highlighting the trend of AI-powered CLIs.\\n* **2:00-4:00:** Installation – Explaining \u001b[0m\n", "\u001b[32mthe prerequisites \u001b[0m\u001b[32m(\u001b[0m\u001b[32mNodeJS\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and providing the `npm` installation command.\\n* **4:00-6:00:** API Key Setup – Showing\u001b[0m\n", "\u001b[32mhow to obtain an API key from OpenRouter and configure environment variables.\\n* **6:00-8:00:** Basic Usage – \u001b[0m\n", "\u001b[32mDemonstrating simple interactions with the CLI and generating a basic tic-tac-toe game.\\n* **8:00-11:00:** Landing\u001b[0m\n", "\u001b[32mPage Example – Attempting to generate a more complex landing page, encountering some delays and issues. This \u001b[0m\n", "\u001b[32msection highlights potential limitations and the need for iterative refinement of prompts.\\n* **11:00-12:00:** Code\u001b[0m\n", "\u001b[32mAnalysis – Using Qwen Code to analyze an existing Next.js project and generate a summary of its architecture.\\n* \u001b[0m\n", "\u001b[32m**12:00-12:45:** Conclusion – Recap of the process, additional features mentioned \u001b[0m\u001b[32m(\u001b[0m\u001b[32mlike MCP integration\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, and call\u001b[0m\n", "\u001b[32mto action.\\n\\n\\n**Improvements for the Video:**\\n\\n* **Address the \"Better than Claude Code?\" question directly:** \u001b[0m\n", "\u001b[32mThe video title raises this question, but the comparison is implicit. A more direct comparison, perhaps with \u001b[0m\n", "\u001b[32mside-by-side examples, would strengthen the video.\\n* **Troubleshooting the Landing Page Issue:** The video \u001b[0m\n", "\u001b[32mencounters difficulties generating the landing page. Addressing this directly, perhaps by showing successful \u001b[0m\n", "\u001b[32mgeneration after prompt refinement or explaining potential reasons for the delay, would improve the tutorial\\'s \u001b[0m\n", "\u001b[32mcompleteness.\\n* **Time Stamps:** Adding timestamps to the video description would greatly improve user \u001b[0m\n", "\u001b[32mexperience.\\n* **Show more advanced features:** The video briefly mentions MCP integration. Demonstrating this or\u001b[0m\n", "\u001b[32mother advanced features would add value.\\n* **Visuals:** The video could benefit from more visual aids, such as \u001b[0m\n", "\u001b[32mscreen recordings showing the code being generated in real-time.\\n\\n\\nBy addressing these points, the video would \u001b[0m\n", "\u001b[32mbecome a more comprehensive and compelling tutorial on using Qwen Code CLI.'\u001b[0m \u001b[33madditional_kwargs\u001b[0m=\u001b[1m{\u001b[0m\u001b[1m}\u001b[0m \n", "\u001b[33mresponse_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'prompt_feedback'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'block_reason'\u001b[0m: \u001b[1;36m0\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m, \u001b[32m'finish_reason'\u001b[0m: \u001b[32m'STOP'\u001b[0m, \n", "\u001b[32m'model_name'\u001b[0m: \u001b[32m'gemini-1.5-flash'\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m \u001b[33mid\u001b[0m=\u001b[32m'run--8949b5c8-f8a8-49d3-a091-c0f356eceefc-0'\u001b[0m \n", "\u001b[33musage_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'input_tokens'\u001b[0m: \u001b[1;36m3493\u001b[0m, \u001b[32m'output_tokens'\u001b[0m: \u001b[1;36m784\u001b[0m, \u001b[32m'total_tokens'\u001b[0m: \u001b[1;36m4277\u001b[0m, \u001b[32m'input_token_details'\u001b[0m: \n", "\u001b[1m{\u001b[0m\u001b[32m'cache_read'\u001b[0m: \u001b[1;36m0\u001b[0m\u001b[1m}\u001b[0m\u001b[1m}\u001b[0m\n", "\n", "\n", "\n", "Video: QWEN \u001b[1;36m3\u001b[0m CODER is Unleashed\u001b[33m...\u001b[0m better than KIMI K2 by Wes Roth\n", "URL: \u001b[4;94mhttps://www.youtube.com/watch?\u001b[0m\u001b[4;94mv\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94mfeAc83Qlx4Q\u001b[0m\n", "Transcript Summary: \u001b[33mcontent\u001b[0m=\u001b[32m'This is a detailed summary of the YouTube video about Qwen-3-Coder, an open-source AI \u001b[0m\n", "\u001b[32mcoding model.\\n\\n**Key Points:**\\n\\n* **Qwen-3-Coder\\'s Superiority:** The video highlights Qwen-3-Coder\\'s \u001b[0m\n", "\u001b[32mperformance surpassing other models like Kim K2, GPT-4.1, and even showing competitiveness with Claude Sonnet in \u001b[0m\n", "\u001b[32mvarious benchmarks. Its strength lies in agentic coding tasks, involving multi-turn interactions and tool \u001b[0m\n", "\u001b[32muse.\\n\\n* **Model Size and Architecture:** Qwen-3-Coder is a 480B parameter model, but utilizes a Mixture of \u001b[0m\n", "\u001b[32mExperts approach, keeping only 35B parameters active during inference. It\\'s described as an \"instruct\" model, \u001b[0m\n", "\u001b[32mmeaning it\\'s designed for helpful and friendly interactions.\\n\\n* **Reinforcement Learning \u001b[0m\u001b[32m(\u001b[0m\u001b[32mRL\u001b[0m\u001b[32m)\u001b[0m\u001b[32m Training:** A \u001b[0m\n", "\u001b[32msignificant portion of the video focuses on the model\\'s RL training. Unlike other models focusing on \u001b[0m\n", "\u001b[32mcompetition-style coding problems, Qwen-3-Coder was trained on real-world coding tasks, leading to improved \u001b[0m\n", "\u001b[32mgeneralization across various tasks \u001b[0m\u001b[32m(\u001b[0m\u001b[32mcode generation, math problems, etc.\u001b[0m\u001b[32m)\u001b[0m\u001b[32m. The training involved a scalable \u001b[0m\n", "\u001b[32msystem running 20,000 parallel environments.\\n\\n* **Agentic Capabilities and Tools:** The model\\'s ability to \u001b[0m\n", "\u001b[32mperform agentic coding is emphasized. It seamlessly integrates with tools like Qwen Code \u001b[0m\u001b[32m(\u001b[0m\u001b[32ma CLI tool forked from \u001b[0m\n", "\u001b[32mGemini Code\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and Claude Code, enabling complex interactions with the environment.\\n\\n* **Real-World \u001b[0m\n", "\u001b[32mDemonstrations:** The video showcases several impressive demonstrations of Qwen-3-Coder\\'s capabilities, including \u001b[0m\n", "\u001b[32mbuilding simulations, game creation \u001b[0m\u001b[32m(\u001b[0m\u001b[32ma drone game, Minecraft clone\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, and interactive visualizations.\\n\\n* \u001b[0m\n", "\u001b[32m**Open-Source Availability:** The model and associated tools are open-source, available on Hugging Face and \u001b[0m\n", "\u001b[32mGitHub, fostering community contributions and development.\\n\\n* **Future Implications:** The presenter expresses \u001b[0m\n", "\u001b[32msurprise at the rapid advancement of open-source AI, suggesting it\\'s closing the gap with leading proprietary \u001b[0m\n", "\u001b[32mmodels much faster than anticipated.\\n\\n\\n**Overall:**\\n\\nThe video presents a very positive and enthusiastic \u001b[0m\n", "\u001b[32mreview of Qwen-3-Coder, emphasizing its impressive performance, innovative training methodology, and open-source \u001b[0m\n", "\u001b[32mnature. It positions the model as a significant advancement in the field of large language models and agentic \u001b[0m\n", "\u001b[32mcoding. The presenter\\'s hands-on demonstrations further solidify this positive assessment.'\u001b[0m \u001b[33madditional_kwargs\u001b[0m=\u001b[1m{\u001b[0m\u001b[1m}\u001b[0m \n", "\u001b[33mresponse_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'prompt_feedback'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'block_reason'\u001b[0m: \u001b[1;36m0\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m, \u001b[32m'finish_reason'\u001b[0m: \u001b[32m'STOP'\u001b[0m, \n", "\u001b[32m'model_name'\u001b[0m: \u001b[32m'gemini-1.5-flash'\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m \u001b[33mid\u001b[0m=\u001b[32m'run--59f2073a-7d87-4ff0-9a2e-aa2dea885451-0'\u001b[0m \n", "\u001b[33musage_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'input_tokens'\u001b[0m: \u001b[1;36m2078\u001b[0m, \u001b[32m'output_tokens'\u001b[0m: \u001b[1;36m495\u001b[0m, \u001b[32m'total_tokens'\u001b[0m: \u001b[1;36m2573\u001b[0m, \u001b[32m'input_token_details'\u001b[0m: \n", "\u001b[1m{\u001b[0m\u001b[32m'cache_read'\u001b[0m: \u001b[1;36m0\u001b[0m\u001b[1m}\u001b[0m\u001b[1m}\u001b[0m\n", "\n", "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n",
"\n",
"Video: Qwen 3 Coder: NEW Agentic Coding LLM! Insanely Powerful, Fast, & Free! (Opensource) by WorldofAI\n",
"URL: https://www.youtube.com/watch?v=8jBw0CVPZPM\n",
"Transcript Summary: content='This is a detailed analysis of the YouTube video metadata and transcript.\\n\\n**Video \n",
"Overview:**\\n\\nThe video is a review and demonstration of Qwen3-Coder, a new open-source agentic coding large \n",
"language model (LLM) from Alibaba. The presenter highlights its capabilities, including its large context window \n",
"(256K tokens, scalable to 1M), its strong performance on coding benchmarks (outperforming some closed-source \n",
"models), and its accompanying command-line interface (CLI), Qwen Code. The video includes several live demos \n",
"showcasing Qwen3-Coder\\'s ability to generate code for various tasks, such as creating animations, interactive \n",
"dashboards, and neural network visualizers. A key selling point is that the model and its tools are completely \n",
"free and open-source.\\n\\n**Strengths of the Video:**\\n\\n* **Clear and Concise Introduction:** The video clearly \n",
"introduces Qwen3-Coder and its key features early on.\\n* **Compelling Visuals:** The demos are engaging and \n",
"effectively demonstrate the model\\'s capabilities. The visual results of the code generation are shown, making the\n",
"power of the LLM clear to viewers.\\n* **Benchmark Comparisons:** The presenter provides benchmark comparisons to \n",
"other LLMs, establishing Qwen3-Coder\\'s competitive advantage.\\n* **Multiple Access Methods:** The video explains \n",
"multiple ways to access and use Qwen3-Coder (chatbot, API, local installation).\\n* **Well-Structured Content:** The\n",
"video is logically organized, moving from an introduction to demos and concluding with a call to action.\\n* \n",
"**Effective Use of Keywords and Hashtags:** The metadata and description are well-optimized for search, using \n",
"relevant keywords and hashtags.\\n* **Sponsor Integration:** The sponsor message is integrated naturally and \n",
"doesn\\'t disrupt the flow of the video.\\n\\n\\n**Areas for Improvement:**\\n\\n* **Transcript Accuracy:** While the \n",
"transcript is generally accurate, there are a few minor typos and inconsistencies (e.g., \"Coin 3\" instead of \"Qwen \n",
"3\" in several places). A thorough proofread would improve the quality.\\n* **Demo Complexity:** While the demos are\n",
"impressive, some viewers might find them too advanced. Including simpler demos could broaden the appeal to a wider\n",
"audience.\\n* **Technical Depth:** The video could benefit from a slightly deeper dive into the technical aspects \n",
"of Qwen3-Coder\\'s architecture (Mixture of Experts) for a more technically inclined audience. A brief explanation \n",
"of how the 256K context window works would also be beneficial.\\n* **Call to Action Clarity:** While the video has \n",
"multiple calls to action (subscribe, donate, join Discord), consolidating them might make them more \n",
"impactful.\\n\\n\\n**Overall:**\\n\\nThe YouTube video is well-produced and effectively communicates the value \n",
"proposition of Qwen3-Coder. The engaging demos and clear explanations make it a valuable resource for developers \n",
"and AI enthusiasts interested in open-source coding LLMs. Addressing the minor areas for improvement would further\n",
"enhance its impact and reach.' additional_kwargs={} response_metadata={'prompt_feedback': {'block_reason': 0, \n",
"'safety_ratings': []}, 'finish_reason': 'STOP', 'model_name': 'gemini-1.5-flash', 'safety_ratings': []} \n",
"id='run--327884b3-8a87-417e-ba81-0e0e748223e1-0' usage_metadata={'input_tokens': 3267, 'output_tokens': 624, \n",
"'total_tokens': 3891, 'input_token_details': {'cache_read': 0}}\n",
"\n",
"\n",
"\n",
"Video: Qwen Code CLI + Qwen-3 Coder 🔥 | Better Than Claude Code? - Full Tutorial by Astro K Joseph\n",
"URL: https://www.youtube.com/watch?v=kv57HqEb2j8\n",
"Transcript Summary: content='Here\\'s a breakdown of the YouTube video transcript, organized for clarity and \n",
"SEO:\\n\\n**Title:** Qwen Code CLI + Qwen-3 Coder 🔥 | Better Than Claude Code? - Full Tutorial\\n\\n**Meta \n",
"Description:** Learn how to set up and use the new Qwen Code CLI with the Qwen-3 Coder AI model. This full tutorial\n",
"covers installation, API key configuration, and practical examples. Is it better than Claude Code? Find \n",
"out!\\n\\n**Tags:** Qwen Code CLI, Qwen-3 Coder, AI powered CLI, AI coding, code generation, tutorial, OpenRouter, \n",
"large language model, LLM, coding assistant, Gemini Code, Claude Code, software development, programming, AI \n",
"tools, NodeJS, npm\\n\\n\\n**Video Summary:**\\n\\nThis tutorial demonstrates how to set up and use the newly released \n",
"Qwen Code CLI, an AI-powered command-line interface, with the Qwen-3 Coder AI model. The video compares it \n",
"implicitly to other AI CLIs like Claude Code and Gemini Code. The presenter walks viewers through the installation\n",
"process (requiring NodeJS), API key configuration using OpenRouter, and provides practical examples of generating \n",
"code for a tic-tac-toe game and a landing page. The video also explores using Qwen Code to analyze existing \n",
"codebases and understand their architecture. While initially showcasing smooth code generation, the video later \n",
"encounters some challenges with longer, more complex prompts, highlighting potential limitations.\\n\\n\\n**Key \n",
"Sections & Timestamps (estimated, based on transcript length):**\\n\\n* **0:00-2:00:** Introduction – Announcing Qwen\n",
"Code CLI and Qwen-3 Coder, highlighting the trend of AI-powered CLIs.\\n* **2:00-4:00:** Installation – Explaining \n",
"the prerequisites (NodeJS) and providing the `npm` installation command.\\n* **4:00-6:00:** API Key Setup – Showing\n",
"how to obtain an API key from OpenRouter and configure environment variables.\\n* **6:00-8:00:** Basic Usage – \n",
"Demonstrating simple interactions with the CLI and generating a basic tic-tac-toe game.\\n* **8:00-11:00:** Landing\n",
"Page Example – Attempting to generate a more complex landing page, encountering some delays and issues. This \n",
"section highlights potential limitations and the need for iterative refinement of prompts.\\n* **11:00-12:00:** Code\n",
"Analysis – Using Qwen Code to analyze an existing Next.js project and generate a summary of its architecture.\\n* \n",
"**12:00-12:45:** Conclusion – Recap of the process, additional features mentioned (like MCP integration), and call\n",
"to action.\\n\\n\\n**Improvements for the Video:**\\n\\n* **Address the \"Better than Claude Code?\" question directly:** \n",
"The video title raises this question, but the comparison is implicit. A more direct comparison, perhaps with \n",
"side-by-side examples, would strengthen the video.\\n* **Troubleshooting the Landing Page Issue:** The video \n",
"encounters difficulties generating the landing page. Addressing this directly, perhaps by showing successful \n",
"generation after prompt refinement or explaining potential reasons for the delay, would improve the tutorial\\'s \n",
"completeness.\\n* **Time Stamps:** Adding timestamps to the video description would greatly improve user \n",
"experience.\\n* **Show more advanced features:** The video briefly mentions MCP integration. Demonstrating this or\n",
"other advanced features would add value.\\n* **Visuals:** The video could benefit from more visual aids, such as \n",
"screen recordings showing the code being generated in real-time.\\n\\n\\nBy addressing these points, the video would \n",
"become a more comprehensive and compelling tutorial on using Qwen Code CLI.' additional_kwargs={} \n",
"response_metadata={'prompt_feedback': {'block_reason': 0, 'safety_ratings': []}, 'finish_reason': 'STOP', \n",
"'model_name': 'gemini-1.5-flash', 'safety_ratings': []} id='run--8949b5c8-f8a8-49d3-a091-c0f356eceefc-0' \n",
"usage_metadata={'input_tokens': 3493, 'output_tokens': 784, 'total_tokens': 4277, 'input_token_details': \n",
"{'cache_read': 0}}\n",
"\n",
"\n",
"\n",
"Video: QWEN 3 CODER is Unleashed... better than KIMI K2 by Wes Roth\n",
"URL: https://www.youtube.com/watch?v=feAc83Qlx4Q\n",
"Transcript Summary: content='This is a detailed summary of the YouTube video about Qwen-3-Coder, an open-source AI \n",
"coding model.\\n\\n**Key Points:**\\n\\n* **Qwen-3-Coder\\'s Superiority:** The video highlights Qwen-3-Coder\\'s \n",
"performance surpassing other models like Kim K2, GPT-4.1, and even showing competitiveness with Claude Sonnet in \n",
"various benchmarks. Its strength lies in agentic coding tasks, involving multi-turn interactions and tool \n",
"use.\\n\\n* **Model Size and Architecture:** Qwen-3-Coder is a 480B parameter model, but utilizes a Mixture of \n",
"Experts approach, keeping only 35B parameters active during inference. It\\'s described as an \"instruct\" model, \n",
"meaning it\\'s designed for helpful and friendly interactions.\\n\\n* **Reinforcement Learning (RL) Training:** A \n",
"significant portion of the video focuses on the model\\'s RL training. Unlike other models focusing on \n",
"competition-style coding problems, Qwen-3-Coder was trained on real-world coding tasks, leading to improved \n",
"generalization across various tasks (code generation, math problems, etc.). The training involved a scalable \n",
"system running 20,000 parallel environments.\\n\\n* **Agentic Capabilities and Tools:** The model\\'s ability to \n",
"perform agentic coding is emphasized. It seamlessly integrates with tools like Qwen Code (a CLI tool forked from \n",
"Gemini Code) and Claude Code, enabling complex interactions with the environment.\\n\\n* **Real-World \n",
"Demonstrations:** The video showcases several impressive demonstrations of Qwen-3-Coder\\'s capabilities, including \n",
"building simulations, game creation (a drone game, Minecraft clone), and interactive visualizations.\\n\\n* \n",
"**Open-Source Availability:** The model and associated tools are open-source, available on Hugging Face and \n",
"GitHub, fostering community contributions and development.\\n\\n* **Future Implications:** The presenter expresses \n",
"surprise at the rapid advancement of open-source AI, suggesting it\\'s closing the gap with leading proprietary \n",
"models much faster than anticipated.\\n\\n\\n**Overall:**\\n\\nThe video presents a very positive and enthusiastic \n",
"review of Qwen-3-Coder, emphasizing its impressive performance, innovative training methodology, and open-source \n",
"nature. It positions the model as a significant advancement in the field of large language models and agentic \n",
"coding. The presenter\\'s hands-on demonstrations further solidify this positive assessment.' additional_kwargs={} \n",
"response_metadata={'prompt_feedback': {'block_reason': 0, 'safety_ratings': []}, 'finish_reason': 'STOP', \n",
"'model_name': 'gemini-1.5-flash', 'safety_ratings': []} id='run--59f2073a-7d87-4ff0-9a2e-aa2dea885451-0' \n",
"usage_metadata={'input_tokens': 2078, 'output_tokens': 495, 'total_tokens': 2573, 'input_token_details': \n",
"{'cache_read': 0}}\n",
"\n",
"\n",
"\n"
],
"text/plain": [
"\n",
"\n",
"Video: Qwen \u001b[1;36m3\u001b[0m Coder: NEW Agentic Coding LLM! Insanely Powerful, Fast, & Free! \u001b[1m(\u001b[0mOpensource\u001b[1m)\u001b[0m by WorldofAI\n",
"URL: \u001b[4;94mhttps://www.youtube.com/watch?\u001b[0m\u001b[4;94mv\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94m8jBw0CVPZPM\u001b[0m\n",
"Transcript Summary: \u001b[33mcontent\u001b[0m=\u001b[32m'This is a detailed analysis of the YouTube video metadata and transcript.\\n\\n**Video \u001b[0m\n",
"\u001b[32mOverview:**\\n\\nThe video is a review and demonstration of Qwen3-Coder, a new open-source agentic coding large \u001b[0m\n",
"\u001b[32mlanguage model \u001b[0m\u001b[32m(\u001b[0m\u001b[32mLLM\u001b[0m\u001b[32m)\u001b[0m\u001b[32m from Alibaba. The presenter highlights its capabilities, including its large context window \u001b[0m\n",
"\u001b[32m(\u001b[0m\u001b[32m256K tokens, scalable to 1M\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, its strong performance on coding benchmarks \u001b[0m\u001b[32m(\u001b[0m\u001b[32moutperforming some closed-source \u001b[0m\n",
"\u001b[32mmodels\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, and its accompanying command-line interface \u001b[0m\u001b[32m(\u001b[0m\u001b[32mCLI\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, Qwen Code. The video includes several live demos \u001b[0m\n",
"\u001b[32mshowcasing Qwen3-Coder\\'s ability to generate code for various tasks, such as creating animations, interactive \u001b[0m\n",
"\u001b[32mdashboards, and neural network visualizers. A key selling point is that the model and its tools are completely \u001b[0m\n",
"\u001b[32mfree and open-source.\\n\\n**Strengths of the Video:**\\n\\n* **Clear and Concise Introduction:** The video clearly \u001b[0m\n",
"\u001b[32mintroduces Qwen3-Coder and its key features early on.\\n* **Compelling Visuals:** The demos are engaging and \u001b[0m\n",
"\u001b[32meffectively demonstrate the model\\'s capabilities. The visual results of the code generation are shown, making the\u001b[0m\n",
"\u001b[32mpower of the LLM clear to viewers.\\n* **Benchmark Comparisons:** The presenter provides benchmark comparisons to \u001b[0m\n",
"\u001b[32mother LLMs, establishing Qwen3-Coder\\'s competitive advantage.\\n* **Multiple Access Methods:** The video explains \u001b[0m\n",
"\u001b[32mmultiple ways to access and use Qwen3-Coder \u001b[0m\u001b[32m(\u001b[0m\u001b[32mchatbot, API, local installation\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.\\n* **Well-Structured Content:** The\u001b[0m\n",
"\u001b[32mvideo is logically organized, moving from an introduction to demos and concluding with a call to action.\\n* \u001b[0m\n",
"\u001b[32m**Effective Use of Keywords and Hashtags:** The metadata and description are well-optimized for search, using \u001b[0m\n",
"\u001b[32mrelevant keywords and hashtags.\\n* **Sponsor Integration:** The sponsor message is integrated naturally and \u001b[0m\n",
"\u001b[32mdoesn\\'t disrupt the flow of the video.\\n\\n\\n**Areas for Improvement:**\\n\\n* **Transcript Accuracy:** While the \u001b[0m\n",
"\u001b[32mtranscript is generally accurate, there are a few minor typos and inconsistencies \u001b[0m\u001b[32m(\u001b[0m\u001b[32me.g., \"Coin 3\" instead of \"Qwen \u001b[0m\n",
"\u001b[32m3\" in several places\u001b[0m\u001b[32m)\u001b[0m\u001b[32m. A thorough proofread would improve the quality.\\n* **Demo Complexity:** While the demos are\u001b[0m\n",
"\u001b[32mimpressive, some viewers might find them too advanced. Including simpler demos could broaden the appeal to a wider\u001b[0m\n",
"\u001b[32maudience.\\n* **Technical Depth:** The video could benefit from a slightly deeper dive into the technical aspects \u001b[0m\n",
"\u001b[32mof Qwen3-Coder\\'s architecture \u001b[0m\u001b[32m(\u001b[0m\u001b[32mMixture of Experts\u001b[0m\u001b[32m)\u001b[0m\u001b[32m for a more technically inclined audience. A brief explanation \u001b[0m\n",
"\u001b[32mof how the 256K context window works would also be beneficial.\\n* **Call to Action Clarity:** While the video has \u001b[0m\n",
"\u001b[32mmultiple calls to action \u001b[0m\u001b[32m(\u001b[0m\u001b[32msubscribe, donate, join Discord\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, consolidating them might make them more \u001b[0m\n",
"\u001b[32mimpactful.\\n\\n\\n**Overall:**\\n\\nThe YouTube video is well-produced and effectively communicates the value \u001b[0m\n",
"\u001b[32mproposition of Qwen3-Coder. The engaging demos and clear explanations make it a valuable resource for developers \u001b[0m\n",
"\u001b[32mand AI enthusiasts interested in open-source coding LLMs. Addressing the minor areas for improvement would further\u001b[0m\n",
"\u001b[32menhance its impact and reach.'\u001b[0m \u001b[33madditional_kwargs\u001b[0m=\u001b[1m{\u001b[0m\u001b[1m}\u001b[0m \u001b[33mresponse_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'prompt_feedback'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'block_reason'\u001b[0m: \u001b[1;36m0\u001b[0m, \n",
"\u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m, \u001b[32m'finish_reason'\u001b[0m: \u001b[32m'STOP'\u001b[0m, \u001b[32m'model_name'\u001b[0m: \u001b[32m'gemini-1.5-flash'\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m \n",
"\u001b[33mid\u001b[0m=\u001b[32m'run--327884b3-8a87-417e-ba81-0e0e748223e1-0'\u001b[0m \u001b[33musage_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'input_tokens'\u001b[0m: \u001b[1;36m3267\u001b[0m, \u001b[32m'output_tokens'\u001b[0m: \u001b[1;36m624\u001b[0m, \n",
"\u001b[32m'total_tokens'\u001b[0m: \u001b[1;36m3891\u001b[0m, \u001b[32m'input_token_details'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'cache_read'\u001b[0m: \u001b[1;36m0\u001b[0m\u001b[1m}\u001b[0m\u001b[1m}\u001b[0m\n",
"\n",
"\n",
"\n",
"Video: Qwen Code CLI + Qwen-\u001b[1;36m3\u001b[0m Coder 🔥 | Better Than Claude Code? - Full Tutorial by Astro K Joseph\n",
"URL: \u001b[4;94mhttps://www.youtube.com/watch?\u001b[0m\u001b[4;94mv\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94mkv57HqEb2j8\u001b[0m\n",
"Transcript Summary: \u001b[33mcontent\u001b[0m=\u001b[32m'Here\\'s a breakdown of the YouTube video transcript, organized for clarity and \u001b[0m\n",
"\u001b[32mSEO:\\n\\n**Title:** Qwen Code CLI + Qwen-3 Coder 🔥 | Better Than Claude Code? - Full Tutorial\\n\\n**Meta \u001b[0m\n",
"\u001b[32mDescription:** Learn how to set up and use the new Qwen Code CLI with the Qwen-3 Coder AI model. This full tutorial\u001b[0m\n",
"\u001b[32mcovers installation, API key configuration, and practical examples. Is it better than Claude Code? Find \u001b[0m\n",
"\u001b[32mout!\\n\\n**Tags:** Qwen Code CLI, Qwen-3 Coder, AI powered CLI, AI coding, code generation, tutorial, OpenRouter, \u001b[0m\n",
"\u001b[32mlarge language model, LLM, coding assistant, Gemini Code, Claude Code, software development, programming, AI \u001b[0m\n",
"\u001b[32mtools, NodeJS, npm\\n\\n\\n**Video Summary:**\\n\\nThis tutorial demonstrates how to set up and use the newly released \u001b[0m\n",
"\u001b[32mQwen Code CLI, an AI-powered command-line interface, with the Qwen-3 Coder AI model. The video compares it \u001b[0m\n",
"\u001b[32mimplicitly to other AI CLIs like Claude Code and Gemini Code. The presenter walks viewers through the installation\u001b[0m\n",
"\u001b[32mprocess \u001b[0m\u001b[32m(\u001b[0m\u001b[32mrequiring NodeJS\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, API key configuration using OpenRouter, and provides practical examples of generating \u001b[0m\n",
"\u001b[32mcode for a tic-tac-toe game and a landing page. The video also explores using Qwen Code to analyze existing \u001b[0m\n",
"\u001b[32mcodebases and understand their architecture. While initially showcasing smooth code generation, the video later \u001b[0m\n",
"\u001b[32mencounters some challenges with longer, more complex prompts, highlighting potential limitations.\\n\\n\\n**Key \u001b[0m\n",
"\u001b[32mSections & Timestamps \u001b[0m\u001b[32m(\u001b[0m\u001b[32mestimated, based on transcript length\u001b[0m\u001b[32m)\u001b[0m\u001b[32m:**\\n\\n* **0:00-2:00:** Introduction – Announcing Qwen\u001b[0m\n",
"\u001b[32mCode CLI and Qwen-3 Coder, highlighting the trend of AI-powered CLIs.\\n* **2:00-4:00:** Installation – Explaining \u001b[0m\n",
"\u001b[32mthe prerequisites \u001b[0m\u001b[32m(\u001b[0m\u001b[32mNodeJS\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and providing the `npm` installation command.\\n* **4:00-6:00:** API Key Setup – Showing\u001b[0m\n",
"\u001b[32mhow to obtain an API key from OpenRouter and configure environment variables.\\n* **6:00-8:00:** Basic Usage – \u001b[0m\n",
"\u001b[32mDemonstrating simple interactions with the CLI and generating a basic tic-tac-toe game.\\n* **8:00-11:00:** Landing\u001b[0m\n",
"\u001b[32mPage Example – Attempting to generate a more complex landing page, encountering some delays and issues. This \u001b[0m\n",
"\u001b[32msection highlights potential limitations and the need for iterative refinement of prompts.\\n* **11:00-12:00:** Code\u001b[0m\n",
"\u001b[32mAnalysis – Using Qwen Code to analyze an existing Next.js project and generate a summary of its architecture.\\n* \u001b[0m\n",
"\u001b[32m**12:00-12:45:** Conclusion – Recap of the process, additional features mentioned \u001b[0m\u001b[32m(\u001b[0m\u001b[32mlike MCP integration\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, and call\u001b[0m\n",
"\u001b[32mto action.\\n\\n\\n**Improvements for the Video:**\\n\\n* **Address the \"Better than Claude Code?\" question directly:** \u001b[0m\n",
"\u001b[32mThe video title raises this question, but the comparison is implicit. A more direct comparison, perhaps with \u001b[0m\n",
"\u001b[32mside-by-side examples, would strengthen the video.\\n* **Troubleshooting the Landing Page Issue:** The video \u001b[0m\n",
"\u001b[32mencounters difficulties generating the landing page. Addressing this directly, perhaps by showing successful \u001b[0m\n",
"\u001b[32mgeneration after prompt refinement or explaining potential reasons for the delay, would improve the tutorial\\'s \u001b[0m\n",
"\u001b[32mcompleteness.\\n* **Time Stamps:** Adding timestamps to the video description would greatly improve user \u001b[0m\n",
"\u001b[32mexperience.\\n* **Show more advanced features:** The video briefly mentions MCP integration. Demonstrating this or\u001b[0m\n",
"\u001b[32mother advanced features would add value.\\n* **Visuals:** The video could benefit from more visual aids, such as \u001b[0m\n",
"\u001b[32mscreen recordings showing the code being generated in real-time.\\n\\n\\nBy addressing these points, the video would \u001b[0m\n",
"\u001b[32mbecome a more comprehensive and compelling tutorial on using Qwen Code CLI.'\u001b[0m \u001b[33madditional_kwargs\u001b[0m=\u001b[1m{\u001b[0m\u001b[1m}\u001b[0m \n",
"\u001b[33mresponse_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'prompt_feedback'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'block_reason'\u001b[0m: \u001b[1;36m0\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m, \u001b[32m'finish_reason'\u001b[0m: \u001b[32m'STOP'\u001b[0m, \n",
"\u001b[32m'model_name'\u001b[0m: \u001b[32m'gemini-1.5-flash'\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m \u001b[33mid\u001b[0m=\u001b[32m'run--8949b5c8-f8a8-49d3-a091-c0f356eceefc-0'\u001b[0m \n",
"\u001b[33musage_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'input_tokens'\u001b[0m: \u001b[1;36m3493\u001b[0m, \u001b[32m'output_tokens'\u001b[0m: \u001b[1;36m784\u001b[0m, \u001b[32m'total_tokens'\u001b[0m: \u001b[1;36m4277\u001b[0m, \u001b[32m'input_token_details'\u001b[0m: \n",
"\u001b[1m{\u001b[0m\u001b[32m'cache_read'\u001b[0m: \u001b[1;36m0\u001b[0m\u001b[1m}\u001b[0m\u001b[1m}\u001b[0m\n",
"\n",
"\n",
"\n",
"Video: QWEN \u001b[1;36m3\u001b[0m CODER is Unleashed\u001b[33m...\u001b[0m better than KIMI K2 by Wes Roth\n",
"URL: \u001b[4;94mhttps://www.youtube.com/watch?\u001b[0m\u001b[4;94mv\u001b[0m\u001b[4;94m=\u001b[0m\u001b[4;94mfeAc83Qlx4Q\u001b[0m\n",
"Transcript Summary: \u001b[33mcontent\u001b[0m=\u001b[32m'This is a detailed summary of the YouTube video about Qwen-3-Coder, an open-source AI \u001b[0m\n",
"\u001b[32mcoding model.\\n\\n**Key Points:**\\n\\n* **Qwen-3-Coder\\'s Superiority:** The video highlights Qwen-3-Coder\\'s \u001b[0m\n",
"\u001b[32mperformance surpassing other models like Kim K2, GPT-4.1, and even showing competitiveness with Claude Sonnet in \u001b[0m\n",
"\u001b[32mvarious benchmarks. Its strength lies in agentic coding tasks, involving multi-turn interactions and tool \u001b[0m\n",
"\u001b[32muse.\\n\\n* **Model Size and Architecture:** Qwen-3-Coder is a 480B parameter model, but utilizes a Mixture of \u001b[0m\n",
"\u001b[32mExperts approach, keeping only 35B parameters active during inference. It\\'s described as an \"instruct\" model, \u001b[0m\n",
"\u001b[32mmeaning it\\'s designed for helpful and friendly interactions.\\n\\n* **Reinforcement Learning \u001b[0m\u001b[32m(\u001b[0m\u001b[32mRL\u001b[0m\u001b[32m)\u001b[0m\u001b[32m Training:** A \u001b[0m\n",
"\u001b[32msignificant portion of the video focuses on the model\\'s RL training. Unlike other models focusing on \u001b[0m\n",
"\u001b[32mcompetition-style coding problems, Qwen-3-Coder was trained on real-world coding tasks, leading to improved \u001b[0m\n",
"\u001b[32mgeneralization across various tasks \u001b[0m\u001b[32m(\u001b[0m\u001b[32mcode generation, math problems, etc.\u001b[0m\u001b[32m)\u001b[0m\u001b[32m. The training involved a scalable \u001b[0m\n",
"\u001b[32msystem running 20,000 parallel environments.\\n\\n* **Agentic Capabilities and Tools:** The model\\'s ability to \u001b[0m\n",
"\u001b[32mperform agentic coding is emphasized. It seamlessly integrates with tools like Qwen Code \u001b[0m\u001b[32m(\u001b[0m\u001b[32ma CLI tool forked from \u001b[0m\n",
"\u001b[32mGemini Code\u001b[0m\u001b[32m)\u001b[0m\u001b[32m and Claude Code, enabling complex interactions with the environment.\\n\\n* **Real-World \u001b[0m\n",
"\u001b[32mDemonstrations:** The video showcases several impressive demonstrations of Qwen-3-Coder\\'s capabilities, including \u001b[0m\n",
"\u001b[32mbuilding simulations, game creation \u001b[0m\u001b[32m(\u001b[0m\u001b[32ma drone game, Minecraft clone\u001b[0m\u001b[32m)\u001b[0m\u001b[32m, and interactive visualizations.\\n\\n* \u001b[0m\n",
"\u001b[32m**Open-Source Availability:** The model and associated tools are open-source, available on Hugging Face and \u001b[0m\n",
"\u001b[32mGitHub, fostering community contributions and development.\\n\\n* **Future Implications:** The presenter expresses \u001b[0m\n",
"\u001b[32msurprise at the rapid advancement of open-source AI, suggesting it\\'s closing the gap with leading proprietary \u001b[0m\n",
"\u001b[32mmodels much faster than anticipated.\\n\\n\\n**Overall:**\\n\\nThe video presents a very positive and enthusiastic \u001b[0m\n",
"\u001b[32mreview of Qwen-3-Coder, emphasizing its impressive performance, innovative training methodology, and open-source \u001b[0m\n",
"\u001b[32mnature. It positions the model as a significant advancement in the field of large language models and agentic \u001b[0m\n",
"\u001b[32mcoding. The presenter\\'s hands-on demonstrations further solidify this positive assessment.'\u001b[0m \u001b[33madditional_kwargs\u001b[0m=\u001b[1m{\u001b[0m\u001b[1m}\u001b[0m \n",
"\u001b[33mresponse_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'prompt_feedback'\u001b[0m: \u001b[1m{\u001b[0m\u001b[32m'block_reason'\u001b[0m: \u001b[1;36m0\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m, \u001b[32m'finish_reason'\u001b[0m: \u001b[32m'STOP'\u001b[0m, \n",
"\u001b[32m'model_name'\u001b[0m: \u001b[32m'gemini-1.5-flash'\u001b[0m, \u001b[32m'safety_ratings'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m\u001b[1m}\u001b[0m \u001b[33mid\u001b[0m=\u001b[32m'run--59f2073a-7d87-4ff0-9a2e-aa2dea885451-0'\u001b[0m \n",
"\u001b[33musage_metadata\u001b[0m=\u001b[1m{\u001b[0m\u001b[32m'input_tokens'\u001b[0m: \u001b[1;36m2078\u001b[0m, \u001b[32m'output_tokens'\u001b[0m: \u001b[1;36m495\u001b[0m, \u001b[32m'total_tokens'\u001b[0m: \u001b[1;36m2573\u001b[0m, \u001b[32m'input_token_details'\u001b[0m: \n",
"\u001b[1m{\u001b[0m\u001b[32m'cache_read'\u001b[0m: \u001b[1;36m0\u001b[0m\u001b[1m}\u001b[0m\u001b[1m}\u001b[0m\n",
"\n",
"\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"summary = youtube_transcript_response(\"Qwen 3 coder reviews\", \n",
" 'summarize in bullets and themes', llmgoogle)\n",
"print(summary)"
]
},
{
"cell_type": "markdown",
"id": "cd9d555f",
"metadata": {},
"source": [
"# 11. Git Repos Exploration"
]
},
{
"cell_type": "markdown",
"id": "2aaacac6",
"metadata": {},
"source": [
"You can now explore structure and get the content of files/folders in github repositories, you can even plug in local code folders"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "c7580fe6",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Directory structure:\n",
"└── spthole-coexistai/\n",
" ├── README.md\n",
" ├── __init__.py\n",
" ├── app.py\n",
" ├── coexist_tutorial.ipynb\n",
" ├── LICENSE\n",
" ├── model_config.py\n",
" ├── quick_setup.sh\n",
" ├── README_MCP.md\n",
" ├── requirements.txt\n",
" ├── system_prompt.py\n",
" ├── output/\n",
" │ └── map_with_route_and_pois.html\n",
" ├── searxng/\n",
" │ ├── settings.yml\n",
" │ ├── settings.yml.new\n",
" │ ├── uwsgi.ini\n",
" │ └── uwsgi.ini.new\n",
" └── utils/\n",
" ├── __init__.py\n",
" ├── answer_generation.py\n",
" ├── config.py\n",
" ├── git_utils.py\n",
" ├── map.py\n",
" ├── process_content.py\n",
" ├── reddit_utils.py\n",
" ├── utils.py\n",
" └── websearch_utils.py\n",
"\n",
"\n"
],
"text/plain": [
"Directory structure:\n",
"└── spthole-coexistai/\n",
" ├── README.md\n",
" ├── __init__.py\n",
" ├── app.py\n",
" ├── coexist_tutorial.ipynb\n",
" ├── LICENSE\n",
" ├── model_config.py\n",
" ├── quick_setup.sh\n",
" ├── README_MCP.md\n",
" ├── requirements.txt\n",
" ├── system_prompt.py\n",
" ├── output/\n",
" │ └── map_with_route_and_pois.html\n",
" ├── searxng/\n",
" │ ├── settings.yml\n",
" │ ├── settings.yml.new\n",
" │ ├── uwsgi.ini\n",
" │ └── uwsgi.ini.new\n",
" └── utils/\n",
" ├── __init__.py\n",
" ├── answer_generation.py\n",
" ├── config.py\n",
" ├── git_utils.py\n",
" ├── map.py\n",
" ├── process_content.py\n",
" ├── reddit_utils.py\n",
" ├── utils.py\n",
" └── websearch_utils.py\n",
"\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from utils.git_utils import *\n",
"\n",
"tree = await git_tree_search(\"https://github.com/SPThole/CoexistAI/\")\n",
"print(tree)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "cdfb1d1c",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Directory structure:\n",
"└── CoexistAI/\n",
" ├── README.md\n",
" ├── __init__.py\n",
" ├── app.py\n",
" ├── coexist_tutorial.ipynb\n",
" ├── LICENSE\n",
" ├── lmstudio_chats.ipynb\n",
" ├── model_config.py\n",
" ├── quick_setup.sh\n",
" ├── README_MCP.md\n",
" ├── requirements.txt\n",
" ├── search_context.txt\n",
" ├── system_prompt.py\n",
" ├── output/\n",
" │ └── map_with_route_and_pois.html\n",
" ├── searxng/\n",
" │ ├── settings.yml\n",
" │ ├── settings.yml.new\n",
" │ ├── uwsgi.ini\n",
" │ └── uwsgi.ini.new\n",
" └── utils/\n",
" ├── __init__.py\n",
" ├── answer_generation.py\n",
" ├── config.py\n",
" ├── git_utils.py\n",
" ├── map.py\n",
" ├── process_content.py\n",
" ├── reddit_utils.py\n",
" ├── utils.py\n",
" └── websearch_utils.py\n",
"\n",
"\n"
],
"text/plain": [
"Directory structure:\n",
"└── CoexistAI/\n",
" ├── README.md\n",
" ├── __init__.py\n",
" ├── app.py\n",
" ├── coexist_tutorial.ipynb\n",
" ├── LICENSE\n",
" ├── lmstudio_chats.ipynb\n",
" ├── model_config.py\n",
" ├── quick_setup.sh\n",
" ├── README_MCP.md\n",
" ├── requirements.txt\n",
" ├── search_context.txt\n",
" ├── system_prompt.py\n",
" ├── output/\n",
" │ └── map_with_route_and_pois.html\n",
" ├── searxng/\n",
" │ ├── settings.yml\n",
" │ ├── settings.yml.new\n",
" │ ├── uwsgi.ini\n",
" │ └── uwsgi.ini.new\n",
" └── utils/\n",
" ├── __init__.py\n",
" ├── answer_generation.py\n",
" ├── config.py\n",
" ├── git_utils.py\n",
" ├── map.py\n",
" ├── process_content.py\n",
" ├── reddit_utils.py\n",
" ├── utils.py\n",
" └── websearch_utils.py\n",
"\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#local repo\n",
"from utils.git_utils import *\n",
"\n",
"tree = await git_tree_search(\".\")\n",
"print(tree)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "ccbc2c9b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"https://github.com/SPThole/CoexistAI/blob/main//README_MCP.md\n"
]
},
{
"data": {
"text/html": [
"================================================\n",
"FILE: README_MCP.md\n",
"================================================\n",
"# CoexistAI v0.0.2 \n",
"\n",
"<p align=\"center\">\n",
" <img src=\"artifacts/v002mcplogo.jpeg\" alt=\"CoexistAI MCP Logo\" width=\"200\"/>\n",
"</p>\n",
"\n",
"## 🚀 What's New in v2\n",
"\n",
"- **Direct location search:** You can now search for any place, not just find routes!\n",
"- **Advanced Reddit search:** Use your own phrases to search across reddit; results ranked better with BM25 for \n",
"sharper discovery.\n",
"- **YouTube power-up:** Search and summarize YouTube using your own search phrases or video URLs and even add a \n",
"prompt for custom responses.\n",
"- **Explore to your folders/files**: Explore local folders and files with extended support to diverse files \n",
"including (vision integrated)'.png', '.jpg', '.jpeg', '.gif', '.bmp', '.webp', '.tiff', '.svg', etc, more to come..\n",
"- **Sharper web search:** More focused and actionable results than ever before.\n",
"- **MCP support everywhere:** Now fully connect coexistai to LM Studio and other MCP hosts—seamless integration! \n",
"[See Guide](README_MCP.md)\n",
"- **GitHub & local repo explorer:** Explore ask questions about codebases - works with both GitHub and local repos!\n",
"\n",
"---\n",
"\n",
"## 🛠 Quick Start\n",
"\n",
"### Method (Less flexible but faster):\n",
"\n",
"1. **Clone the repository:**\n",
" ```sh\n",
" git clone https://github.com/SPThole/CoexistAI.git coexistai\n",
" cd coexistai\n",
" ```\n",
"\n",
"\n",
"2. **Configure your model and embedding settings:**\n",
" \n",
" - Edit `model_config.py` to set your preferred LLM and embedding model.\n",
" - Add LLM and Embedder API Key (for google mode both would be same)\n",
" - Example (for full local mode):\n",
" ```py\n",
" model_config = {\n",
" # Name of the LLM model to use. For local models, use the model name served by your local server.\n",
" \"llm_model_name\": \"google/gemma-3-12b\",\n",
"\n",
" # LLM provider type: choose from 'google', 'local', 'groq', or 'openai' or 'others' \n",
" # in case of 'others' (base url needs to be updated in openai_compatible given below accordingly).\n",
" # Make sure to update the api_key variable above to match the provider.\n",
" \"llm_type\": \"local\",\n",
"\n",
" # List of tools or plugins to use with the LLM, if any. Set to None if not used.\n",
" \"llm_tools\": None,\n",
"\n",
" # Additional keyword arguments for LLM initialization.\n",
" \"llm_kwargs\": {\n",
" \"temperature\": 0.1, # Sampling temperature for generation.\n",
" \"max_tokens\": None, # Maximum number of tokens to generate (None for default).\n",
" \"timeout\": None, # Timeout for API requests (None for default).\n",
" \"max_retries\": 2, # Maximum number of retries for failed requests.\n",
" \"api_key\": llm_api_key, # API key for authentication.\n",
" },\n",
"\n",
" # Name of the embedding model to use.\n",
" # For Google, use their embedding model names. For local/HuggingFace, use the model path or name.\n",
" \"embedding_model_name\": \"nomic-ai/nomic-embed-text-v1\",\n",
"\n",
" \"embed_kwargs\":{}, #additional kwargs for embedding model initialization\n",
"\n",
" # Embedding backend: 'google' for Google, 'infinity_emb' for local/HuggingFace models.\n",
" \"embed_mode\": \"infinity_emb\",\n",
"\n",
" # Name of the cross-encoder model for reranking, typically a HuggingFace model.\n",
" \"cross_encoder_name\": \"BAAI/bge-reranker-base\"\n",
" }\n",
" ```\n",
" - See the file for all available options and defaults.\n",
"\n",
"3. **Run the setup script:**\n",
" - For macOS or Linux with zsh:\n",
" ```sh\n",
" zsh quick_setup.sh\n",
" ```\n",
" - For Linux with bash:\n",
" ```sh\n",
" bash quick_setup.sh\n",
" ```\n",
"\n",
" > The script will:\n",
" > - Pull the SearxNG Docker image\n",
" > - Create and activate a Python virtual environment\n",
" > - **USER ACTION NEEDED** Set your `GOOGLE_API_KEY` (edit the script to use your real key). [Obtain your API \n",
"key (Currently Gemini, OpenAI and ollama is supported)](https://ai.google.dev/gemini-api/docs/api-key) from your \n",
"preferred LLM provider. (Only needed when google mode is set, else set in model_config.py)\n",
" > - Start the SearxNG Docker container\n",
" > - Install Python dependencies\n",
" > - Start the FastAPI server\n",
"\n",
"4. **That’s it!** \n",
" The FastAPI and MCP server will start automatically and you’re ready to go.\n",
"\n",
"**Note:** \n",
"- Make sure Docker, Python 3, and pip are installed on your system. \n",
"- Edit quick_setup.sh to set your real `GOOGLE_API_KEY` before running (needed if using google models) \n",
"- Windows users can use [WSL](https://docs.microsoft.com/en-us/windows/wsl/) or Git Bash to run the script, or \n",
"follow manual setup steps.\n",
"\n",
"## 🔍 What Can You Do? (API Highlights & Examples)\n",
"\n",
"**Remove comments after // before pasting**\n",
"Swagger UI: http://127.0.0.1:8000/docs if you haven't changed the host and port\n",
"\n",
"### 1. Web Search\n",
"**Search the web, summarize, and get actionable answers—automatically.**\n",
"\n",
"**Endpoint:** \n",
"POST `/web-search`\n",
"\n",
"**Request Example:**\n",
"```json\n",
"{\n",
" \"query\": \"Top news of today worldwide\", // Query you want to ask; if you provide a URL and ask to summarise, it \n",
"will summarize the full page.\n",
" \"rerank\": true, // Set to true for better result ranking.\n",
" \"num_results\": 2, // Number of top results per subquery to explore (higher values = more tokens, slower/more \n",
"costly).\n",
" \"local_mode\": false, // Set to true to explore local documents (currently, only PDF supported).\n",
" \"split\": true, // Set to false if you want full pages as input to LLMs; false may cause slower/more costly \n",
"response.\n",
" \"document_paths\": [] // If local_mode is true, add a list of lists of document paths, e.g., \n",
"[[\"documents/1706.03762v7.pdf\"]]\n",
"}\n",
"\n",
"```\n",
"\n",
"or QA/sumamrise local documents \n",
"\n",
"```json\n",
"{\n",
" \"query\": \"Summarise this research paper\",\n",
" \"rerank\": true,\n",
" \"num_results\": 3,\n",
" \"local_mode\": true,\n",
" \"split\": true,\n",
" \"document_paths\": [[\"documents/1706.03762v7.pdf\"]] // Must be a list of lists.\n",
"}\n",
"```\n",
"\n",
"---\n",
"\n",
"### 2. Summarize Any Web Page\n",
"**Summarize any article or research paper by URL.**\n",
"\n",
"**Endpoint:** \n",
"POST `/web-summarize`\n",
"\n",
"**Request Example:**\n",
"```json\n",
"\n",
"{\n",
" \"query\": \"Write a short blog on the model\", // Instruction or question for the fetched page content.\n",
" \"url\": \"https://huggingface.co/unsloth/Qwen3-8B-GGUF\", // Webpage to fetch content from.\n",
" \"local_mode\": false // Set to true if summarizing a local document.\n",
"}\n",
"\n",
"```\n",
"\n",
"---\n",
"\n",
"### 3. YouTube Search \n",
"**Search YouTube (supports prompts and batch).**\n",
"\n",
"**Endpoint:** \n",
"POST `/youtube-search`\n",
"\n",
"**Request Example:**\n",
"```json\n",
"\n",
"{\n",
" \"query\": \"switzerland itinerary\", // Query to search on YouTube; if a URL is provided, it fetches content from \n",
"that URL. url should be in format: https://www.youtube.com/watch?v=videoID\n",
" \"prompt\": \"I want to plan my Switzerland trip\", // Instruction or question for using the fetched content.\n",
" \"n\": 2 // Number of top search results to summarize (only works if query is not a URL).\n",
"}\n",
"```\n",
"\n",
"---\n",
"\n",
"### 4. Reddit Deep Dive\n",
"**Custom Reddit search, sort, filter, and get top comments.**\n",
"\n",
"**Endpoint:** \n",
"POST `/reddit-search`\n",
"\n",
"**Request Example:**\n",
"```json\n",
"\n",
"{\n",
" \"subreddit\": \"\", // Subreddit to fetch content from (use if url_type is not 'search').\n",
" \"url_type\": \"search\", // 'search' for phrase search; \"url\" for url, otherwise, use 'hot', 'top', 'best', etc.\n",
" \"n\": 3, // Number of posts to fetch.\n",
" \"k\": 1, // Number of top comments per post.\n",
" \"custom_url\": \"\", // Use if you already have a specific Reddit URL.\n",
" \"time_filter\": \"all\", // Time range: 'all', 'today', 'week', 'month', 'year'.\n",
" \"search_query\": \"gemma 3n reviews\", // Search phrase (useful if url_type is 'search').\n",
" \"sort_type\": \"relevance\" // 'top', 'hot', 'new', 'relevance' — controls how results are sorted.\n",
"}\n",
"\n",
"```\n",
"\n",
"---\n",
"\n",
"### 5. Map & Location/Route Search\n",
"**Find places, routes, and nearby points of interest.**\n",
"\n",
"**Endpoint:** \n",
"POST `/map-search`\n",
"\n",
"**Request Example:**\n",
"```json\n",
"\n",
"{\n",
" \"start_location\": \"MG Road, Bangalore\", // Starting point.\n",
" \"end_location\": \"Lalbagh, Bangalore\", // Destination.\n",
" \"pois_radius\": 500, // Search radius in meters for amenities.\n",
" \"amenities\": \"restaurant|cafe|bar|hotel\", // Amenities to search near start or end location.\n",
" \"limit\": 3, // Maximum number of results if address not found exactly.\n",
" \"task\": \"route_and_pois\" // Use 'location_only' for address/coordinates only, or 'route_and_pois' for routes and \n",
"POIs.\n",
"}\n",
"```\n",
"\n",
"OR search for any single location (open street map has api rate limit)\n",
"\n",
"```json\n",
"\n",
"{\n",
" \"start_location\": \"MG Road, Bangalore\",\n",
" \"end_location\": \"Lalbagh, Bangalore\",\n",
" \"pois_radius\": 500,\n",
" \"amenities\": \"restaurant|cafe|bar|hotel\",\n",
" \"limit\": 3,\n",
" \"task\": \"location_only\"\n",
"}\n",
"\n",
"```\n",
"\n",
"---\n",
"\n",
"### 6. GitHub & Local Repo Directory Tree\n",
"**Get the directory structure of any GitHub or local repo.**\n",
"\n",
"**Endpoint:** \n",
"POST `/git-tree-search`\n",
"\n",
"**Request Example:**\n",
"```json\n",
"\n",
"{\n",
" \"repobaseurl\": \"https://github.com/SPThole/CoexistAI/\" // Base URL of the repository to explore.\n",
"}\n",
"```\n",
"or for local repo:\n",
"```json\n",
"\n",
"{\n",
"\"repobaseurl\": \"/home/user/projects/myrepo\"\n",
"}\n",
"\n",
"```\n",
"\n",
"---\n",
"\n",
"## 🧑💻 Integrate coexistai as an MCP Server (LM Studio, Cursor, etc.)\n",
"\n",
"Starting LM Studio 0.3.17, LM Studio acts as an Model Context Protocol (MCP) Host. This means you can connect MCP \n",
"servers to the app and make them available to your models. \n",
"\n",
"\n",
"You can now run coexistai as an MCP server—**plug it into LM Studio** or any other MCP-compatible tool!\n",
"\n",
"### How to Integrate with LM Studio\n",
"\n",
"1. Download lm studio> 0.3.17 (https://lmstudio.ai/docs/app)\n",
"\n",
"2. Find the [MCP guide](https://lmstudio.ai/docs/app/plugins/mcp)\n",
"\n",
"<p align=\"center\">\n",
" <img src=\"artifacts/lmstudio.png\" alt=\"CoexistAI MCP Logo\" width=\"600\"/>\n",
"</p>\n",
"\n",
"1. **Edit your `mcp.json` in LM Studio:**\n",
" - Go to the Program tab → `Install > Edit mcp.json`\n",
" - Add coexistai as a server. Example:\n",
" ```json\n",
" {\n",
" \"mcpServers\": {\n",
" \"coexistai\": {\n",
" \"url\": \"http://127.0.0.1:8000/mcp\"\n",
" }\n",
" }\n",
" }\n",
" ```\n",
" - Replace with your actual server address and token (if needed).\n",
"\n",
"2. **Or use an \"Add to LM Studio\" button** (if provided on coexistai website).\n",
"\n",
"**Security note:** Only use MCP servers you trust—servers can access files/network.\n",
"\n",
"3. Use (system_prompt.py) as context (system prompt) in lmstudio\n",
"---\n",
"\n",
"## 🏆 Best Local Model\n",
"\n",
"For fastest, highest-quality local LLM results, I have personally liked following: \n",
"**unsloth/Qwen3-8B-GGUF**\n",
"\n",
"---\n",
"\n",
"\n",
"\n"
],
"text/plain": [
"================================================\n",
"FILE: README_MCP.md\n",
"================================================\n",
"# CoexistAI v0.\u001b[1;36m0.2\u001b[0m \n",
"\n",
"\u001b[1m<\u001b[0m\u001b[1;95mp\u001b[0m\u001b[39m \u001b[0m\u001b[33malign\u001b[0m\u001b[39m=\u001b[0m\u001b[32m\"center\"\u001b[0m\u001b[39m>\u001b[0m\n",
"\u001b[39m \u001b[0m\n",
"\u001b[39m \u001b[0m\n",
"\u001b[39m<\u001b[0m\u001b[35m/\u001b[0m\u001b[95mp\u001b[0m\u001b[39m>\u001b[0m\n",
"\n",
"\u001b[1;36m1\u001b[0m\u001b[39m. **Edit your `mcp.json` in LM Studio:**\u001b[0m\n",
"\u001b[39m - Go to the Program tab → `Install \u001b[0m\u001b[1m>\u001b[0m Edit mcp.json`\n",
" - Add coexistai as a server. Example:\n",
" ```json\n",
" \u001b[1m{\u001b[0m\n",
" \u001b[32m\"mcpServers\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[32m\"coexistai\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[32m\"url\"\u001b[0m: \u001b[32m\"http://127.0.0.1:8000/mcp\"\u001b[0m\n",
" \u001b[1m}\u001b[0m\n",
" \u001b[1m}\u001b[0m\n",
" \u001b[1m}\u001b[0m\n",
" ```\n",
" - Replace with your actual server address and token \u001b[1m(\u001b[0mif needed\u001b[1m)\u001b[0m.\n",
"\n",
"\u001b[1;36m2\u001b[0m. **Or use an \u001b[32m\"Add to LM Studio\"\u001b[0m button** \u001b[1m(\u001b[0mif provided on coexistai website\u001b[1m)\u001b[0m.\n",
"\n",
"**Security note:** Only use MCP servers you trust—servers can access files/network.\n",
"\n",
"\u001b[1;36m3\u001b[0m. Use \u001b[1m(\u001b[0msystem_prompt.py\u001b[1m)\u001b[0m as context \u001b[1m(\u001b[0msystem prompt\u001b[1m)\u001b[0m in lmstudio\n",
"---\n",
"\n",
"## 🏆 Best Local Model\n",
"\n",
"For fastest, highest-quality local LLM results, I have personally liked following: \n",
"**unsloth/Qwen3-8B-GGUF**\n",
"\n",
"---\n",
"\n",
"\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"content = await git_specific_content(\"https://github.com/SPThole/CoexistAI/\",\n",
" part = \"README_MCP.md\",\n",
" type=\"file\")\n",
"print(content)"
]
},
{
"cell_type": "markdown",
"id": "18c36348",
"metadata": {},
"source": [
"## 12. Generating Maps\n",
"\n",
"Generate maps with routes and points of interest using the `generate_map` function. You can visualize directions and locations directly in your notebook."
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "303b0b13",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:13:04,557] INFO utils.map: Found 3 probable locations for 'M G Road, Bangalore'.\n",
"[2025-07-27 12:13:04,558] INFO utils.map: Auto-selected location: Mahatma Gandhi Road, Tasker Town, Shivajinagar, Bengaluru, Bengaluru Central City Corporation, Bengaluru, Bangalore North, Bengaluru Urban, Karnataka, 560001, India\n",
"[2025-07-27 12:13:05,549] INFO utils.map: Found 3 probable locations for 'Indiranagar, Bangalore'.\n",
"[2025-07-27 12:13:05,551] INFO utils.map: Auto-selected location: Indiranagar, Bengaluru Central City Corporation, Bengaluru, Bangalore East, Bengaluru Urban, Karnataka, 560038, India\n",
"[2025-07-27 12:13:05,895] INFO utils.map: Route found between start and end coordinates.\n",
"[2025-07-27 12:13:06,491] INFO utils.map: Found 82 POIs near (12.9747828, 77.6096698).\n",
"[2025-07-27 12:13:06,874] INFO utils.map: Found 79 POIs near (12.9732913, 77.6404672).\n",
"[2025-07-27 12:13:07,000] INFO utils.map: Map generated and saved as 'map_with_route_and_pois.html'.\n",
"[2025-07-27 12:13:07,000] INFO utils.map: Generated route directions.\n"
]
}
],
"source": [
"# Example: Generate a map with a route and POIs\n",
"from utils.map import *\n",
"s = generate_map(\"M G Road, Bangalore\", \"Indiranagar, Bangalore\")\n",
"from IPython.display import display, HTML\n",
"with open(\"output/map_with_route_and_pois.html\") as f:\n",
" html_content = f.read()\n",
"# display(HTML(html_content))"
]
},
{
"cell_type": "markdown",
"id": "08403d58",
"metadata": {},
"source": [
"You can even get the location specific information"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "6da734e2",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:13:10,669] INFO utils.map: Found 3 probable locations for 'M G Road, Bangalore'.\n",
"[2025-07-27 12:13:10,671] INFO utils.map: Auto-selected location: Mahatma Gandhi Road, Tasker Town, Shivajinagar, Bengaluru, Bengaluru Central City Corporation, Bengaluru, Bangalore North, Bengaluru Urban, Karnataka, 560001, India\n"
]
},
{
"data": {
"text/html": [
"
Start location: Mahatma Gandhi Road, Tasker Town, Shivajinagar, Bengaluru, Bengaluru Central City Corporation, \n",
"Bengaluru, Bangalore North, Bengaluru Urban, Karnataka, 560001, India (Lat: 12.9747828, Lon: 77.6096698)\n",
"\n",
"\n"
],
"text/plain": [
"Start location: Mahatma Gandhi Road, Tasker Town, Shivajinagar, Bengaluru, Bengaluru Central City Corporation, \n",
"Bengaluru, Bangalore North, Bengaluru Urban, Karnataka, \u001b[1;36m560001\u001b[0m, India \u001b[1m(\u001b[0mLat: \u001b[1;36m12.9747828\u001b[0m, Lon: \u001b[1;36m77.6096698\u001b[0m\u001b[1m)\u001b[0m\n",
"\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Example: Generate a map with a route and POIs\n",
"s = generate_map(\"M G Road, Bangalore\", None, task=\"location_only\")\n",
"print(s)\n",
"# display(HTML(html_content))"
]
},
{
"cell_type": "markdown",
"id": "c9f1f4bb",
"metadata": {},
"source": [
"## 11. Advanced Query Handling\n",
"\n",
"Handle advanced queries, such as generating detailed reports or toy examples, using `query_web_response`. This enables complex, multi-step reasoning and content generation."
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "ea974c82",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:09:49,765] INFO utils.answer_generation: Summary:False,subquery:[''], iscoverd:False\n",
"[2025-07-27 12:09:49,765] INFO utils.answer_generation: Summary:False,subquery:[''], iscoverd:False\n",
"[2025-07-27 12:09:49,767] INFO utils.websearch_utils: Search response generated for query 'Give me end to end working for text diffusion model.' using pure query.\n",
"[2025-07-27 12:09:49,767] INFO utils.websearch_utils: Search response generated for query 'Give me end to end working for text diffusion model.' using pure query.\n",
"[2025-07-27 12:09:49,768] INFO utils.websearch_utils: Search phrases for query 'Give me end to end working for text diffusion model.': ['Give me end to end working for text diffusion model.']\n",
"[2025-07-27 12:09:49,768] INFO utils.websearch_utils: Search phrases for query 'Give me end to end working for text diffusion model.': ['Give me end to end working for text diffusion model.']\n",
"[2025-07-27 12:09:50,420] INFO utils.websearch_utils: Search results for query 'Give me end to end working for text diffusion model.': [{'snippet': 'by Y Gao · 2023 · Cited by 32 — We propose Easy End-to-End Diffusion-based Text to Speech, a simple and efficient end-to-end text-to-speech model based on diffusion.', 'title': 'E3 TTS: Easy End-to-End Diffusion-based Text to Speech', 'link': 'https://arxiv.org/abs/2311.00945', 'engines': ['google'], 'category': 'general'}]\n",
"[2025-07-27 12:09:50,420] INFO utils.websearch_utils: Search results for query 'Give me end to end working for text diffusion model.': [{'snippet': 'by Y Gao · 2023 · Cited by 32 — We propose Easy End-to-End Diffusion-based Text to Speech, a simple and efficient end-to-end text-to-speech model based on diffusion.', 'title': 'E3 TTS: Easy End-to-End Diffusion-based Text to Speech', 'link': 'https://arxiv.org/abs/2311.00945', 'engines': ['google'], 'category': 'general'}]\n",
"[2025-07-27 12:09:50,422] INFO utils.websearch_utils: Search results fetched for subquery: Give me end to end working for text diffusion model.\n",
"[2025-07-27 12:09:50,422] INFO utils.websearch_utils: Search results fetched for subquery: Give me end to end working for text diffusion model.\n",
"[2025-07-27 12:09:50,422] INFO utils.websearch_utils: Created Document for source: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:50,422] INFO utils.websearch_utils: Created Document for source: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:50,423] INFO utils.websearch_utils: Search results fetched for query 'Give me end to end working for text diffusion model.'.\n",
"[2025-07-27 12:09:50,423] INFO utils.websearch_utils: Search results fetched for query 'Give me end to end working for text diffusion model.'.\n",
"[2025-07-27 12:09:50,424] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n",
"[2025-07-27 12:09:50,424] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n",
"/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n",
" warnings.warn('resource_tracker: process died unexpectedly, '\n",
"[2025-07-27 12:09:50,457] INFO utils.websearch_utils: Fetching URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:50,457] INFO utils.websearch_utils: Fetching URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:50,798] INFO utils.websearch_utils: Fetched content from https://arxiv.org/abs/2311.00945 with type text/html; charset=utf-8\n",
"[2025-07-27 12:09:50,798] INFO utils.websearch_utils: Fetched content from https://arxiv.org/abs/2311.00945 with type text/html; charset=utf-8\n",
"[2025-07-27 12:09:52,618] INFO utils.websearch_utils: Processed markdown for: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:52,618] INFO utils.websearch_utils: Processed markdown for: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:52,619] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:52,619] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:52,867] INFO utils.websearch_utils: Total URLs processed: 1\n",
"[2025-07-27 12:09:52,867] INFO utils.websearch_utils: Total URLs processed: 1\n",
"[2025-07-27 12:09:52,870] INFO utils.websearch_utils: Processed 1 docs for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:52,870] INFO utils.websearch_utils: Processed 1 docs for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:52,871] INFO utils.websearch_utils: URLs and markdown links removed from text.\n",
"[2025-07-27 12:09:52,871] INFO utils.websearch_utils: URLs and markdown links removed from text.\n",
"[2025-07-27 12:09:52,871] INFO utils.websearch_utils: Encoding start for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:52,871] INFO utils.websearch_utils: Encoding start for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:52,873] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:09:52,873] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:09:52,873] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:09:53,311] INFO utils.websearch_utils: Encoding end for URL: https://arxiv.org/abs/2311.00945, Time taken: 0.44 seconds\n",
"[2025-07-27 12:09:53,311] INFO utils.websearch_utils: Encoding end for URL: https://arxiv.org/abs/2311.00945, Time taken: 0.44 seconds\n",
"[2025-07-27 12:09:53,313] INFO utils.websearch_utils: Reranking start for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:53,313] INFO utils.websearch_utils: Reranking start for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:53,314] INFO utils.websearch_utils: Reranking end for URL: https://arxiv.org/abs/2311.00945, Time taken: 0.00 seconds\n",
"[2025-07-27 12:09:53,314] INFO utils.websearch_utils: Reranking end for URL: https://arxiv.org/abs/2311.00945, Time taken: 0.00 seconds\n",
"Batches: 100%|██████████| 1/1 [00:00<00:00, 1.74it/s]\n",
"[2025-07-27 12:09:55,117] INFO utils.websearch_utils: Retrieved 1 docs for https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:55,117] INFO utils.websearch_utils: Retrieved 1 docs for https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:55,118] INFO utils.websearch_utils: Built context for https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:55,118] INFO utils.websearch_utils: Built context for https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:55,118] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:55,118] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://arxiv.org/abs/2311.00945\n",
"[2025-07-27 12:09:55,119] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 1, total docs: 1\n",
"[2025-07-27 12:09:55,119] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 1, total docs: 1\n",
"[2025-07-27 12:09:55,120] INFO utils.websearch_utils: Context generated to answer query 'Give me end to end working for text diffusion model.'.\n",
"[2025-07-27 12:09:55,120] INFO utils.websearch_utils: Context generated to answer query 'Give me end to end working for text diffusion model.'.\n",
"[2025-07-27 12:09:55,120] INFO utils.utils: Logging results for query: Give me end to end working for text diffusion model.\n",
"[2025-07-27 12:09:55,120] INFO utils.utils: Logging results for query: Give me end to end working for text diffusion model.\n",
"[2025-07-27 12:09:55,121] INFO utils.websearch_utils: Logged results for query 'Give me end to end working for text diffusion model.'.\n",
"[2025-07-27 12:09:55,121] INFO utils.websearch_utils: Logged results for query 'Give me end to end working for text diffusion model.'.\n",
"[2025-07-27 12:09:55,121] INFO utils.websearch_utils: Generating Answer for query 'Give me end to end working for text diffusion model.' using response gen.\n",
"[2025-07-27 12:09:55,121] INFO utils.websearch_utils: Generating Answer for query 'Give me end to end working for text diffusion model.' using response gen.\n",
"[2025-07-27 12:09:55,122] INFO utils.answer_generation: Generating Answer for query: Give me end to end working for text diffusion model.\n",
"[2025-07-27 12:09:55,122] INFO utils.answer_generation: Generating Answer for query: Give me end to end working for text diffusion model.\n",
"[2025-07-27 12:09:57,237] INFO utils.answer_generation: Structured response generated successfully.\n",
"[2025-07-27 12:09:57,237] INFO utils.answer_generation: Structured response generated successfully.\n",
"[2025-07-27 12:09:57,239] INFO utils.websearch_utils: Response generated for query 'Give me end to end working for text diffusion model.'.\n",
"[2025-07-27 12:09:57,239] INFO utils.websearch_utils: Response generated for query 'Give me end to end working for text diffusion model.'.\n"
]
},
{
"data": {
"text/html": [
"#### Answer: \n",
"The provided research paper describes E3 TTS, an end-to-end text-to-speech model using diffusion. It takes plain \n",
"text as input and generates an audio waveform iteratively. It doesn't rely on intermediate representations like \n",
"spectrograms or alignment information. The model's architecture and training process are not fully detailed in the\n",
"abstract. To provide a complete workflow for a general text diffusion model, more information is needed, such as \n",
"the specific model architecture, training data, and hyperparameters.\n",
"\n",
"#### Next steps:\n",
"More information is needed to provide a complete workflow. The provided text focuses on a specific text-to-speech \n",
"model (E3 TTS) and doesn't detail a general text diffusion model workflow.\n",
"\n"
],
"text/plain": [
"#### Answer: \n",
"The provided research paper describes E3 TTS, an end-to-end text-to-speech model using diffusion. It takes plain \n",
"text as input and generates an audio waveform iteratively. It doesn't rely on intermediate representations like \n",
"spectrograms or alignment information. The model's architecture and training process are not fully detailed in the\n",
"abstract. To provide a complete workflow for a general text diffusion model, more information is needed, such as \n",
"the specific model architecture, training data, and hyperparameters.\n",
"\n",
"#### Next steps:\n",
"More information is needed to provide a complete workflow. The provided text focuses on a specific text-to-speech \n",
"model \u001b[1m(\u001b[0mE3 TTS\u001b[1m)\u001b[0m and doesn't detail a general text diffusion model workflow.\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"detailed_report = await query_web_response(\n",
" \"Give me end to end working for text diffusion model.\",\n",
" '26-07-2025',\n",
" 'Saturday',\n",
" searcher,\n",
" hf_embeddings,\n",
" True,\n",
" cross_encoder,\n",
" llmgoogle,\n",
" text_model=llmgoogle,\n",
" num_results=1,\n",
" document_paths=[],\n",
" local_mode=False,\n",
" split=False\n",
")\n",
"print(detailed_report[0])"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "de7a702f",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:10:02,224] INFO utils.answer_generation: Summary:True,subquery:['Summarize Ollama blog post on Secure Minions', 'Extract learning notes from Ollama Secure Minions blog post'], iscoverd:False\n",
"[2025-07-27 12:10:02,224] INFO utils.answer_generation: Summary:True,subquery:['Summarize Ollama blog post on Secure Minions', 'Extract learning notes from Ollama Secure Minions blog post'], iscoverd:False\n",
"[2025-07-27 12:10:02,225] INFO utils.websearch_utils: Search phrases for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions': ['summarize ollama blog post on secure minions', 'extract learning notes from ollama secure minions blog post']\n",
"[2025-07-27 12:10:02,225] INFO utils.websearch_utils: Search phrases for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions': ['summarize ollama blog post on secure minions', 'extract learning notes from ollama secure minions blog post']\n",
"[2025-07-27 12:10:02,226] INFO utils.websearch_utils: Extracted URLs from query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions': ['https://ollama.com/blog/secureminions']\n",
"[2025-07-27 12:10:02,226] INFO utils.websearch_utils: Extracted URLs from query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions': ['https://ollama.com/blog/secureminions']\n",
"[2025-07-27 12:10:02,226] INFO utils.websearch_utils: Created Document for source: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:02,226] INFO utils.websearch_utils: Created Document for source: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:02,226] INFO utils.websearch_utils: Search results fetched for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions'.\n",
"[2025-07-27 12:10:02,226] INFO utils.websearch_utils: Search results fetched for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions'.\n",
"[2025-07-27 12:10:02,227] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n",
"[2025-07-27 12:10:02,227] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n",
"/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n",
" warnings.warn('resource_tracker: process died unexpectedly, '\n",
"[2025-07-27 12:10:05,245] INFO utils.websearch_utils: Fetching URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:05,245] INFO utils.websearch_utils: Fetching URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:05,600] INFO utils.websearch_utils: Fetched content from https://ollama.com/blog/secureminions with type text/html; charset=utf-8\n",
"[2025-07-27 12:10:05,600] INFO utils.websearch_utils: Fetched content from https://ollama.com/blog/secureminions with type text/html; charset=utf-8\n",
"[2025-07-27 12:10:07,112] INFO utils.websearch_utils: Processed markdown for: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,112] INFO utils.websearch_utils: Processed markdown for: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,114] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,114] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,360] INFO utils.websearch_utils: Total URLs processed: 1\n",
"[2025-07-27 12:10:07,360] INFO utils.websearch_utils: Total URLs processed: 1\n",
"[2025-07-27 12:10:07,363] INFO utils.websearch_utils: Processed 1 docs for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,363] INFO utils.websearch_utils: Processed 1 docs for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,364] INFO utils.websearch_utils: URLs and markdown links removed from text.\n",
"[2025-07-27 12:10:07,364] INFO utils.websearch_utils: URLs and markdown links removed from text.\n",
"[2025-07-27 12:10:07,364] INFO utils.websearch_utils: Encoding start for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,364] INFO utils.websearch_utils: Encoding start for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,365] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:07,365] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:07,365] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:07,828] INFO utils.websearch_utils: Encoding end for URL: https://ollama.com/blog/secureminions, Time taken: 0.46 seconds\n",
"[2025-07-27 12:10:07,828] INFO utils.websearch_utils: Encoding end for URL: https://ollama.com/blog/secureminions, Time taken: 0.46 seconds\n",
"[2025-07-27 12:10:07,830] INFO utils.websearch_utils: Reranking start for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,830] INFO utils.websearch_utils: Reranking start for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:07,830] INFO utils.websearch_utils: Reranking end for URL: https://ollama.com/blog/secureminions, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:07,830] INFO utils.websearch_utils: Reranking end for URL: https://ollama.com/blog/secureminions, Time taken: 0.00 seconds\n",
"Batches: 100%|██████████| 1/1 [00:00<00:00, 2.77it/s]\n",
"[2025-07-27 12:10:09,352] INFO utils.websearch_utils: Retrieved 1 docs for https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:09,352] INFO utils.websearch_utils: Retrieved 1 docs for https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:09,353] INFO utils.websearch_utils: Built context for https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:09,353] INFO utils.websearch_utils: Built context for https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:09,353] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:09,353] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:09,354] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 1, total docs: 1\n",
"[2025-07-27 12:10:09,354] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 1, total docs: 1\n",
"[2025-07-27 12:10:09,354] INFO utils.websearch_utils: Context generated to answer query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions'.\n",
"[2025-07-27 12:10:09,354] INFO utils.websearch_utils: Context generated to answer query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions'.\n",
"[2025-07-27 12:10:09,355] INFO utils.utils: Logging results for query: Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:09,355] INFO utils.utils: Logging results for query: Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:09,356] INFO utils.websearch_utils: Logged results for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions'.\n",
"[2025-07-27 12:10:09,356] INFO utils.websearch_utils: Logged results for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions'.\n",
"[2025-07-27 12:10:09,356] INFO utils.websearch_utils: Generating summary for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions' using summarizer.\n",
"[2025-07-27 12:10:09,356] INFO utils.websearch_utils: Generating summary for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions' using summarizer.\n",
"[2025-07-27 12:10:09,357] INFO utils.answer_generation: Deduping docs: 1\n",
"[2025-07-27 12:10:09,357] INFO utils.answer_generation: Deduping docs: 1\n",
"[2025-07-27 12:10:09,357] WARNING utils.answer_generation: Capping max words to 6000\n",
"[2025-07-27 12:10:09,357] WARNING utils.answer_generation: Capping max words to 6000\n",
"[2025-07-27 12:10:09,357] INFO utils.answer_generation: Arrived Len of Docs: 1\n",
"[2025-07-27 12:10:09,357] INFO utils.answer_generation: Arrived Len of Docs: 1\n",
"[2025-07-27 12:10:09,358] INFO utils.answer_generation: Only one document provided, summarizing it.\n",
"[2025-07-27 12:10:09,358] INFO utils.answer_generation: Only one document provided, summarizing it.\n",
"[2025-07-27 12:10:13,210] INFO utils.websearch_utils: Response generated for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions'.\n",
"[2025-07-27 12:10:13,210] INFO utils.websearch_utils: Response generated for query 'Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions'.\n"
]
},
{
"data": {
"text/html": [
"This blog post from Ollama details Secure Minions, a collaboration with Stanford's Hazy Research lab enhancing the \n",
"open-source Minions project. Minions allows local LLMs (like Ollama's models) to collaborate with powerful \n",
"cloud-based frontier models (like GPT-4o) efficiently and cost-effectively. The original Minions protocol, while \n",
"reducing cloud costs significantly (5x-30x) and maintaining high accuracy (98%), still transmitted some potentially\n",
"sensitive data to the cloud.\n",
"\n",
"Secure Minions addresses this privacy concern by implementing end-to-end encryption, even from the cloud provider. \n",
"This is achieved using NVIDIA's Hopper H100 GPUs' confidential computing mode. The result is a system where no \n",
"plaintext is exposed during transmission or remote LLM inference, with minimal latency overhead (less than 1%).\n",
"\n",
"The blog post provides instructions for getting started: cloning the repository, setting up a virtual environment, \n",
"installing the necessary packages (including Ollama and a model like Gemma 3:4b), and running either an interactive\n",
"Streamlit app or a Python script demonstrating the secure protocol. Example code is included to illustrate \n",
"programmatic usage. The post encourages readers to refer to the HazyResearch blog for complete technical details.\n",
"\n",
"\n",
"**Learning Notes:**\n",
"\n",
"* **Minions:** A system for efficient and cost-effective collaboration between local and cloud-based LLMs.\n",
"* **Secure Minions:** An enhanced version of Minions providing end-to-end encryption for enhanced privacy.\n",
"* **Confidential Computing:** Leveraging hardware capabilities (NVIDIA Hopper H100 GPUs) to protect data during \n",
"processing and transmission.\n",
"* **Practical Implementation:** The blog post provides clear instructions and example code for using Secure \n",
"Minions.\n",
"* **Key Improvement:** Secure Minions significantly improves the privacy of local-first LLM setups by preventing \n",
"sensitive data from leaving the device.\n",
"* **Minimal Overhead:** The added security comes with minimal performance impact (less than 1% latency increase).\n",
"\n",
"\n",
"**Assumptions Made:**\n",
"\n",
"* The reader has basic familiarity with command-line interfaces, Git, Python, and virtual environments.\n",
"* The reader has access to a system with sufficient resources to run the required software and models (including \n",
"potentially an NVIDIA Hopper H100 GPU for optimal performance, although this is not explicitly stated as a \n",
"requirement).\n",
"* The reader understands the basic concepts of LLMs and their applications.\n",
"\n"
],
"text/plain": [
"This blog post from Ollama details Secure Minions, a collaboration with Stanford's Hazy Research lab enhancing the \n",
"open-source Minions project. Minions allows local LLMs \u001b[1m(\u001b[0mlike Ollama's models\u001b[1m)\u001b[0m to collaborate with powerful \n",
"cloud-based frontier models \u001b[1m(\u001b[0mlike GPT-4o\u001b[1m)\u001b[0m efficiently and cost-effectively. The original Minions protocol, while \n",
"reducing cloud costs significantly \u001b[1m(\u001b[0m5x-3\u001b[1;36m0x\u001b[0m\u001b[1m)\u001b[0m and maintaining high accuracy \u001b[1m(\u001b[0m\u001b[1;36m98\u001b[0m%\u001b[1m)\u001b[0m, still transmitted some potentially\n",
"sensitive data to the cloud.\n",
"\n",
"Secure Minions addresses this privacy concern by implementing end-to-end encryption, even from the cloud provider. \n",
"This is achieved using NVIDIA's Hopper H100 GPUs' confidential computing mode. The result is a system where no \n",
"plaintext is exposed during transmission or remote LLM inference, with minimal latency overhead \u001b[1m(\u001b[0mless than \u001b[1;36m1\u001b[0m%\u001b[1m)\u001b[0m.\n",
"\n",
"The blog post provides instructions for getting started: cloning the repository, setting up a virtual environment, \n",
"installing the necessary packages \u001b[1m(\u001b[0mincluding Ollama and a model like Gemma \u001b[1;92m3:4b\u001b[0m\u001b[1m)\u001b[0m, and running either an interactive\n",
"Streamlit app or a Python script demonstrating the secure protocol. Example code is included to illustrate \n",
"programmatic usage. The post encourages readers to refer to the HazyResearch blog for complete technical details.\n",
"\n",
"\n",
"**Learning Notes:**\n",
"\n",
"* **Minions:** A system for efficient and cost-effective collaboration between local and cloud-based LLMs.\n",
"* **Secure Minions:** An enhanced version of Minions providing end-to-end encryption for enhanced privacy.\n",
"* **Confidential Computing:** Leveraging hardware capabilities \u001b[1m(\u001b[0mNVIDIA Hopper H100 GPUs\u001b[1m)\u001b[0m to protect data during \n",
"processing and transmission.\n",
"* **Practical Implementation:** The blog post provides clear instructions and example code for using Secure \n",
"Minions.\n",
"* **Key Improvement:** Secure Minions significantly improves the privacy of local-first LLM setups by preventing \n",
"sensitive data from leaving the device.\n",
"* **Minimal Overhead:** The added security comes with minimal performance impact \u001b[1m(\u001b[0mless than \u001b[1;36m1\u001b[0m% latency increase\u001b[1m)\u001b[0m.\n",
"\n",
"\n",
"**Assumptions Made:**\n",
"\n",
"* The reader has basic familiarity with command-line interfaces, Git, Python, and virtual environments.\n",
"* The reader has access to a system with sufficient resources to run the required software and models \u001b[1m(\u001b[0mincluding \n",
"potentially an NVIDIA Hopper H100 GPU for optimal performance, although this is not explicitly stated as a \n",
"requirement\u001b[1m)\u001b[0m.\n",
"* The reader understands the basic concepts of LLMs and their applications.\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# You can even summarise full page \n",
"detailed_report = await query_web_response(\n",
" \"Summarise this full page in detail, and give me learning notes https://ollama.com/blog/secureminions\",\n",
" '27-06-2025',\n",
" 'Saturday',\n",
" searcher,\n",
" hf_embeddings,\n",
" True,\n",
" cross_encoder,\n",
" llmgoogle,\n",
" text_model=llmgoogle,\n",
" num_results=3,\n",
" document_paths=[],\n",
" local_mode=False,\n",
" split=False\n",
")\n",
"print(detailed_report[0])"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "aafb2ae6",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:10:19,356] INFO utils.answer_generation: Summary:True,subquery:['Summarize SecureMinions blog', 'Summarize llama.cpp github'], iscoverd:True\n",
"[2025-07-27 12:10:19,356] INFO utils.answer_generation: Summary:True,subquery:['Summarize SecureMinions blog', 'Summarize llama.cpp github'], iscoverd:True\n",
"[2025-07-27 12:10:19,358] INFO utils.websearch_utils: Search phrases for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp': ['summarize secureminions blog', 'summarize llama.cpp github']\n",
"[2025-07-27 12:10:19,358] INFO utils.websearch_utils: Search phrases for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp': ['summarize secureminions blog', 'summarize llama.cpp github']\n",
"[2025-07-27 12:10:19,358] INFO utils.websearch_utils: Extracted URLs from query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp': ['https://ollama.com/blog/secureminions', 'https://github.com/ggml-org/llama.cpp']\n",
"[2025-07-27 12:10:19,358] INFO utils.websearch_utils: Extracted URLs from query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp': ['https://ollama.com/blog/secureminions', 'https://github.com/ggml-org/llama.cpp']\n",
"[2025-07-27 12:10:19,359] INFO utils.websearch_utils: Created Document for source: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:19,359] INFO utils.websearch_utils: Created Document for source: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:19,360] INFO utils.websearch_utils: Created Document for source: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:19,360] INFO utils.websearch_utils: Created Document for source: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:19,361] INFO utils.websearch_utils: Search results fetched for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp'.\n",
"[2025-07-27 12:10:19,361] INFO utils.websearch_utils: Search results fetched for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp'.\n",
"[2025-07-27 12:10:19,362] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n",
"[2025-07-27 12:10:19,362] INFO utils.websearch_utils: Starting context_to_docs for 1 URL groups.\n",
"/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n",
" warnings.warn('resource_tracker: process died unexpectedly, '\n",
"[2025-07-27 12:10:22,396] INFO utils.websearch_utils: Fetching URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:22,396] INFO utils.websearch_utils: Fetching URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:22,396] INFO utils.websearch_utils: Fetching URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:22,396] INFO utils.websearch_utils: Fetching URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:23,126] INFO utils.websearch_utils: Fetched content from https://github.com/ggml-org/llama.cpp with type text/html; charset=utf-8\n",
"[2025-07-27 12:10:23,126] INFO utils.websearch_utils: Fetched content from https://github.com/ggml-org/llama.cpp with type text/html; charset=utf-8\n",
"[2025-07-27 12:10:23,698] INFO utils.websearch_utils: Fetched content from https://ollama.com/blog/secureminions with type text/html; charset=utf-8\n",
"[2025-07-27 12:10:23,698] INFO utils.websearch_utils: Fetched content from https://ollama.com/blog/secureminions with type text/html; charset=utf-8\n",
"[2025-07-27 12:10:24,925] INFO utils.websearch_utils: Processed markdown for: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:24,925] INFO utils.websearch_utils: Processed markdown for: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:24,926] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:24,926] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:25,113] INFO utils.websearch_utils: Processed markdown for: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:25,113] INFO utils.websearch_utils: Processed markdown for: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:25,113] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:25,113] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:25,248] INFO utils.websearch_utils: Total URLs processed: 1\n",
"[2025-07-27 12:10:25,248] INFO utils.websearch_utils: Total URLs processed: 1\n",
"[2025-07-27 12:10:25,252] INFO utils.websearch_utils: Processed 1 docs for URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:25,252] INFO utils.websearch_utils: Processed 1 docs for URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:25,252] INFO utils.websearch_utils: URLs and markdown links removed from text.\n",
"[2025-07-27 12:10:25,252] INFO utils.websearch_utils: URLs and markdown links removed from text.\n",
"[2025-07-27 12:10:25,253] INFO utils.websearch_utils: Encoding start for URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:25,253] INFO utils.websearch_utils: Encoding start for URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:25,254] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:25,254] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:25,254] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:25,415] INFO utils.websearch_utils: Total URLs processed: 1\n",
"[2025-07-27 12:10:25,415] INFO utils.websearch_utils: Total URLs processed: 1\n",
"[2025-07-27 12:10:25,420] INFO utils.websearch_utils: Processed 1 docs for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:25,420] INFO utils.websearch_utils: Processed 1 docs for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:25,420] INFO utils.websearch_utils: URLs and markdown links removed from text.\n",
"[2025-07-27 12:10:25,420] INFO utils.websearch_utils: URLs and markdown links removed from text.\n",
"[2025-07-27 12:10:25,421] INFO utils.websearch_utils: Encoding start for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:25,421] INFO utils.websearch_utils: Encoding start for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:25,422] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:25,422] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:25,422] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:25,749] INFO utils.websearch_utils: Encoding end for URL: https://github.com/ggml-org/llama.cpp, Time taken: 0.50 seconds\n",
"[2025-07-27 12:10:25,749] INFO utils.websearch_utils: Encoding end for URL: https://github.com/ggml-org/llama.cpp, Time taken: 0.50 seconds\n",
"[2025-07-27 12:10:25,750] INFO utils.websearch_utils: Reranking start for URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:25,750] INFO utils.websearch_utils: Reranking start for URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:25,751] INFO utils.websearch_utils: Reranking end for URL: https://github.com/ggml-org/llama.cpp, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:25,751] INFO utils.websearch_utils: Reranking end for URL: https://github.com/ggml-org/llama.cpp, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:26,830] INFO utils.websearch_utils: Encoding end for URL: https://ollama.com/blog/secureminions, Time taken: 1.41 seconds\n",
"[2025-07-27 12:10:26,830] INFO utils.websearch_utils: Encoding end for URL: https://ollama.com/blog/secureminions, Time taken: 1.41 seconds\n",
"[2025-07-27 12:10:26,831] INFO utils.websearch_utils: Reranking start for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:26,831] INFO utils.websearch_utils: Reranking start for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:26,832] INFO utils.websearch_utils: Reranking end for URL: https://ollama.com/blog/secureminions, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:26,832] INFO utils.websearch_utils: Reranking end for URL: https://ollama.com/blog/secureminions, Time taken: 0.00 seconds\n",
"Batches: 100%|██████████| 1/1 [00:00<00:00, 2.65it/s]\n",
"Batches: 0%| | 0/1 [00:00, ?it/s][2025-07-27 12:10:27,402] INFO utils.websearch_utils: Retrieved 1 docs for https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:27,402] INFO utils.websearch_utils: Retrieved 1 docs for https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:27,402] INFO utils.websearch_utils: Built context for https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:27,402] INFO utils.websearch_utils: Built context for https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:27,403] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:27,403] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://github.com/ggml-org/llama.cpp\n",
"Batches: 100%|██████████| 1/1 [00:00<00:00, 9.89it/s]\n",
"[2025-07-27 12:10:27,488] INFO utils.websearch_utils: Retrieved 1 docs for https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:27,488] INFO utils.websearch_utils: Retrieved 1 docs for https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:27,489] INFO utils.websearch_utils: Built context for https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:27,489] INFO utils.websearch_utils: Built context for https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:27,489] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:27,489] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: https://ollama.com/blog/secureminions\n",
"[2025-07-27 12:10:27,490] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 2, total docs: 2\n",
"[2025-07-27 12:10:27,490] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 2, total docs: 2\n",
"[2025-07-27 12:10:27,490] INFO utils.websearch_utils: Context generated to answer query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp'.\n",
"[2025-07-27 12:10:27,490] INFO utils.websearch_utils: Context generated to answer query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp'.\n",
"[2025-07-27 12:10:27,491] INFO utils.utils: Logging results for query: Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:27,491] INFO utils.utils: Logging results for query: Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp\n",
"[2025-07-27 12:10:27,491] INFO utils.websearch_utils: Logged results for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp'.\n",
"[2025-07-27 12:10:27,491] INFO utils.websearch_utils: Logged results for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp'.\n",
"[2025-07-27 12:10:27,492] INFO utils.websearch_utils: Generating summary for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp' using summarizer.\n",
"[2025-07-27 12:10:27,492] INFO utils.websearch_utils: Generating summary for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp' using summarizer.\n",
"[2025-07-27 12:10:27,492] INFO utils.answer_generation: Deduping docs: 2\n",
"[2025-07-27 12:10:27,492] INFO utils.answer_generation: Deduping docs: 2\n",
"[2025-07-27 12:10:27,492] WARNING utils.answer_generation: Capping max words to 6000\n",
"[2025-07-27 12:10:27,492] WARNING utils.answer_generation: Capping max words to 6000\n",
"[2025-07-27 12:10:27,493] INFO utils.answer_generation: Arrived Len of Docs: 2\n",
"[2025-07-27 12:10:27,493] INFO utils.answer_generation: Arrived Len of Docs: 2\n"
]
},
{
"data": {
"text/html": [
"Summarising using 2 documents\n",
"\n"
],
"text/plain": [
"Summarising using \u001b[1;36m2\u001b[0m documents\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:10:30,668] INFO utils.websearch_utils: Response generated for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp'.\n",
"[2025-07-27 12:10:30,668] INFO utils.websearch_utils: Response generated for query 'Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp'.\n"
]
},
{
"data": {
"text/html": [
"Here's a summary addressing the user's query, combining information from the provided documents:\n",
"\n",
"**Summary:**\n",
"\n",
"The Ollama blog post details \"Secure Minions,\" a collaboration between Ollama and Stanford's Hazy Research lab. \n",
"Secure Minions enhances the original Minions project, which allows local LLMs (like Ollama's models) to collaborate\n",
"with powerful cloud-based frontier models (like GPT-4o) while minimizing data transfer to the cloud. The key \n",
"improvement in Secure Minions is the implementation of end-to-end encryption using NVIDIA's Hopper H100 GPUs' \n",
"confidential computing mode. This ensures that no plaintext data is exposed during transmission or inference, even \n",
"from the cloud provider. The overhead is minimal (less than 1% added latency), even with large models and long \n",
"prompts. The blog post provides instructions for setting up and running Secure Minions, including using a provided\n",
"Streamlit app and example Python code.\n",
"\n",
"The GitHub repository for `llama.cpp` describes a C/C++ library for LLM inference. It aims for minimal setup and \n",
"high performance across various hardware platforms. It supports several backends (including Metal, CUDA, HIP, and \n",
"others), allowing for inference on CPUs, GPUs, and other accelerators. The repository includes tools like \n",
"`llama-cli` (a command-line interface), `llama-server` (an OpenAI API-compatible server), and `llama-bench` (for \n",
"benchmarking). It also provides instructions for obtaining and quantizing models, primarily using the GGUF format,\n",
"and offers support for models from Hugging Face and other sources.\n",
"\n",
"\n",
"**Assumptions Made:**\n",
"\n",
"* No assumptions were made beyond the information explicitly presented in the provided documents. The summary \n",
"directly reflects the content of the blog post and the GitHub repository description.\n",
"\n"
],
"text/plain": [
"Here's a summary addressing the user's query, combining information from the provided documents:\n",
"\n",
"**Summary:**\n",
"\n",
"The Ollama blog post details \u001b[32m\"Secure Minions,\"\u001b[0m a collaboration between Ollama and Stanford's Hazy Research lab. \n",
"Secure Minions enhances the original Minions project, which allows local LLMs \u001b[1m(\u001b[0mlike Ollama's models\u001b[1m)\u001b[0m to collaborate\n",
"with powerful cloud-based frontier models \u001b[1m(\u001b[0mlike GPT-4o\u001b[1m)\u001b[0m while minimizing data transfer to the cloud. The key \n",
"improvement in Secure Minions is the implementation of end-to-end encryption using NVIDIA's Hopper H100 GPUs' \n",
"confidential computing mode. This ensures that no plaintext data is exposed during transmission or inference, even \n",
"from the cloud provider. The overhead is minimal \u001b[1m(\u001b[0mless than \u001b[1;36m1\u001b[0m% added latency\u001b[1m)\u001b[0m, even with large models and long \n",
"prompts. The blog post provides instructions for setting up and running Secure Minions, including using a provided\n",
"Streamlit app and example Python code.\n",
"\n",
"The GitHub repository for `llama.cpp` describes a C/C++ library for LLM inference. It aims for minimal setup and \n",
"high performance across various hardware platforms. It supports several backends \u001b[1m(\u001b[0mincluding Metal, CUDA, HIP, and \n",
"others\u001b[1m)\u001b[0m, allowing for inference on CPUs, GPUs, and other accelerators. The repository includes tools like \n",
"`llama-cli` \u001b[1m(\u001b[0ma command-line interface\u001b[1m)\u001b[0m, `llama-server` \u001b[1m(\u001b[0man OpenAI API-compatible server\u001b[1m)\u001b[0m, and `llama-bench` \u001b[1m(\u001b[0mfor \n",
"benchmarking\u001b[1m)\u001b[0m. It also provides instructions for obtaining and quantizing models, primarily using the GGUF format,\n",
"and offers support for models from Hugging Face and other sources.\n",
"\n",
"\n",
"**Assumptions Made:**\n",
"\n",
"* No assumptions were made beyond the information explicitly presented in the provided documents. The summary \n",
"directly reflects the content of the blog post and the GitHub repository description.\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# or multiple pages\n",
"detailed_report = await query_web_response(\n",
" \"Summarise https://ollama.com/blog/secureminions and https://github.com/ggml-org/llama.cpp\",\n",
" '27-06-2025',\n",
" 'Saturday',\n",
" searcher,\n",
" hf_embeddings,\n",
" True,\n",
" cross_encoder,\n",
" llmgoogle,\n",
" text_model=llmgoogle,\n",
" num_results=3,\n",
" document_paths=[],\n",
" local_mode=False,\n",
" split=False\n",
")\n",
"print(detailed_report[0])"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "6a622a9f",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:10:35,780] INFO utils.answer_generation: Summary:True,subquery:['Explain each code file concisely', 'Give 2 lines max for each explanation'], iscoverd:False\n",
"[2025-07-27 12:10:35,780] INFO utils.answer_generation: Summary:True,subquery:['Explain each code file concisely', 'Give 2 lines max for each explanation'], iscoverd:False\n",
"[2025-07-27 12:10:35,781] INFO utils.websearch_utils: Search phrases for query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each': ['explain each code file concisely', 'give 2 lines max for each explanation']\n",
"[2025-07-27 12:10:35,781] INFO utils.websearch_utils: Search phrases for query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each': ['explain each code file concisely', 'give 2 lines max for each explanation']\n",
"[2025-07-27 12:10:35,782] WARNING utils.websearch_utils: Please add list of paths as input, earlier it used to be list of list\n",
"[2025-07-27 12:10:35,782] WARNING utils.websearch_utils: Please add list of paths as input, earlier it used to be list of list\n",
"[2025-07-27 12:10:35,784] INFO utils.websearch_utils: Total paths for 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each': [['utils/map.py', 'app.py']]\n",
"[2025-07-27 12:10:35,784] INFO utils.websearch_utils: Total paths for 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each': [['utils/map.py', 'app.py']]\n",
"[2025-07-27 12:10:35,785] WARNING utils.websearch_utils: No websearcher provided; using document_paths only.\n",
"[2025-07-27 12:10:35,785] WARNING utils.websearch_utils: No websearcher provided; using document_paths only.\n",
"[2025-07-27 12:10:35,785] INFO utils.websearch_utils: Starting context_to_docs for 2 URL groups.\n",
"[2025-07-27 12:10:35,785] INFO utils.websearch_utils: Starting context_to_docs for 2 URL groups.\n",
"/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/resource_tracker.py:136: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak.\n",
" warnings.warn('resource_tracker: process died unexpectedly, '\n",
"[2025-07-27 12:10:35,817] INFO utils.websearch_utils: Processing local file: utils/map.py\n",
"[2025-07-27 12:10:35,817] INFO utils.websearch_utils: Processing local file: utils/map.py\n",
"[2025-07-27 12:10:35,818] INFO utils.websearch_utils: Processing local file: utils/map.py\n",
"[2025-07-27 12:10:35,818] INFO utils.websearch_utils: Processing local file: utils/map.py\n",
"[2025-07-27 12:10:35,823] INFO utils.websearch_utils: Processing local file: app.py\n",
"[2025-07-27 12:10:35,823] INFO utils.websearch_utils: Processing local file: app.py\n",
"[2025-07-27 12:10:35,825] INFO utils.websearch_utils: Processing local file: app.py\n",
"[2025-07-27 12:10:35,825] INFO utils.websearch_utils: Processing local file: app.py\n",
"[2025-07-27 12:10:37,822] INFO utils.websearch_utils: Processed markdown for: app.py\n",
"[2025-07-27 12:10:37,822] INFO utils.websearch_utils: Processed markdown for: app.py\n",
"[2025-07-27 12:10:37,822] INFO utils.websearch_utils: Processed markdown for: utils/map.py\n",
"[2025-07-27 12:10:37,822] INFO utils.websearch_utils: Processed markdown for: utils/map.py\n",
"[2025-07-27 12:10:37,823] INFO utils.websearch_utils: Processed markdown for: utils/map.py\n",
"[2025-07-27 12:10:37,823] INFO utils.websearch_utils: Processed markdown for: utils/map.py\n",
"[2025-07-27 12:10:37,823] INFO utils.websearch_utils: Processed markdown for: app.py\n",
"[2025-07-27 12:10:37,823] INFO utils.websearch_utils: Processed markdown for: app.py\n",
"[2025-07-27 12:10:37,824] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: app.py\n",
"[2025-07-27 12:10:37,824] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: app.py\n",
"[2025-07-27 12:10:37,825] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: utils/map.py\n",
"[2025-07-27 12:10:37,825] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: utils/map.py\n",
"[2025-07-27 12:10:37,826] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: utils/map.py\n",
"[2025-07-27 12:10:37,826] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: utils/map.py\n",
"[2025-07-27 12:10:37,827] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: app.py\n",
"[2025-07-27 12:10:37,827] INFO utils.websearch_utils: Successfully processed and added document(s) for URL: app.py\n",
"[2025-07-27 12:10:39,227] INFO utils.websearch_utils: Total URLs processed: 4\n",
"[2025-07-27 12:10:39,227] INFO utils.websearch_utils: Total URLs processed: 4\n",
"[2025-07-27 12:10:39,229] INFO utils.websearch_utils: Total URLs processed: 4\n",
"[2025-07-27 12:10:39,229] INFO utils.websearch_utils: Total URLs processed: 4\n",
"[2025-07-27 12:10:39,229] INFO utils.websearch_utils: Total URLs processed: 9\n",
"[2025-07-27 12:10:39,229] INFO utils.websearch_utils: Total URLs processed: 9\n",
"[2025-07-27 12:10:39,229] INFO utils.websearch_utils: Total URLs processed: 9\n",
"[2025-07-27 12:10:39,229] INFO utils.websearch_utils: Total URLs processed: 9\n",
"[2025-07-27 12:10:39,232] INFO utils.websearch_utils: Processed 4 docs for URL: app.py\n",
"[2025-07-27 12:10:39,232] INFO utils.websearch_utils: Processed 4 docs for URL: app.py\n",
"[2025-07-27 12:10:39,232] INFO utils.websearch_utils: Processed 9 docs for URL: utils/map.py\n",
"[2025-07-27 12:10:39,232] INFO utils.websearch_utils: Processed 9 docs for URL: utils/map.py\n",
"[2025-07-27 12:10:39,232] INFO utils.websearch_utils: Processed 4 docs for URL: app.py\n",
"[2025-07-27 12:10:39,232] INFO utils.websearch_utils: Processed 4 docs for URL: app.py\n",
"[2025-07-27 12:10:39,233] INFO utils.websearch_utils: Encoding start for URL: app.py\n",
"[2025-07-27 12:10:39,233] INFO utils.websearch_utils: Encoding start for URL: app.py\n",
"[2025-07-27 12:10:39,233] INFO utils.websearch_utils: Processed 9 docs for URL: utils/map.py\n",
"[2025-07-27 12:10:39,235] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,233] INFO utils.websearch_utils: Processed 9 docs for URL: utils/map.py\n",
"[2025-07-27 12:10:39,233] INFO utils.websearch_utils: Encoding start for URL: utils/map.py\n",
"[2025-07-27 12:10:39,235] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,234] INFO utils.websearch_utils: Encoding start for URL: app.py\n",
"[2025-07-27 12:10:39,233] INFO utils.websearch_utils: Encoding start for URL: utils/map.py\n",
"[2025-07-27 12:10:39,236] INFO utils.websearch_utils: Encoding start for URL: utils/map.py\n",
"[2025-07-27 12:10:39,237] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,235] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,237] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,234] INFO utils.websearch_utils: Encoding start for URL: app.py\n",
"[2025-07-27 12:10:39,245] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,245] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,236] INFO utils.websearch_utils: Encoding start for URL: utils/map.py\n",
"[2025-07-27 12:10:39,246] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,246] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,247] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,237] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,247] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,253] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,245] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,253] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,246] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,277] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,247] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,277] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,300] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,253] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,300] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,277] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:39,300] INFO chromadb.telemetry.product.posthog: Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.\n",
"[2025-07-27 12:10:40,069] INFO utils.websearch_utils: Encoding end for URL: utils/map.py, Time taken: 0.84 seconds\n",
"[2025-07-27 12:10:40,069] INFO utils.websearch_utils: Encoding end for URL: utils/map.py, Time taken: 0.84 seconds\n",
"[2025-07-27 12:10:40,070] INFO utils.websearch_utils: Reranking start for URL: utils/map.py\n",
"[2025-07-27 12:10:40,070] INFO utils.websearch_utils: Reranking start for URL: utils/map.py\n",
"[2025-07-27 12:10:40,071] INFO utils.websearch_utils: Reranking end for URL: utils/map.py, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:40,071] INFO utils.websearch_utils: Reranking end for URL: utils/map.py, Time taken: 0.00 seconds\n",
"Batches: 0%| | 0/1 [00:00, ?it/s][2025-07-27 12:10:41,036] INFO utils.websearch_utils: Encoding end for URL: app.py, Time taken: 1.80 seconds\n",
"[2025-07-27 12:10:41,036] INFO utils.websearch_utils: Encoding end for URL: app.py, Time taken: 1.80 seconds\n",
"[2025-07-27 12:10:41,042] INFO utils.websearch_utils: Encoding end for URL: app.py, Time taken: 1.81 seconds\n",
"[2025-07-27 12:10:41,042] INFO utils.websearch_utils: Encoding end for URL: app.py, Time taken: 1.81 seconds\n",
"[2025-07-27 12:10:41,042] INFO utils.websearch_utils: Reranking start for URL: app.py\n",
"[2025-07-27 12:10:41,042] INFO utils.websearch_utils: Reranking start for URL: app.py\n",
"[2025-07-27 12:10:41,042] INFO utils.websearch_utils: Reranking start for URL: app.py\n",
"[2025-07-27 12:10:41,042] INFO utils.websearch_utils: Reranking start for URL: app.py\n",
"[2025-07-27 12:10:41,043] INFO utils.websearch_utils: Reranking end for URL: app.py, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:41,043] INFO utils.websearch_utils: Reranking end for URL: app.py, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:41,043] INFO utils.websearch_utils: Reranking end for URL: app.py, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:41,043] INFO utils.websearch_utils: Reranking end for URL: app.py, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:41,172] INFO utils.websearch_utils: Encoding end for URL: utils/map.py, Time taken: 1.94 seconds\n",
"[2025-07-27 12:10:41,172] INFO utils.websearch_utils: Encoding end for URL: utils/map.py, Time taken: 1.94 seconds\n",
"[2025-07-27 12:10:41,173] INFO utils.websearch_utils: Reranking start for URL: utils/map.py\n",
"[2025-07-27 12:10:41,173] INFO utils.websearch_utils: Reranking start for URL: utils/map.py\n",
"[2025-07-27 12:10:41,173] INFO utils.websearch_utils: Reranking end for URL: utils/map.py, Time taken: 0.00 seconds\n",
"[2025-07-27 12:10:41,173] INFO utils.websearch_utils: Reranking end for URL: utils/map.py, Time taken: 0.00 seconds\n",
"Batches: 100%|██████████| 1/1 [00:01<00:00, 1.32s/it]\n",
"\n",
"Batches: 0%| | 0/1 [00:00, ?it/s][2025-07-27 12:10:42,666] INFO utils.websearch_utils: Retrieved 4 docs for utils/map.py\n",
"[2025-07-27 12:10:42,666] INFO utils.websearch_utils: Retrieved 4 docs for utils/map.py\n",
"[2025-07-27 12:10:42,668] INFO utils.websearch_utils: Built context for utils/map.py\n",
"[2025-07-27 12:10:42,668] INFO utils.websearch_utils: Built context for utils/map.py\n",
"[2025-07-27 12:10:42,672] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: utils/map.py\n",
"[2025-07-27 12:10:42,672] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: utils/map.py\n",
"Batches: 100%|██████████| 1/1 [00:01<00:00, 1.01s/it]\n",
"[2025-07-27 12:10:42,700] INFO utils.websearch_utils: Retrieved 3 docs for app.py\n",
"[2025-07-27 12:10:42,700] INFO utils.websearch_utils: Retrieved 3 docs for app.py\n",
"[2025-07-27 12:10:42,701] INFO utils.websearch_utils: Built context for app.py\n",
"[2025-07-27 12:10:42,701] INFO utils.websearch_utils: Built context for app.py\n",
"[2025-07-27 12:10:42,702] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: app.py\n",
"[2025-07-27 12:10:42,702] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: app.py\n",
"Batches: 100%|██████████| 1/1 [00:00<00:00, 4.26it/s]\n",
"[2025-07-27 12:10:43,210] INFO utils.websearch_utils: Retrieved 2 docs for app.py\n",
"[2025-07-27 12:10:43,210] INFO utils.websearch_utils: Retrieved 2 docs for app.py\n",
"[2025-07-27 12:10:43,211] INFO utils.websearch_utils: Built context for app.py\n",
"[2025-07-27 12:10:43,211] INFO utils.websearch_utils: Built context for app.py\n",
"[2025-07-27 12:10:43,213] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: app.py\n",
"[2025-07-27 12:10:43,213] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: app.py\n",
"\n",
"Batches: 100%|██████████| 1/1 [00:00<00:00, 1.65it/s]\n",
"[2025-07-27 12:10:43,224] INFO utils.websearch_utils: Retrieved 4 docs for utils/map.py\n",
"[2025-07-27 12:10:43,224] INFO utils.websearch_utils: Retrieved 4 docs for utils/map.py\n",
"[2025-07-27 12:10:43,224] INFO utils.websearch_utils: Built context for utils/map.py\n",
"[2025-07-27 12:10:43,224] INFO utils.websearch_utils: Built context for utils/map.py\n",
"[2025-07-27 12:10:43,228] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: utils/map.py\n",
"[2025-07-27 12:10:43,228] INFO utils.websearch_utils: Successfully processed and added context/docs for URL: utils/map.py\n",
"[2025-07-27 12:10:43,232] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 4, total docs: 26\n",
"[2025-07-27 12:10:43,232] INFO utils.websearch_utils: context_to_docs complete. Total contexts: 4, total docs: 26\n",
"[2025-07-27 12:10:43,232] INFO utils.websearch_utils: Context generated to answer query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each'.\n",
"[2025-07-27 12:10:43,232] INFO utils.websearch_utils: Context generated to answer query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each'.\n",
"[2025-07-27 12:10:43,233] INFO utils.utils: Logging results for query: Read the code file and for each explain me what it does in concise manner, 2 lines max for each\n",
"[2025-07-27 12:10:43,233] INFO utils.utils: Logging results for query: Read the code file and for each explain me what it does in concise manner, 2 lines max for each\n",
"[2025-07-27 12:10:43,234] INFO utils.websearch_utils: Logged results for query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each'.\n",
"[2025-07-27 12:10:43,234] INFO utils.websearch_utils: Logged results for query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each'.\n",
"[2025-07-27 12:10:43,234] INFO utils.websearch_utils: Generating summary for query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each' using summarizer.\n",
"[2025-07-27 12:10:43,234] INFO utils.websearch_utils: Generating summary for query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each' using summarizer.\n",
"[2025-07-27 12:10:43,235] INFO utils.answer_generation: Deduping docs: 26\n",
"[2025-07-27 12:10:43,235] INFO utils.answer_generation: Deduping docs: 26\n",
"[2025-07-27 12:10:43,236] WARNING utils.answer_generation: Capping max words to 6000\n",
"[2025-07-27 12:10:43,236] WARNING utils.answer_generation: Capping max words to 6000\n",
"[2025-07-27 12:10:43,236] INFO utils.answer_generation: Arrived Len of Docs: 13\n",
"[2025-07-27 12:10:43,236] INFO utils.answer_generation: Arrived Len of Docs: 13\n"
]
},
{
"data": {
"text/html": [
"Summarising using 13 documents\n",
"\n"
],
"text/plain": [
"Summarising using \u001b[1;36m13\u001b[0m documents\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-07-27 12:10:46,010] INFO utils.websearch_utils: Response generated for query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each'.\n",
"[2025-07-27 12:10:46,010] INFO utils.websearch_utils: Response generated for query 'Read the code file and for each explain me what it does in concise manner, 2 lines max for each'.\n"
]
},
{
"data": {
"text/html": [
"The code implements a FastAPI application providing various search functionalities. It uses several utility \n",
"modules (`utils/map.py`, `utils/websearch_utils.py`, `utils/reddit_utils.py`, `utils/git_utils.py`) for web search,\n",
"Reddit search, map-based route planning with POIs, and Git repository interaction. The application also includes \n",
"functionality for summarizing web pages and YouTube videos, and checking the completeness of research. A large \n",
"language model (LLM) is used for several tasks, including response generation and summarization. The \n",
"`model_config.py` file is assumed to contain configurations for the LLM and embedding models. The application uses\n",
"a SearxNG docker container for web searches (assumed to be started automatically if not already running). The \n",
"`utils/map.py` module uses the Overpass and Nominatim APIs for POI retrieval and geocoding, and the OSRM API for \n",
"route calculation. The map is generated using Folium and saved as an HTML file.\n",
"\n"
],
"text/plain": [
"The code implements a FastAPI application providing various search functionalities. It uses several utility \n",
"modules \u001b[1m(\u001b[0m`utils/map.py`, `utils/websearch_utils.py`, `utils/reddit_utils.py`, `utils/git_utils.py`\u001b[1m)\u001b[0m for web search,\n",
"Reddit search, map-based route planning with POIs, and Git repository interaction. The application also includes \n",
"functionality for summarizing web pages and YouTube videos, and checking the completeness of research. A large \n",
"language model \u001b[1m(\u001b[0mLLM\u001b[1m)\u001b[0m is used for several tasks, including response generation and summarization. The \n",
"`model_config.py` file is assumed to contain configurations for the LLM and embedding models. The application uses\n",
"a SearxNG docker container for web searches \u001b[1m(\u001b[0massumed to be started automatically if not already running\u001b[1m)\u001b[0m. The \n",
"`utils/map.py` module uses the Overpass and Nominatim APIs for POI retrieval and geocoding, and the OSRM API for \n",
"route calculation. The map is generated using Folium and saved as an HTML file.\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# you can even do search/summary within local files\n",
"\n",
"# or multiple pages\n",
"detailed_report = await query_web_response(\n",
" \"Read the code file and for each explain me what it does in concise manner, 2 lines max for each\",\n",
" '27-06-2025',\n",
" 'Friday',\n",
" searcher,\n",
" hf_embeddings,\n",
" True,\n",
" cross_encoder,\n",
" llmgoogle,\n",
" text_model=llmgoogle,\n",
" num_results=3,\n",
" document_paths=['utils/map.py','app.py'],\n",
" local_mode=True,\n",
" split=False\n",
")\n",
"print(detailed_report[0])"
]
},
{
"cell_type": "markdown",
"id": "3c1b7c9e",
"metadata": {},
"source": [
"The next cell demonstrates how to summarize Reddit posts and comments from the \"OpenAI\" subreddit using the `reddit_reader_response` function. It retrieves the top 2 \"hot\" posts and summarizes their content with the help of the `llmgoogle` generative model. This is useful for quickly extracting key insights from Reddit discussions."
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "72ef9873",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Fetching posts from /r/OpenAI\n", "\n" ], "text/plain": [ "Fetching posts from \u001b[35m/r/\u001b[0m\u001b[95mOpenAI\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Fetching comments for post: Agent casually clicking the \"I am not a robot\" button\n",
"\n"
],
"text/plain": [
"Fetching comments for post: Agent casually clicking the \u001b[32m\"I am not a robot\"\u001b[0m button\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Fetching comments for post: Offering researchers $1 billion is not normal\n",
"\n"
],
"text/plain": [
"Fetching comments for post: Offering researchers $\u001b[1;36m1\u001b[0m billion is not normal\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"This Reddit summary covers two separate posts from r/OpenAI. Neither post contains substantial discussion; the \n",
"comments are brief and offer limited elaboration on the post titles.\n",
"\n",
"The first post, titled \"Agent casually clicking the 'I am not a robot' button\" \n",
"(https://www.reddit.com/r/OpenAI/comments/1m9c15h/agent_casually_clicking_the_i_am_not_a_robot/), received a score\n",
"of 2502. The post itself contains no text. The comments are limited to: \"That’s hilarious\" and \"\"This step is \n",
"necessary to prove I'm not a bot\"\". These comments are humorous observations on the irony of an AI agent \n",
"performing a CAPTCHA designed to prevent automated actions.\n",
"\n",
"The second post, \"Offering researchers $1 billion is not normal\" \n",
"(https://www.reddit.com/r/OpenAI/comments/1m9pgjo/offering_researchers_1_billion_is_not_normal/), scored 1180. \n",
"This post also lacks substantive text. The comments speculate on the motivations behind such large offers. One \n",
"comment expresses skepticism about Mark Zuckerberg's judgment, citing his metaverse investments as an example of \n",
"poor decision-making. Another comment suggests that mega-wealthy individuals might believe they are the only ones \n",
"capable of guiding AI development towards \"recursive self-improvement,\" implying a belief in the necessity of their\n",
"involvement in directing AI's future. Neither comment provides concrete evidence to support their claims.\n",
"\n"
],
"text/plain": [
"This Reddit summary covers two separate posts from r/OpenAI. Neither post contains substantial discussion; the \n",
"comments are brief and offer limited elaboration on the post titles.\n",
"\n",
"The first post, titled \u001b[32m\"Agent casually clicking the 'I am not a robot' button\"\u001b[0m \n",
"\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.reddit.com/r/OpenAI/comments/1m9c15h/agent_casually_clicking_the_i_am_not_a_robot/\u001b[0m\u001b[4;94m)\u001b[0m\u001b[4;94m,\u001b[0m received a score\n",
"of \u001b[1;36m2502\u001b[0m. The post itself contains no text. The comments are limited to: \u001b[32m\"That’s hilarious\"\u001b[0m and \u001b[32m\"\"\u001b[0mThis step is \n",
"necessary to prove I'm not a bot\"\". These comments are humorous observations on the irony of an AI agent \n",
"performing a CAPTCHA designed to prevent automated actions.\n",
"\n",
"The second post, \u001b[32m\"Offering researchers $1 billion is not normal\"\u001b[0m \n",
"\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.reddit.com/r/OpenAI/comments/1m9pgjo/offering_researchers_1_billion_is_not_normal/\u001b[0m\u001b[4;94m)\u001b[0m\u001b[4;94m,\u001b[0m scored \u001b[1;36m1180\u001b[0m. \n",
"This post also lacks substantive text. The comments speculate on the motivations behind such large offers. One \n",
"comment expresses skepticism about Mark Zuckerberg's judgment, citing his metaverse investments as an example of \n",
"poor decision-making. Another comment suggests that mega-wealthy individuals might believe they are the only ones \n",
"capable of guiding AI development towards \u001b[32m\"recursive self-improvement,\"\u001b[0m implying a belief in the necessity of their\n",
"involvement in directing AI's future. Neither comment provides concrete evidence to support their claims.\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from utils.reddit_utils import *\n",
"summary = reddit_reader_response(\n",
" subreddit=\"OpenAI\",\n",
" url_type=\"hot\",\n",
" n=2,\n",
" k=2,\n",
" custom_url=None,\n",
" time_filter=\"today\",\n",
" search_query=None,\n",
" sort_type=\"hot\",\n",
" model=llmgoogle\n",
")\n",
"print(summary)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "795ed716",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Fetching posts from search search\n",
"\n"
],
"text/plain": [
"Fetching posts from search search\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Fetching comments for post: Is there a way to use qwen 3 coder inside vs code or cursor\n",
"\n"
],
"text/plain": [
"Fetching comments for post: Is there a way to use qwen \u001b[1;36m3\u001b[0m coder inside vs code or cursor\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Fetching comments for post: Kimi K2 vs Qwen 3 Coder - Coding Tests\n",
"\n"
],
"text/plain": [
"Fetching comments for post: Kimi K2 vs Qwen \u001b[1;36m3\u001b[0m Coder - Coding Tests\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"This Reddit summary focuses on user reviews of the Qwen 3 Coder large language model (LLM), specifically concerning\n", "its use in coding contexts within VS Code and other IDEs.\n", "\n", "**Reddit Post 1: \n", "(https://www.reddit.com/r/LocalLLaMA/comments/1m79sp9/is_there_a_way_to_use_qwen_3_coder_inside_vs_code/)**\n", "\n", "This post asks about integrating Qwen 3 Coder into VS Code or Cursor. The comments suggest using extensions that \n", "support OpenAI-compatible APIs. Specifically, Roocode for VS Code is mentioned as an option that can connect to \n", "local models or OpenRouter.\n", "\n", "**Reddit Post 2: (https://www.reddit.com/r/ChatGPTCoding/comments/1m7myxo/kimi_k2_vs_qwen_3_coder_coding_tests/)**\n", "\n", "This post compares Qwen 3 Coder to Kimi K2 in coding tasks across various IDEs (VSCode, Cline, Roo Code, Windsurf).\n", "The author conducted tests and provides the following observations:\n", "\n", "* **Overall Performance:** Kimi K2 performed better overall in the author's tests. The author notes that Kimi K2 \n", "felt comparable to Sonnet 4 in many aspects.\n", "\n", "* **Tool Calling:** Qwen 3 Coder exhibited near-flawless tool calling within VSCode, while Kimi K2 struggled with \n", "this functionality, similar to Gemini 2.5 Pro. However, Qwen 3 Coder also performed well with Roo Code's tool \n", "calls.\n", "\n", "* **Instruction Following:** Kimi K2 demonstrated superior instruction following compared to Qwen 3 Coder.\n", "\n", "* **Cost:** Qwen 3 Coder proved significantly more expensive, particularly when using Alibaba as the inference \n", "provider (up to $60 per million tokens). Switching to other providers within OpenRouter reduced the cost. Kimi K2 \n", "was approximately half the price of Qwen 3 Coder.\n", "\n", "* **Safety:** The author warns about potential safety issues with Kimi K2 in Windsurf, noting that it deleted a \n", "development database in Azure after receiving a dangerous command. The author recommends denying dangerous \n", "commands in Windsurf's settings.\n", "\n", "* **Video:** A video demonstrating one of the tests is linked: (https://youtu.be/ljCO7RyqCMY). This video likely \n", "provides further visual detail on the comparative performance of the two models.\n", "\n", "\n", "In summary, while Qwen 3 Coder shows promise in its tool-calling capabilities within certain IDEs, Kimi K2 appears \n", "to outperform it in overall performance and instruction following, at a significantly lower cost. However, safety \n", "concerns regarding dangerous command execution were raised for Kimi K2. The cost of using Qwen 3 Coder is heavily \n", "dependent on the chosen inference provider.\n", "\n" ], "text/plain": [ "This Reddit summary focuses on user reviews of the Qwen \u001b[1;36m3\u001b[0m Coder large language model \u001b[1m(\u001b[0mLLM\u001b[1m)\u001b[0m, specifically concerning\n", "its use in coding contexts within VS Code and other IDEs.\n", "\n", "**Reddit Post \u001b[1;36m1\u001b[0m: \n", "\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.reddit.com/r/LocalLLaMA/comments/1m79sp9/is_there_a_way_to_use_qwen_3_coder_inside_vs_code/\u001b[0m\u001b[4;94m)\u001b[0m**\n", "\n", "This post asks about integrating Qwen \u001b[1;36m3\u001b[0m Coder into VS Code or Cursor. The comments suggest using extensions that \n", "support OpenAI-compatible APIs. Specifically, Roocode for VS Code is mentioned as an option that can connect to \n", "local models or OpenRouter.\n", "\n", "**Reddit Post \u001b[1;36m2\u001b[0m: \u001b[1m(\u001b[0m\u001b[4;94mhttps://www.reddit.com/r/ChatGPTCoding/comments/1m7myxo/kimi_k2_vs_qwen_3_coder_coding_tests/\u001b[0m\u001b[4;94m)\u001b[0m**\n", "\n", "This post compares Qwen \u001b[1;36m3\u001b[0m Coder to Kimi K2 in coding tasks across various IDEs \u001b[1m(\u001b[0mVSCode, Cline, Roo Code, Windsurf\u001b[1m)\u001b[0m.\n", "The author conducted tests and provides the following observations:\n", "\n", "* **Overall Performance:** Kimi K2 performed better overall in the author's tests. The author notes that Kimi K2 \n", "felt comparable to Sonnet \u001b[1;36m4\u001b[0m in many aspects.\n", "\n", "* **Tool Calling:** Qwen \u001b[1;36m3\u001b[0m Coder exhibited near-flawless tool calling within VSCode, while Kimi K2 struggled with \n", "this functionality, similar to Gemini \u001b[1;36m2.5\u001b[0m Pro. However, Qwen \u001b[1;36m3\u001b[0m Coder also performed well with Roo Code's tool \n", "calls.\n", "\n", "* **Instruction Following:** Kimi K2 demonstrated superior instruction following compared to Qwen \u001b[1;36m3\u001b[0m Coder.\n", "\n", "* **Cost:** Qwen \u001b[1;36m3\u001b[0m Coder proved significantly more expensive, particularly when using Alibaba as the inference \n", "provider \u001b[1m(\u001b[0mup to $\u001b[1;36m60\u001b[0m per million tokens\u001b[1m)\u001b[0m. Switching to other providers within OpenRouter reduced the cost. Kimi K2 \n", "was approximately half the price of Qwen \u001b[1;36m3\u001b[0m Coder.\n", "\n", "* **Safety:** The author warns about potential safety issues with Kimi K2 in Windsurf, noting that it deleted a \n", "development database in Azure after receiving a dangerous command. The author recommends denying dangerous \n", "commands in Windsurf's settings.\n", "\n", "* **Video:** A video demonstrating one of the tests is linked: \u001b[1m(\u001b[0m\u001b[4;94mhttps://youtu.be/ljCO7RyqCMY\u001b[0m\u001b[4;94m)\u001b[0m\u001b[4;94m.\u001b[0m This video likely \n", "provides further visual detail on the comparative performance of the two models.\n", "\n", "\n", "In summary, while Qwen \u001b[1;36m3\u001b[0m Coder shows promise in its tool-calling capabilities within certain IDEs, Kimi K2 appears \n", "to outperform it in overall performance and instruction following, at a significantly lower cost. However, safety \n", "concerns regarding dangerous command execution were raised for Kimi K2. The cost of using Qwen \u001b[1;36m3\u001b[0m Coder is heavily \n", "dependent on the chosen inference provider.\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from utils.reddit_utils import *\n", "summary = reddit_reader_response(\n", " subreddit=\"\",\n", " url_type=\"search\",\n", " n=2,\n", " k=2,\n", " custom_url=None,\n", " time_filter=\"today\",\n", " search_query=\"Qwen 3 coder reviews\",\n", " sort_type=\"hot\",\n", " model=llmgoogle\n", ")\n", "print(summary)" ] }, { "cell_type": "code", "execution_count": null, "id": "8b330d75", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "f286a26f", "metadata": {}, "source": [ "# 🎙️ Now you can create Podcast from any text" ] }, { "cell_type": "code", "execution_count": 3, "id": "40ac2dff-7452-4a28-a91c-f444168fa1ab", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[2025-09-01 01:32:43,695] WARNING phonemizer: words count mismatch on 100.0% of the lines (1/1)\n" ] }, { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "
Configure your AI settings securely
127.0.0.1, try using host.docker.internal as the host inside the config (e.g. http://host.docker.internal:1234).