Files
mem0/embedchain/notebooks/embedchain-chromadb-server.ipynb
T

2.4 KiB

Embedchain chromadb server example

This notebook shows an example of how you can use embedchain with chromdb (server).

First, run chroma inside docker using the following command:

git clone https://github.com/chroma-core/chroma
cd chroma && docker-compose up -d --build
In [1]:
import os
from embedchain import App
from embedchain.config import AppConfig


chromadb_host = "localhost"
chromadb_port = 8000

config = AppConfig(host=chromadb_host, port=chromadb_port)
elon_bot = App(config)
In [2]:
# Embed Online Resources
elon_bot.add("web_page", "https://en.wikipedia.org/wiki/Elon_Musk")
elon_bot.add("web_page", "https://www.tesla.com/elon-musk")
All data from https://en.wikipedia.org/wiki/Elon_Musk already exists in the database.
All data from https://www.tesla.com/elon-musk already exists in the database.
In [3]:
elon_bot.query("How many companies does Elon Musk run?")
Out [3]:
'Elon Musk runs four companies: Tesla, SpaceX, Neuralink, and The Boring Company.'