quickstart.mdx 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ---
  2. title: '🚀 Quickstart'
  3. description: '💡 Start building LLM powered apps under 30 seconds'
  4. ---
  5. Embedchain is a Data Platform for LLMs - load, index, retrieve, and sync any unstructured data. Using embedchain, you can easily create LLM powered apps over any data.
  6. Install embedchain python package:
  7. ```bash
  8. pip install embedchain
  9. ```
  10. <Tip>
  11. Embedchain now supports OpenAI's latest `gpt-4-turbo` model. Checkout the [FAQs](/get-started/faq#how-to-use-gpt-4-turbo-model-released-on-openai-devday).
  12. </Tip>
  13. Creating an app involves 3 steps:
  14. <Steps>
  15. <Step title="⚙️ Import app instance">
  16. ```python
  17. from embedchain import Pipeline as App
  18. app = App()
  19. ```
  20. <Accordion title="Customize your app by a simple YAML config" icon="gear-complex">
  21. Embedchain provides a wide range of options to customize your app. You can customize the model, data sources, and much more.
  22. Explore the custom configurations [here](https://docs.embedchain.ai/advanced/configuration).
  23. <CodeGroup>
  24. ```python yaml_app.py
  25. from embedchain import Pipeline as App
  26. app = App.from_config(config_path="config.yaml")
  27. ```
  28. ```python json_app.py
  29. from embedchain import Pipeline as App
  30. app = App.from_config(config_path="config.json")
  31. ```
  32. ```python app.py
  33. from embedchain import Pipeline as App
  34. config = {} # Add your config here
  35. app = App.from_config(config=config)
  36. ```
  37. </CodeGroup>
  38. </Accordion>
  39. </Step>
  40. <Step title="🗃️ Add data sources">
  41. ```python
  42. app.add("https://en.wikipedia.org/wiki/Elon_Musk")
  43. app.add("https://www.forbes.com/profile/elon-musk")
  44. # app.add("path/to/file/elon_musk.pdf")
  45. ```
  46. <Accordion title="Embedchain supports adding data from many data sources." icon="files">
  47. Embedchain supports adding data from many data sources including web pages, PDFs, databases, and more.
  48. Explore the list of supported [data sources](https://docs.embedchain.ai/data-sources/overview).
  49. </Accordion>
  50. </Step>
  51. <Step title="💬 Ask questions, chat, or search through your data with ease">
  52. ```python
  53. app.query("What is the net worth of Elon Musk today?")
  54. # Answer: The net worth of Elon Musk today is $258.7 billion.
  55. ```
  56. <Accordion title="Want to chat with your app?" icon="face-thinking">
  57. Embedchain provides a wide range of features to interact with your app. You can chat with your app, ask questions, search through your data, and much more.
  58. ```python
  59. app.chat("How many companies does Elon Musk run? Name those")
  60. # Answer: Elon Musk runs 3 companies: Tesla, SpaceX, and Neuralink.
  61. app.chat("What is his net worth today?")
  62. # Answer: The net worth of Elon Musk today is $258.7 billion.
  63. ```
  64. To learn about other features, click [here](https://docs.embedchain.ai/get-started/introduction)
  65. </Accordion>
  66. </Step>
  67. <Step title="🚀 Seamlessly launch your App on the Embedchain Platform!">
  68. ```python
  69. app.deploy()
  70. # 🔑 Enter your Embedchain API key. You can find the API key at https://app.embedchain.ai/settings/keys/
  71. # ec-xxxxxx
  72. # 🛠️ Creating pipeline on the platform...
  73. # 🎉🎉🎉 Pipeline created successfully! View your pipeline: https://app.embedchain.ai/pipelines/xxxxx
  74. # 🛠️ Adding data to your pipeline...
  75. # ✅ Data of type: web_page, value: https://www.forbes.com/profile/elon-musk added successfully.
  76. ```
  77. <Accordion title="Share your app with others" icon="laptop-mobile">
  78. You can now share your app with others from our platform.
  79. Access your app on our [platform](https://app.embedchain.ai/).
  80. </Accordion>
  81. </Step>
  82. </Steps>
  83. Putting it together, you can run your first app using the following Google Colab. Make sure to set the `OPENAI_API_KEY` 🔑 environment variable in the code.
  84. <a href="https://colab.research.google.com/drive/17ON1LPonnXAtLaZEebnOktstB_1cJJmh?usp=sharing">
  85. <img src="https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667" alt="Open in Colab" />
  86. </a>