Spaces:
Sleeping
Sleeping
File size: 67,759 Bytes
1f14da1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 | {
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Run"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"hello\n"
]
}
],
"source": [
"print(\"hello\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: langchain_community in e:\\sethu\\server\\.venv\\lib\\site-packages (0.4.1)\n",
"Requirement already satisfied: langchain in e:\\sethu\\server\\.venv\\lib\\site-packages (1.1.3)\n",
"Requirement already satisfied: langchain-core<2.0.0,>=1.0.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (1.2.0)\n",
"Requirement already satisfied: langchain-classic<2.0.0,>=1.0.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (1.0.0)\n",
"Requirement already satisfied: SQLAlchemy<3.0.0,>=1.4.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (2.0.45)\n",
"Requirement already satisfied: requests<3.0.0,>=2.32.5 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (2.32.5)\n",
"Requirement already satisfied: PyYAML<7.0.0,>=5.3.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (6.0.3)\n",
"Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (3.13.2)\n",
"Requirement already satisfied: tenacity!=8.4.0,<10.0.0,>=8.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (9.1.2)\n",
"Requirement already satisfied: dataclasses-json<0.7.0,>=0.6.7 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (0.6.7)\n",
"Requirement already satisfied: pydantic-settings<3.0.0,>=2.10.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (2.12.0)\n",
"Requirement already satisfied: langsmith<1.0.0,>=0.1.125 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (0.4.59)\n",
"Requirement already satisfied: httpx-sse<1.0.0,>=0.4.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (0.4.3)\n",
"Requirement already satisfied: numpy>=2.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain_community) (2.3.5)\n",
"Requirement already satisfied: aiohappyeyeballs>=2.5.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (2.6.1)\n",
"Requirement already satisfied: aiosignal>=1.4.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (1.4.0)\n",
"Requirement already satisfied: attrs>=17.3.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (25.4.0)\n",
"Requirement already satisfied: frozenlist>=1.1.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (1.8.0)\n",
"Requirement already satisfied: multidict<7.0,>=4.5 in e:\\sethu\\server\\.venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (6.7.0)\n",
"Requirement already satisfied: propcache>=0.2.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (0.4.1)\n",
"Requirement already satisfied: yarl<2.0,>=1.17.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (1.22.0)\n",
"Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from dataclasses-json<0.7.0,>=0.6.7->langchain_community) (3.26.1)\n",
"Requirement already satisfied: typing-inspect<1,>=0.4.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from dataclasses-json<0.7.0,>=0.6.7->langchain_community) (0.9.0)\n",
"Requirement already satisfied: langchain-text-splitters<2.0.0,>=1.0.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-classic<2.0.0,>=1.0.0->langchain_community) (1.0.0)\n",
"Requirement already satisfied: pydantic<3.0.0,>=2.7.4 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-classic<2.0.0,>=1.0.0->langchain_community) (2.12.5)\n",
"Requirement already satisfied: jsonpatch<2.0.0,>=1.33.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.1->langchain_community) (1.33)\n",
"Requirement already satisfied: packaging<26.0.0,>=23.2.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.1->langchain_community) (25.0)\n",
"Requirement already satisfied: typing-extensions<5.0.0,>=4.7.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.1->langchain_community) (4.15.0)\n",
"Requirement already satisfied: uuid-utils<1.0,>=0.12.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.1->langchain_community) (0.12.0)\n",
"Requirement already satisfied: jsonpointer>=1.9 in e:\\sethu\\server\\.venv\\lib\\site-packages (from jsonpatch<2.0.0,>=1.33.0->langchain-core<2.0.0,>=1.0.1->langchain_community) (3.0.0)\n",
"Requirement already satisfied: httpx<1,>=0.23.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.1.125->langchain_community) (0.28.1)\n",
"Requirement already satisfied: orjson>=3.9.14 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.1.125->langchain_community) (3.11.5)\n",
"Requirement already satisfied: requests-toolbelt>=1.0.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.1.125->langchain_community) (1.0.0)\n",
"Requirement already satisfied: zstandard>=0.23.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.1.125->langchain_community) (0.25.0)\n",
"Requirement already satisfied: anyio in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.1.125->langchain_community) (4.12.0)\n",
"Requirement already satisfied: certifi in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.1.125->langchain_community) (2025.11.12)\n",
"Requirement already satisfied: httpcore==1.* in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.1.125->langchain_community) (1.0.9)\n",
"Requirement already satisfied: idna in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.1.125->langchain_community) (3.11)\n",
"Requirement already satisfied: h11>=0.16 in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpcore==1.*->httpx<1,>=0.23.0->langsmith<1.0.0,>=0.1.125->langchain_community) (0.16.0)\n",
"Requirement already satisfied: annotated-types>=0.6.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3.0.0,>=2.7.4->langchain-classic<2.0.0,>=1.0.0->langchain_community) (0.7.0)\n",
"Requirement already satisfied: pydantic-core==2.41.5 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3.0.0,>=2.7.4->langchain-classic<2.0.0,>=1.0.0->langchain_community) (2.41.5)\n",
"Requirement already satisfied: typing-inspection>=0.4.2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3.0.0,>=2.7.4->langchain-classic<2.0.0,>=1.0.0->langchain_community) (0.4.2)\n",
"Requirement already satisfied: python-dotenv>=0.21.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic-settings<3.0.0,>=2.10.1->langchain_community) (1.2.1)\n",
"Requirement already satisfied: charset_normalizer<4,>=2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from requests<3.0.0,>=2.32.5->langchain_community) (3.4.4)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from requests<3.0.0,>=2.32.5->langchain_community) (2.6.2)\n",
"Requirement already satisfied: greenlet>=1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from SQLAlchemy<3.0.0,>=1.4.0->langchain_community) (3.3.0)\n",
"Requirement already satisfied: mypy-extensions>=0.3.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7.0,>=0.6.7->langchain_community) (1.1.0)\n",
"Requirement already satisfied: langgraph<1.1.0,>=1.0.2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain) (1.0.5)\n",
"Requirement already satisfied: langgraph-checkpoint<4.0.0,>=2.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langgraph<1.1.0,>=1.0.2->langchain) (3.0.1)\n",
"Requirement already satisfied: langgraph-prebuilt<1.1.0,>=1.0.2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langgraph<1.1.0,>=1.0.2->langchain) (1.0.5)\n",
"Requirement already satisfied: langgraph-sdk<0.4.0,>=0.3.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langgraph<1.1.0,>=1.0.2->langchain) (0.3.0)\n",
"Requirement already satisfied: xxhash>=3.5.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langgraph<1.1.0,>=1.0.2->langchain) (3.6.0)\n",
"Requirement already satisfied: ormsgpack>=1.12.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langgraph-checkpoint<4.0.0,>=2.1.0->langgraph<1.1.0,>=1.0.2->langchain) (1.12.0)\n"
]
}
],
"source": [
"!pip install langchain_community langchain"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: pypdf in e:\\sethu\\server\\.venv\\lib\\site-packages (6.4.1)\n"
]
}
],
"source": [
"!pip install pypdf"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: langchain-huggingface in e:\\sethu\\server\\.venv\\lib\\site-packages (1.2.0)\n",
"Requirement already satisfied: sentence-transformers in e:\\sethu\\server\\.venv\\lib\\site-packages (5.2.0)\n",
"Requirement already satisfied: tf-keras in e:\\sethu\\server\\.venv\\lib\\site-packages (2.15.0)\n",
"Requirement already satisfied: huggingface-hub<1.0.0,>=0.33.4 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-huggingface) (0.36.0)\n",
"Requirement already satisfied: langchain-core<2.0.0,>=1.2.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-huggingface) (1.2.0)\n",
"Requirement already satisfied: tokenizers<1.0.0,>=0.19.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-huggingface) (0.22.1)\n",
"Requirement already satisfied: filelock in e:\\sethu\\server\\.venv\\lib\\site-packages (from huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (3.20.0)\n",
"Requirement already satisfied: fsspec>=2023.5.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (2025.12.0)\n",
"Requirement already satisfied: packaging>=20.9 in e:\\sethu\\server\\.venv\\lib\\site-packages (from huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (25.0)\n",
"Requirement already satisfied: pyyaml>=5.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (6.0.3)\n",
"Requirement already satisfied: requests in e:\\sethu\\server\\.venv\\lib\\site-packages (from huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (2.32.5)\n",
"Requirement already satisfied: tqdm>=4.42.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (4.67.1)\n",
"Requirement already satisfied: typing-extensions>=3.7.4.3 in e:\\sethu\\server\\.venv\\lib\\site-packages (from huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (4.15.0)\n",
"Requirement already satisfied: jsonpatch<2.0.0,>=1.33.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (1.33)\n",
"Requirement already satisfied: langsmith<1.0.0,>=0.3.45 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (0.4.59)\n",
"Requirement already satisfied: pydantic<3.0.0,>=2.7.4 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (2.12.5)\n",
"Requirement already satisfied: tenacity!=8.4.0,<10.0.0,>=8.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (9.1.2)\n",
"Requirement already satisfied: uuid-utils<1.0,>=0.12.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (0.12.0)\n",
"Requirement already satisfied: jsonpointer>=1.9 in e:\\sethu\\server\\.venv\\lib\\site-packages (from jsonpatch<2.0.0,>=1.33.0->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (3.0.0)\n",
"Requirement already satisfied: httpx<1,>=0.23.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (0.28.1)\n",
"Requirement already satisfied: orjson>=3.9.14 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (3.11.5)\n",
"Requirement already satisfied: requests-toolbelt>=1.0.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (1.0.0)\n",
"Requirement already satisfied: zstandard>=0.23.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (0.25.0)\n",
"Requirement already satisfied: anyio in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (4.12.0)\n",
"Requirement already satisfied: certifi in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (2025.11.12)\n",
"Requirement already satisfied: httpcore==1.* in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (1.0.9)\n",
"Requirement already satisfied: idna in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (3.11)\n",
"Requirement already satisfied: h11>=0.16 in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpcore==1.*->httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (0.16.0)\n",
"Requirement already satisfied: annotated-types>=0.6.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3.0.0,>=2.7.4->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (0.7.0)\n",
"Requirement already satisfied: pydantic-core==2.41.5 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3.0.0,>=2.7.4->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (2.41.5)\n",
"Requirement already satisfied: typing-inspection>=0.4.2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3.0.0,>=2.7.4->langchain-core<2.0.0,>=1.2.0->langchain-huggingface) (0.4.2)\n",
"Requirement already satisfied: transformers<6.0.0,>=4.41.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from sentence-transformers) (4.57.3)\n",
"Requirement already satisfied: torch>=1.11.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from sentence-transformers) (2.9.1)\n",
"Requirement already satisfied: scikit-learn in e:\\sethu\\server\\.venv\\lib\\site-packages (from sentence-transformers) (1.8.0)\n",
"Requirement already satisfied: scipy in e:\\sethu\\server\\.venv\\lib\\site-packages (from sentence-transformers) (1.16.3)\n",
"Requirement already satisfied: numpy>=1.17 in e:\\sethu\\server\\.venv\\lib\\site-packages (from transformers<6.0.0,>=4.41.0->sentence-transformers) (2.3.5)\n",
"Requirement already satisfied: regex!=2019.12.17 in e:\\sethu\\server\\.venv\\lib\\site-packages (from transformers<6.0.0,>=4.41.0->sentence-transformers) (2025.11.3)\n",
"Requirement already satisfied: safetensors>=0.4.3 in e:\\sethu\\server\\.venv\\lib\\site-packages (from transformers<6.0.0,>=4.41.0->sentence-transformers) (0.7.0)\n",
"Requirement already satisfied: charset_normalizer<4,>=2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from requests->huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (3.4.4)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from requests->huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (2.6.2)\n",
"Requirement already satisfied: sympy>=1.13.3 in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch>=1.11.0->sentence-transformers) (1.14.0)\n",
"Requirement already satisfied: networkx>=2.5.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch>=1.11.0->sentence-transformers) (3.6.1)\n",
"Requirement already satisfied: jinja2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch>=1.11.0->sentence-transformers) (3.1.6)\n",
"Requirement already satisfied: setuptools in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch>=1.11.0->sentence-transformers) (80.9.0)\n",
"Requirement already satisfied: mpmath<1.4,>=1.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from sympy>=1.13.3->torch>=1.11.0->sentence-transformers) (1.3.0)\n",
"Requirement already satisfied: colorama in e:\\sethu\\server\\.venv\\lib\\site-packages (from tqdm>=4.42.1->huggingface-hub<1.0.0,>=0.33.4->langchain-huggingface) (0.4.6)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from jinja2->torch>=1.11.0->sentence-transformers) (3.0.3)\n",
"Requirement already satisfied: joblib>=1.3.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from scikit-learn->sentence-transformers) (1.5.2)\n",
"Requirement already satisfied: threadpoolctl>=3.2.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from scikit-learn->sentence-transformers) (3.6.0)\n"
]
}
],
"source": [
"!pip install langchain-huggingface sentence-transformers tf-keras"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: pip in e:\\sethu\\server\\.venv\\lib\\site-packages (25.3)\n",
"Requirement already satisfied: setuptools in e:\\sethu\\server\\.venv\\lib\\site-packages (80.9.0)\n",
"Requirement already satisfied: wheel in e:\\sethu\\server\\.venv\\lib\\site-packages (0.45.1)\n"
]
}
],
"source": [
"!pip install --upgrade pip setuptools wheel"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
" error: subprocess-exited-with-error\n",
" \n",
" × Preparing metadata (pyproject.toml) did not run successfully.\n",
" │ exit code: 1\n",
" ╰─> [21 lines of output]\n",
" + E:\\Sethu\\server\\.venv\\Scripts\\python.exe C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-kadb7ou_\\numpy_7dc8dc27f6d24a66bbea55a3e557354c\\vendored-meson\\meson\\meson.py setup C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-kadb7ou_\\numpy_7dc8dc27f6d24a66bbea55a3e557354c C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-kadb7ou_\\numpy_7dc8dc27f6d24a66bbea55a3e557354c\\.mesonpy-rwuwf6md -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-kadb7ou_\\numpy_7dc8dc27f6d24a66bbea55a3e557354c\\.mesonpy-rwuwf6md\\meson-python-native-file.ini\n",
" The Meson build system\n",
" Version: 1.2.99\n",
" Source dir: C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-kadb7ou_\\numpy_7dc8dc27f6d24a66bbea55a3e557354c\n",
" Build dir: C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-kadb7ou_\\numpy_7dc8dc27f6d24a66bbea55a3e557354c\\.mesonpy-rwuwf6md\n",
" Build type: native build\n",
" Project name: NumPy\n",
" Project version: 1.26.4\n",
" WARNING: Failed to activate VS environment: Could not find C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe\n",
" \n",
" ..\\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]\n",
" The following exception(s) were encountered:\n",
" Running `icl \"\"` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `cl /?` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `cc --version` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `gcc --version` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `clang --version` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `clang-cl /?` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `pgcc --version` gave \"[WinError 2] The system cannot find the file specified\"\n",
" \n",
" A full log can be found at C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-kadb7ou_\\numpy_7dc8dc27f6d24a66bbea55a3e557354c\\.mesonpy-rwuwf6md\\meson-logs\\meson-log.txt\n",
" [end of output]\n",
" \n",
" note: This error originates from a subprocess, and is likely not a problem with pip.\n",
"error: metadata-generation-failed\n",
"\n",
"× Encountered error while generating package metadata.\n",
"╰─> numpy\n",
"\n",
"note: This is an issue with the package mentioned above, not pip.\n",
"hint: See above for details.\n"
]
}
],
"source": [
"!pip install -qU \"langchain-chroma>=0.1.2\""
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: langchain-groq in e:\\sethu\\server\\.venv\\lib\\site-packages (1.1.1)\n",
"Requirement already satisfied: groq<1.0.0,>=0.30.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-groq) (0.37.1)\n",
"Requirement already satisfied: langchain-core<2.0.0,>=1.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-groq) (1.2.0)\n",
"Requirement already satisfied: anyio<5,>=3.5.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from groq<1.0.0,>=0.30.0->langchain-groq) (4.12.0)\n",
"Requirement already satisfied: distro<2,>=1.7.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from groq<1.0.0,>=0.30.0->langchain-groq) (1.9.0)\n",
"Requirement already satisfied: httpx<1,>=0.23.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from groq<1.0.0,>=0.30.0->langchain-groq) (0.28.1)\n",
"Requirement already satisfied: pydantic<3,>=1.9.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from groq<1.0.0,>=0.30.0->langchain-groq) (2.12.5)\n",
"Requirement already satisfied: sniffio in e:\\sethu\\server\\.venv\\lib\\site-packages (from groq<1.0.0,>=0.30.0->langchain-groq) (1.3.1)\n",
"Requirement already satisfied: typing-extensions<5,>=4.10 in e:\\sethu\\server\\.venv\\lib\\site-packages (from groq<1.0.0,>=0.30.0->langchain-groq) (4.15.0)\n",
"Requirement already satisfied: idna>=2.8 in e:\\sethu\\server\\.venv\\lib\\site-packages (from anyio<5,>=3.5.0->groq<1.0.0,>=0.30.0->langchain-groq) (3.11)\n",
"Requirement already satisfied: certifi in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->groq<1.0.0,>=0.30.0->langchain-groq) (2025.11.12)\n",
"Requirement already satisfied: httpcore==1.* in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->groq<1.0.0,>=0.30.0->langchain-groq) (1.0.9)\n",
"Requirement already satisfied: h11>=0.16 in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpcore==1.*->httpx<1,>=0.23.0->groq<1.0.0,>=0.30.0->langchain-groq) (0.16.0)\n",
"Requirement already satisfied: jsonpatch<2.0.0,>=1.33.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.1.0->langchain-groq) (1.33)\n",
"Requirement already satisfied: langsmith<1.0.0,>=0.3.45 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.1.0->langchain-groq) (0.4.59)\n",
"Requirement already satisfied: packaging<26.0.0,>=23.2.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.1.0->langchain-groq) (25.0)\n",
"Requirement already satisfied: pyyaml<7.0.0,>=5.3.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.1.0->langchain-groq) (6.0.3)\n",
"Requirement already satisfied: tenacity!=8.4.0,<10.0.0,>=8.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.1.0->langchain-groq) (9.1.2)\n",
"Requirement already satisfied: uuid-utils<1.0,>=0.12.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.1.0->langchain-groq) (0.12.0)\n",
"Requirement already satisfied: jsonpointer>=1.9 in e:\\sethu\\server\\.venv\\lib\\site-packages (from jsonpatch<2.0.0,>=1.33.0->langchain-core<2.0.0,>=1.1.0->langchain-groq) (3.0.0)\n",
"Requirement already satisfied: orjson>=3.9.14 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.1.0->langchain-groq) (3.11.5)\n",
"Requirement already satisfied: requests-toolbelt>=1.0.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.1.0->langchain-groq) (1.0.0)\n",
"Requirement already satisfied: requests>=2.0.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.1.0->langchain-groq) (2.32.5)\n",
"Requirement already satisfied: zstandard>=0.23.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.1.0->langchain-groq) (0.25.0)\n",
"Requirement already satisfied: annotated-types>=0.6.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3,>=1.9.0->groq<1.0.0,>=0.30.0->langchain-groq) (0.7.0)\n",
"Requirement already satisfied: pydantic-core==2.41.5 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3,>=1.9.0->groq<1.0.0,>=0.30.0->langchain-groq) (2.41.5)\n",
"Requirement already satisfied: typing-inspection>=0.4.2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3,>=1.9.0->groq<1.0.0,>=0.30.0->langchain-groq) (0.4.2)\n",
"Requirement already satisfied: charset_normalizer<4,>=2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from requests>=2.0.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.1.0->langchain-groq) (3.4.4)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from requests>=2.0.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.1.0->langchain-groq) (2.6.2)\n"
]
}
],
"source": [
"!pip install langchain-groq"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"!pip install -qU langchain-community faiss-cpu"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: torch in e:\\sethu\\server\\.venv\\lib\\site-packages (2.9.1)\n",
"Requirement already satisfied: torchvision in e:\\sethu\\server\\.venv\\lib\\site-packages (0.24.1)\n",
"Requirement already satisfied: torchaudio in e:\\sethu\\server\\.venv\\lib\\site-packages (2.9.1)\n",
"Requirement already satisfied: filelock in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch) (3.20.0)\n",
"Requirement already satisfied: typing-extensions>=4.10.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch) (4.15.0)\n",
"Requirement already satisfied: sympy>=1.13.3 in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch) (1.14.0)\n",
"Requirement already satisfied: networkx>=2.5.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch) (3.6.1)\n",
"Requirement already satisfied: jinja2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch) (3.1.6)\n",
"Requirement already satisfied: fsspec>=0.8.5 in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch) (2025.12.0)\n",
"Requirement already satisfied: setuptools in e:\\sethu\\server\\.venv\\lib\\site-packages (from torch) (80.9.0)\n",
"Requirement already satisfied: numpy in e:\\sethu\\server\\.venv\\lib\\site-packages (from torchvision) (2.3.5)\n",
"Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from torchvision) (12.0.0)\n",
"Requirement already satisfied: mpmath<1.4,>=1.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from sympy>=1.13.3->torch) (1.3.0)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from jinja2->torch) (3.0.3)\n"
]
}
],
"source": [
"!pip install torch torchvision torchaudio\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting langchain-chroma\n",
" Using cached langchain_chroma-1.1.0-py3-none-any.whl.metadata (1.9 kB)\n",
"Requirement already satisfied: langchain-groq in e:\\sethu\\server\\.venv\\lib\\site-packages (1.1.1)\n",
"Collecting chromadb<2.0.0,>=1.3.5 (from langchain-chroma)\n",
" Using cached chromadb-1.3.7-cp39-abi3-win_amd64.whl.metadata (7.3 kB)\n",
"Requirement already satisfied: langchain-core<2.0.0,>=1.1.3 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-chroma) (1.2.0)\n",
"Requirement already satisfied: numpy>=2.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-chroma) (2.3.5)\n",
"Collecting build>=1.0.3 (from chromadb<2.0.0,>=1.3.5->langchain-chroma)\n",
" Using cached build-1.3.0-py3-none-any.whl.metadata (5.6 kB)\n",
"Requirement already satisfied: pydantic>=1.9 in e:\\sethu\\server\\.venv\\lib\\site-packages (from chromadb<2.0.0,>=1.3.5->langchain-chroma) (2.12.5)\n",
"Collecting pybase64>=1.4.1 (from chromadb<2.0.0,>=1.3.5->langchain-chroma)\n",
" Using cached pybase64-1.4.3-cp314-cp314-win_amd64.whl.metadata (9.1 kB)\n",
"Collecting uvicorn>=0.18.3 (from uvicorn[standard]>=0.18.3->chromadb<2.0.0,>=1.3.5->langchain-chroma)\n",
" Using cached uvicorn-0.38.0-py3-none-any.whl.metadata (6.8 kB)\n",
"Collecting posthog<6.0.0,>=2.4.0 (from chromadb<2.0.0,>=1.3.5->langchain-chroma)\n",
" Using cached posthog-5.4.0-py3-none-any.whl.metadata (5.7 kB)\n",
"Requirement already satisfied: typing-extensions>=4.5.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from chromadb<2.0.0,>=1.3.5->langchain-chroma) (4.15.0)\n",
"INFO: pip is looking at multiple versions of chromadb to determine which version is compatible with other requirements. This could take a while.\n",
"Collecting chromadb<2.0.0,>=1.3.5 (from langchain-chroma)\n",
" Using cached chromadb-1.3.6-cp39-abi3-win_amd64.whl.metadata (7.3 kB)\n",
" Using cached chromadb-1.3.5-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
"Collecting langchain-chroma\n",
" Using cached langchain_chroma-1.0.0-py3-none-any.whl.metadata (1.9 kB)\n",
"Collecting chromadb<2.0.0,>=1.0.20 (from langchain-chroma)\n",
" Using cached chromadb-1.3.4-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.3.3-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
"INFO: pip is still looking at multiple versions of chromadb to determine which version is compatible with other requirements. This could take a while.\n",
" Using cached chromadb-1.3.2-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.3.0-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.2.2-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.2.1-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.2.0-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
"INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.\n",
" Using cached chromadb-1.1.1-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.1.0-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.0.21-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.0.20-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
"Collecting langchain-chroma\n",
" Using cached langchain_chroma-0.2.6-py3-none-any.whl.metadata (1.1 kB)\n",
" Using cached langchain_chroma-0.2.5-py3-none-any.whl.metadata (1.1 kB)\n",
"Collecting chromadb>=1.0.9 (from langchain-chroma)\n",
" Using cached chromadb-1.0.19-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.0.18-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.0.17-cp39-abi3-win_amd64.whl.metadata (7.4 kB)\n",
" Using cached chromadb-1.0.16-cp39-abi3-win_amd64.whl.metadata (7.5 kB)\n",
" Using cached chromadb-1.0.15-cp39-abi3-win_amd64.whl.metadata (7.1 kB)\n",
" Using cached chromadb-1.0.13-cp39-abi3-win_amd64.whl.metadata (7.1 kB)\n",
"Collecting posthog>=2.4.0 (from chromadb>=1.0.9->langchain-chroma)\n",
" Using cached posthog-7.0.1-py3-none-any.whl.metadata (6.0 kB)\n",
"Collecting chromadb>=1.0.9 (from langchain-chroma)\n",
" Using cached chromadb-1.0.12-cp39-abi3-win_amd64.whl.metadata (7.0 kB)\n",
"Collecting fastapi==0.115.9 (from chromadb>=1.0.9->langchain-chroma)\n",
" Using cached fastapi-0.115.9-py3-none-any.whl.metadata (27 kB)\n",
"Collecting chromadb>=1.0.9 (from langchain-chroma)\n",
" Using cached chromadb-1.0.11-cp39-abi3-win_amd64.whl.metadata (7.0 kB)\n",
" Using cached chromadb-1.0.10-cp39-abi3-win_amd64.whl.metadata (7.0 kB)\n",
" Using cached chromadb-1.0.9-cp39-abi3-win_amd64.whl.metadata (7.0 kB)\n",
"Collecting langchain-chroma\n",
" Using cached langchain_chroma-0.2.4-py3-none-any.whl.metadata (1.1 kB)\n",
" Using cached langchain_chroma-0.2.3-py3-none-any.whl.metadata (1.1 kB)\n",
"Collecting chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0 (from langchain-chroma)\n",
" Using cached chromadb-0.6.3-py3-none-any.whl.metadata (6.8 kB)\n",
"Collecting chroma-hnswlib==0.7.6 (from chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0->langchain-chroma)\n",
" Using cached chroma_hnswlib-0.7.6.tar.gz (32 kB)\n",
" Installing build dependencies: started\n",
" Installing build dependencies: finished with status 'done'\n",
" Getting requirements to build wheel: started\n",
" Getting requirements to build wheel: finished with status 'done'\n",
" Preparing metadata (pyproject.toml): started\n",
" Preparing metadata (pyproject.toml): finished with status 'done'\n",
"Collecting fastapi>=0.95.2 (from chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0->langchain-chroma)\n",
" Using cached fastapi-0.124.4-py3-none-any.whl.metadata (30 kB)\n",
"Collecting chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0 (from langchain-chroma)\n",
" Using cached chromadb-0.6.2-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.6.1-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.6.0-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.23-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.21-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.20-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.18-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.17-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.16-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.15-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.13-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.3-py3-none-any.whl.metadata (6.8 kB)\n",
"Requirement already satisfied: requests>=2.28 in e:\\sethu\\server\\.venv\\lib\\site-packages (from chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0->langchain-chroma) (2.32.5)\n",
"Collecting chroma-hnswlib==0.7.3 (from chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0->langchain-chroma)\n",
" Using cached chroma-hnswlib-0.7.3.tar.gz (31 kB)\n",
" Installing build dependencies: started\n",
" Installing build dependencies: finished with status 'done'\n",
" Getting requirements to build wheel: started\n",
" Getting requirements to build wheel: finished with status 'done'\n",
" Preparing metadata (pyproject.toml): started\n",
" Preparing metadata (pyproject.toml): finished with status 'done'\n",
"Collecting chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0 (from langchain-chroma)\n",
" Using cached chromadb-0.5.2-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.1-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.5.0-py3-none-any.whl.metadata (7.3 kB)\n",
" Using cached chromadb-0.4.24-py3-none-any.whl.metadata (7.3 kB)\n",
" Using cached chromadb-0.4.23-py3-none-any.whl.metadata (7.3 kB)\n",
" Using cached chromadb-0.4.22-py3-none-any.whl.metadata (7.3 kB)\n",
" Using cached chromadb-0.4.21-py3-none-any.whl.metadata (7.3 kB)\n",
" Using cached chromadb-0.4.20-py3-none-any.whl.metadata (7.3 kB)\n",
" Using cached chromadb-0.4.19-py3-none-any.whl.metadata (7.3 kB)\n",
" Using cached chromadb-0.4.18-py3-none-any.whl.metadata (7.4 kB)\n",
" Using cached chromadb-0.4.17-py3-none-any.whl.metadata (7.3 kB)\n",
" Using cached chromadb-0.4.16-py3-none-any.whl.metadata (7.3 kB)\n",
" Using cached chromadb-0.4.15-py3-none-any.whl.metadata (7.2 kB)\n",
" Using cached chromadb-0.4.14-py3-none-any.whl.metadata (7.0 kB)\n",
" Using cached chromadb-0.4.13-py3-none-any.whl.metadata (7.0 kB)\n",
" Using cached chromadb-0.4.12-py3-none-any.whl.metadata (7.0 kB)\n",
"Collecting pydantic<2.0,>=1.9 (from chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0->langchain-chroma)\n",
" Using cached pydantic-1.10.24-py3-none-any.whl.metadata (154 kB)\n",
"Collecting fastapi<0.100.0,>=0.95.2 (from chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0->langchain-chroma)\n",
" Using cached fastapi-0.99.1-py3-none-any.whl.metadata (23 kB)\n",
"Collecting chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0 (from langchain-chroma)\n",
" Using cached chromadb-0.4.11-py3-none-any.whl.metadata (7.0 kB)\n",
" Using cached chromadb-0.4.10-py3-none-any.whl.metadata (7.0 kB)\n",
" Using cached chromadb-0.4.9-py3-none-any.whl.metadata (7.0 kB)\n",
"Collecting chroma-hnswlib==0.7.2 (from chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0->langchain-chroma)\n",
" Using cached chroma-hnswlib-0.7.2.tar.gz (31 kB)\n",
" Installing build dependencies: started\n",
" Installing build dependencies: finished with status 'done'\n",
" Getting requirements to build wheel: started\n",
" Getting requirements to build wheel: finished with status 'done'\n",
" Preparing metadata (pyproject.toml): started\n",
" Preparing metadata (pyproject.toml): finished with status 'done'\n",
"Collecting chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0 (from langchain-chroma)\n",
" Using cached chromadb-0.4.8-py3-none-any.whl.metadata (6.9 kB)\n",
" Using cached chromadb-0.4.7-py3-none-any.whl.metadata (6.9 kB)\n",
" Using cached chromadb-0.4.6-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.4.5-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.4.4-py3-none-any.whl.metadata (6.8 kB)\n",
" Using cached chromadb-0.4.3-py3-none-any.whl.metadata (6.9 kB)\n",
"Collecting pandas>=1.3 (from chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0->langchain-chroma)\n",
" Using cached pandas-2.3.3-cp314-cp314-win_amd64.whl.metadata (19 kB)\n",
"Collecting chroma-hnswlib==0.7.1 (from chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0->langchain-chroma)\n",
" Using cached chroma-hnswlib-0.7.1.tar.gz (30 kB)\n",
" Installing build dependencies: started\n",
" Installing build dependencies: finished with status 'done'\n",
" Getting requirements to build wheel: started\n",
" Getting requirements to build wheel: finished with status 'done'\n",
" Preparing metadata (pyproject.toml): started\n",
" Preparing metadata (pyproject.toml): finished with status 'done'\n",
"Collecting chromadb!=0.5.10,!=0.5.11,!=0.5.12,!=0.5.4,!=0.5.5,!=0.5.7,!=0.5.9,<0.7.0,>=0.4.0 (from langchain-chroma)\n",
" Using cached chromadb-0.4.2-py3-none-any.whl.metadata (6.9 kB)\n",
" Using cached chromadb-0.4.1-py3-none-any.whl.metadata (6.9 kB)\n",
" Using cached chromadb-0.4.0-py3-none-any.whl.metadata (6.9 kB)\n",
"Collecting langchain-chroma\n",
" Using cached langchain_chroma-0.2.2-py3-none-any.whl.metadata (1.3 kB)\n",
"Collecting langchain-core!=0.3.0,!=0.3.1,!=0.3.10,!=0.3.11,!=0.3.12,!=0.3.13,!=0.3.14,!=0.3.2,!=0.3.3,!=0.3.4,!=0.3.5,!=0.3.6,!=0.3.7,!=0.3.8,!=0.3.9,<0.4.0,>=0.2.43 (from langchain-chroma)\n",
" Using cached langchain_core-0.3.80-py3-none-any.whl.metadata (3.2 kB)\n",
"Collecting numpy<2.0.0,>=1.26.2 (from langchain-chroma)\n",
" Using cached numpy-1.26.4.tar.gz (15.8 MB)\n",
" Installing build dependencies: started\n",
" Installing build dependencies: finished with status 'done'\n",
" Getting requirements to build wheel: started\n",
" Getting requirements to build wheel: finished with status 'done'\n",
" Installing backend dependencies: started\n",
" Installing backend dependencies: finished with status 'done'\n",
" Preparing metadata (pyproject.toml): started\n",
" Preparing metadata (pyproject.toml): finished with status 'error'\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" error: subprocess-exited-with-error\n",
" \n",
" × Preparing metadata (pyproject.toml) did not run successfully.\n",
" │ exit code: 1\n",
" ╰─> [21 lines of output]\n",
" + E:\\Sethu\\server\\.venv\\Scripts\\python.exe C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-felxd0x6\\numpy_aa9d24349cad45e09f0869ed93e74c3e\\vendored-meson\\meson\\meson.py setup C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-felxd0x6\\numpy_aa9d24349cad45e09f0869ed93e74c3e C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-felxd0x6\\numpy_aa9d24349cad45e09f0869ed93e74c3e\\.mesonpy-wq6ry_x4 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-felxd0x6\\numpy_aa9d24349cad45e09f0869ed93e74c3e\\.mesonpy-wq6ry_x4\\meson-python-native-file.ini\n",
" The Meson build system\n",
" Version: 1.2.99\n",
" Source dir: C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-felxd0x6\\numpy_aa9d24349cad45e09f0869ed93e74c3e\n",
" Build dir: C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-felxd0x6\\numpy_aa9d24349cad45e09f0869ed93e74c3e\\.mesonpy-wq6ry_x4\n",
" Build type: native build\n",
" Project name: NumPy\n",
" Project version: 1.26.4\n",
" WARNING: Failed to activate VS environment: Could not find C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe\n",
" \n",
" ..\\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]\n",
" The following exception(s) were encountered:\n",
" Running `icl \"\"` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `cl /?` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `cc --version` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `gcc --version` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `clang --version` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `clang-cl /?` gave \"[WinError 2] The system cannot find the file specified\"\n",
" Running `pgcc --version` gave \"[WinError 2] The system cannot find the file specified\"\n",
" \n",
" A full log can be found at C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-felxd0x6\\numpy_aa9d24349cad45e09f0869ed93e74c3e\\.mesonpy-wq6ry_x4\\meson-logs\\meson-log.txt\n",
" [end of output]\n",
" \n",
" note: This error originates from a subprocess, and is likely not a problem with pip.\n",
"error: metadata-generation-failed\n",
"\n",
"× Encountered error while generating package metadata.\n",
"╰─> numpy\n",
"\n",
"note: This is an issue with the package mentioned above, not pip.\n",
"hint: See above for details.\n"
]
}
],
"source": [
"!pip install langchain-chroma langchain-groq"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: langchain-text-splitters in e:\\sethu\\server\\.venv\\lib\\site-packages (1.0.0)\n",
"Requirement already satisfied: langchain-core<2.0.0,>=1.0.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-text-splitters) (1.2.0)\n",
"Requirement already satisfied: jsonpatch<2.0.0,>=1.33.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (1.33)\n",
"Requirement already satisfied: langsmith<1.0.0,>=0.3.45 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (0.4.59)\n",
"Requirement already satisfied: packaging<26.0.0,>=23.2.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (25.0)\n",
"Requirement already satisfied: pydantic<3.0.0,>=2.7.4 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (2.12.5)\n",
"Requirement already satisfied: pyyaml<7.0.0,>=5.3.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (6.0.3)\n",
"Requirement already satisfied: tenacity!=8.4.0,<10.0.0,>=8.1.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (9.1.2)\n",
"Requirement already satisfied: typing-extensions<5.0.0,>=4.7.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (4.15.0)\n",
"Requirement already satisfied: uuid-utils<1.0,>=0.12.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (0.12.0)\n",
"Requirement already satisfied: jsonpointer>=1.9 in e:\\sethu\\server\\.venv\\lib\\site-packages (from jsonpatch<2.0.0,>=1.33.0->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (3.0.0)\n",
"Requirement already satisfied: httpx<1,>=0.23.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (0.28.1)\n",
"Requirement already satisfied: orjson>=3.9.14 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (3.11.5)\n",
"Requirement already satisfied: requests-toolbelt>=1.0.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (1.0.0)\n",
"Requirement already satisfied: requests>=2.0.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (2.32.5)\n",
"Requirement already satisfied: zstandard>=0.23.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (0.25.0)\n",
"Requirement already satisfied: anyio in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (4.12.0)\n",
"Requirement already satisfied: certifi in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (2025.11.12)\n",
"Requirement already satisfied: httpcore==1.* in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (1.0.9)\n",
"Requirement already satisfied: idna in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (3.11)\n",
"Requirement already satisfied: h11>=0.16 in e:\\sethu\\server\\.venv\\lib\\site-packages (from httpcore==1.*->httpx<1,>=0.23.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (0.16.0)\n",
"Requirement already satisfied: annotated-types>=0.6.0 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3.0.0,>=2.7.4->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (0.7.0)\n",
"Requirement already satisfied: pydantic-core==2.41.5 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3.0.0,>=2.7.4->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (2.41.5)\n",
"Requirement already satisfied: typing-inspection>=0.4.2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from pydantic<3.0.0,>=2.7.4->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (0.4.2)\n",
"Requirement already satisfied: charset_normalizer<4,>=2 in e:\\sethu\\server\\.venv\\lib\\site-packages (from requests>=2.0.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (3.4.4)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in e:\\sethu\\server\\.venv\\lib\\site-packages (from requests>=2.0.0->langsmith<1.0.0,>=0.3.45->langchain-core<2.0.0,>=1.0.0->langchain-text-splitters) (2.6.2)\n"
]
}
],
"source": [
"!pip install langchain-text-splitters"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from dotenv import load_dotenv\n",
"\n",
"load_dotenv()\n",
"\n",
"\n",
"GROQ_API_KEY = os.getenv('GROQ_API_KEY') #get api key from groq platform to create the LLM"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"e:\\Sethu\\server\\.venv\\Lib\\site-packages\\langchain_core\\_api\\deprecation.py:26: UserWarning: Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater.\n",
" from pydantic.v1.fields import FieldInfo as FieldInfoV1\n",
"e:\\Sethu\\server\\.venv\\Lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
},
{
"data": {
"text/plain": [
"33"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from langchain_community.document_loaders import PyPDFDirectoryLoader\n",
"\n",
"lpdf = PyPDFDirectoryLoader( #load pdf in kb folder\n",
" \"KB\"\n",
")\n",
"\n",
"loaded_docs = lpdf.load()\n",
"len(loaded_docs) #get the files length"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"87"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from langchain_text_splitters import RecursiveCharacterTextSplitter\n",
"\n",
"tsplitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)\n",
"splitted_text = tsplitter.split_documents(loaded_docs) #split the document data into chunks\n",
"\n",
"len(splitted_text) #get splitted data length"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\User\\AppData\\Local\\Temp\\ipykernel_20848\\2708684703.py:6: LangChainDeprecationWarning: The class `HuggingFaceBgeEmbeddings` was deprecated in LangChain 0.2.2 and will be removed in 1.0. An updated version of the class exists in the `langchain-huggingface package and should be used instead. To use it run `pip install -U `langchain-huggingface` and import as `from `langchain_huggingface import HuggingFaceEmbeddings``.\n",
" bge_embeddings = HuggingFaceBgeEmbeddings(\n"
]
}
],
"source": [
"from langchain_community.embeddings import HuggingFaceBgeEmbeddings\n",
"\n",
"model_name = \"BAAI/bge-base-en\" #using the model data is tokened to understand LLM \n",
"encode_kwargs = {'normalize_embeddings': True}\n",
"\n",
"bge_embeddings = HuggingFaceBgeEmbeddings(\n",
" model_name=model_name,\n",
" model_kwargs={'device': 'cpu'},\n",
" encode_kwargs=encode_kwargs #load the above model\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from langchain_community.vectorstores import FAISS\n",
"\n",
"vector_store = FAISS.from_documents( #get splitted text & tokened model data into database\n",
" documents=splitted_text,\n",
" embedding=bge_embeddings\n",
")\n",
"\n",
"persist_directory = 'chroma_vector_db'\n",
"\n",
"vector_store.save_local(persist_directory)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"new_vector_store = FAISS.load_local( #load the database\n",
" persist_directory, bge_embeddings, allow_dangerous_deserialization=True\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"retriever = new_vector_store.as_retriever(search_kwargs={\"k\": 5}) #get queries and send the top 5 related documents"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from langchain_core.prompts import ChatPromptTemplate, PromptTemplate\n",
"from langchain_core.runnables import RunnablePassthrough\n",
"\n",
"from langchain_core.output_parsers import StrOutputParser\n",
"from langchain_core.output_parsers import JsonOutputParser\n",
"\n",
"from langchain_groq import ChatGroq\n",
"\n",
"opmodel = ChatGroq( #start the agent from retriver\n",
" model=\"openai/gpt-oss-20b\", #load the gpt LLM model using groq api key\n",
" )\n",
"\n",
"rag_context_agent_prompt = PromptTemplate( #create the prompt to send rag model\n",
" template=\"\"\"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n",
"You are the Context Retrieval Agent for Legal/Immigration Assistance. \n",
"Your job is ONLY to extract and organize relevant information from the retrieved CONTEXT. \n",
"You do NOT generate advice, legal guidance, recommendations, or solutions. \n",
"You only filter, extract, and structure raw factual information.\n",
"\n",
"Your task:\n",
"1. Read all retrieved CONTEXT.\n",
"2. Extract information about:\n",
" - target user group (e.g., migrants, asylum seekers)\n",
" - challenges or pain points\n",
" - existing digital tools or services\n",
" - legal or administrative procedures\n",
" - gaps, inefficiencies, or barriers\n",
"3. Remove irrelevant content.\n",
"4. Do NOT rewrite, interpret, or suggest solutions. Only include raw context fragments.\n",
"5. Do NOT add any new information.\n",
"\n",
"Return the extracted information in this structure:\n",
"\n",
"**Target User Group:**\n",
"- Extract exact mentions from context.\n",
"\n",
"**Challenges / Pain Points:**\n",
"- Bullet points of challenges or difficulties described.\n",
"\n",
"**Existing Digital Tools / Services:**\n",
"- List tools or services exactly as mentioned.\n",
"\n",
"**Legal / Administrative Procedures Mentioned:**\n",
"- Extract exact lines mentioning procedures.\n",
"\n",
"**Gaps or Barriers:**\n",
"- Include lines describing inefficiencies, limitations, or obstacles.\n",
"\n",
"**Contextual Quotes / Examples (raw context only):**\n",
"- Include verbatim context lines that illustrate challenges or processes.\n",
"\n",
"If no relevant information is found for any section, write:\n",
"\"Not available in retrieved context.\"\n",
"\n",
"If nothing matches at all, write:\n",
"\"No relevant information found in retrieved context.\"\n",
"\n",
"If something in the CONTEXT does not mention immigration challenges or user groups, say:\n",
"\"there is no mentioning about immigration challenges for the specified user group.\"\n",
"\n",
"<|eot_id|><|start_header_id|>user<|end_header_id|>\n",
"CONTEXT:\n",
"{context}\n",
"\n",
"Extract only the relevant pieces and return the structured summary above.\n",
"\n",
"<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n",
"\"\"\",\n",
" input_variables=[\"context\"],\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"**Target User Group:**\n",
"- newcomers\n",
"- people moving to Canada\n",
"- family members (of newcomers)\n",
"\n",
"**Challenges / Pain Points:**\n",
"- “Moving to Canada may come with opportunities and challenges. It is important to begin preparing for the challenges you may face on arrival in Canada.”\n",
"- “You will need to collect important documents, arrange where you will stay after arrival, get clothing for the weather, practice the language and other preparations.”\n",
"- “Collect all important original documents that belong to you and your family members. You may need to translate these documents into English or French depending on where you settle.”\n",
"- “BEGIN THE FOREIGN CREDENTIAL RECOGNITION PROCESS… Depending on your field of work, this process can take months or even years, and could come with associated costs.”\n",
"- “Apply for your Social Insurance Number (SIN). It is needed to work in Canada and access government services and benefits. You can get a temporary SIN for a short period. Do not give your SIN to anyone unless you are sure there is a legal reason. If someone asks for your SIN, ask why they need it.”\n",
"- “Driving in Canada. Learn about provincial or territorial laws to get your driver’s license, or get an International Driving Permit.”\n",
"- “Improve your English or French. There are many language training options and some have no cost.”\n",
"- “Make connections and build relationships in your community. Your community can help with your settlement.”\n",
"\n",
"**Existing Digital Tools / Services:**\n",
"- “About pre-arrival services” webpage (web page is available in English and French)\n",
"- “Crossing the border: documents you need” webpage\n",
"- “Personal Effects Accounting Document” webpage\n",
"- “Find free newcomer services near you” webpage (web page is available in English and French)\n",
"- “Social Insurance Number– Overview” webpage (web page is available in English and French)\n",
"- “Language Training Options for Newcomers to Canada” video (available in English and French)\n",
"- “Your Rights and Freedoms in Canada” webpage (web page is available in English and French)\n",
"\n",
"**Legal / Administrative Procedures Mentioned:**\n",
"- “Apply for your Social Insurance Number (SIN).”\n",
"- “You can get a temporary SIN for a short period.”\n",
"- “Driving in Canada. Learn about provincial or territorial laws to get your driver’s license, or get an International Driving Permit.”\n",
"- “BEGIN THE FOREIGN CREDENTIAL RECOGNITION PROCESS… you will need a special licence or certificate before you can work in those jobs.”\n",
"- “Collect all important original documents that belong to you and your family members. You may need to translate these documents into English or French depending on where you settle.”\n",
"- “Gather documents such as passports, diplomas, language proficiency scores, vaccination records, medical records, dental and eye records, driver’s licences, birth and death certificates, marriage or divorce certificates, proof of work experience.”\n",
"\n",
"**Gaps or Barriers:**\n",
"- “Depending on your field of work, this process can take months or even years, and could come with associated costs.”\n",
"- “You may need to translate these documents into English or French depending on where you settle.”\n",
"- “You will need a special licence or certificate before you can work in those jobs.”\n",
"- “Do not give your SIN to anyone unless you are sure there is a legal reason.”\n",
"\n",
"**Contextual Quotes / Examples (raw context only):**\n",
"- “Moving to Canada may come with opportunities and challenges. It is important to begin preparing for the challenges you may face on arrival in Canada.”\n",
"- “You will need to collect important documents, arrange where you will stay after arrival, get clothing for the weather, practice the language and other preparations.”\n",
"- “Collect all important original documents that belong to you and your family members. You may need to translate these documents into English or French depending on where you settle.”\n",
"- “BEGIN THE FOREIGN CREDENTIAL RECOGNITION PROCESS In Canada, some jobs are regulated, which means you will need a special licence or certificate before you can work in those jobs. It is better to start the process of having your credentials recognized as early as possible, to work in a regulated profession in Canada. You can start this process even before you leave your country. Depending on your field of work, this process can take months or even years, and could come with associated costs.”\n",
"- “Apply for your Social Insurance Number (SIN). It is needed to work in Canada and access government services and benefits. You can get a temporary SIN for a short period. Do not give your SIN to anyone unless you are sure there is a legal reason. If someone asks for your SIN, ask why they need it.”\n",
"- “Improve your English or French. There are many language training options and some have no cost. To learn more, consult Language Training Options for Newcomers to Canada (video is available in English and French) or visit the settlement provider organization in your community.”\n",
"- “Driving in Canada. Learn about provincial or territorial laws to get your driver’s license, or get an International Driving Permit.”\n",
"- “Learn about Canadian laws and your rights and civic responsibilities as a resident of Canada. To learn more, consult: Your Rights and Freedoms in Canada (web page is available in English and French).”\n"
]
}
],
"source": [
"rag_prompt_chain = rag_context_agent_prompt | opmodel | StrOutputParser() #content get from rag\n",
"\n",
"QUESTION = \"Extract all relevant information about the challenges, tools, and barriers for migrants navigating immigration processes to canada.\"\n",
"CONTEXT = retriever.invoke(QUESTION) #past the content to the prompt\n",
"\n",
"result = rag_prompt_chain.invoke({\"context\":CONTEXT}) #display the final prompt content \n",
"\n",
"print(result)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|