Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChromaDB 0.4+ is no longer compatible with client config #7887

Closed
2 of 14 tasks
gpapp opened this issue Jul 18, 2023 · 51 comments
Closed
2 of 14 tasks

ChromaDB 0.4+ is no longer compatible with client config #7887

gpapp opened this issue Jul 18, 2023 · 51 comments
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature Ɑ: vector store Related to vector store module

Comments

@gpapp
Copy link
Contributor

gpapp commented Jul 18, 2023

System Info

  • Python 3.9.13

  • langchain-0.0.235-py3-none-any.whl

  • chromadb-0.4.0-py3-none-any.whl

Who can help?

No response

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

Steps to reproduce:

  1. Create a Chroma store which is locally persisted
store = Chroma.from_texts(
    texts=docs, embedding=embeddings, metadatas=metadatas, persist_directory=environ["DB_DIR"]
)
  1. Get the error You are using a deprecated configuration of Chroma. Please pip install chroma-migrate and run chroma-migrate to upgrade your configuration. See https://docs.trychroma.com/migration for more information or join our discord at https://discord.gg/8g5FESbj for help!
  2. Suffer

Expected behavior

  1. Create locally persisted Chroma store
  2. Use Chroma store

The issue:

Starting chromadb 0.40 the chroma_db_impl is no longer a supported parameter, it uses sqlite instead.

Removing the line
chroma_db_impl="duckdb+parquet",
from langchain.vectorstores/chroma.py solves the issue, but the earlier DB cannot be used or migrated.

@dosubot dosubot bot added Ɑ: vector store Related to vector store module 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jul 18, 2023
@dosubot
Copy link

dosubot bot commented Jul 18, 2023

Answer generated by a 🤖

Answer

Thank you for bringing this issue to our attention. It seems that the latest version of ChromaDB is no longer compatible with the client config, causing an error when creating a locally persisted Chroma store.

Based on your description, it appears that you have already identified a potential solution by removing the line chroma_db_impl="duckdb+parquet" from the langchain.vectorstores/chroma.py file. This workaround seems to resolve the issue, but it also means that the earlier DB cannot be used or migrated.

We appreciate your effort in finding a solution to this problem. If you would like to contribute your proposed fix to the LangChain project, we encourage you to create a pull request (PR) with your changes. The maintainers will review your contribution and decide if it should be merged into the project.

Thank you for your support and for helping to improve LangChain!


This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

@dosubot
Copy link

dosubot bot commented Jul 18, 2023

Answer generated by a 🤖

Answer

I understand that you're encountering an issue with ChromaDB 0.4+ compatibility in the LangChain Python framework. The error message you're receiving suggests that the ChromaDB configuration you're using is deprecated and needs to be upgraded. You've found a workaround by removing the line chroma_db_impl="duckdb+parquet" from langchain.vectorstores/chroma.py, but this prevents you from using or migrating the earlier database.

To address this issue, one potential solution could be to use a conditional statement to check the version of ChromaDB being used and then apply the appropriate configuration. Here's how you could implement this:

import chromadb

# Get the version of ChromaDB
chroma_version = chromadb.__version__

# Check if the version is 0.4 or later
if float(chroma_version) >= 0.4:
    # Use the new configuration
    _client_settings = chromadb.config.Settings(
        chroma_db_impl="new_configuration",
        persist_directory=persist_directory,
    )
else:
    # Use the old configuration
    _client_settings = chromadb.config.Settings(
        chroma_db_impl="duckdb+parquet",
        persist_directory=persist_directory,
    )

In this code, "new_configuration" should be replaced with the appropriate configuration for ChromaDB 0.4+.

This solution should allow you to use ChromaDB 0.4+ in a backwards compatible way. However, please note that you may still need to handle the migration process as suggested by the error message. This might involve using the chroma-migrate tool or a similar method to upgrade your existing data to the new configuration.

This is just one potential solution and it might need to be adjusted based on your specific code and requirements. If you find this solution helpful and believe it's not covered by existing documentation, I encourage you to make a pull request to update the documentation for the benefit of other users.

Sources


This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

gpapp added a commit to gpapp/langchain that referenced this issue Jul 18, 2023
@gpapp gpapp mentioned this issue Jul 18, 2023
@Maipengfei
Copy link

Thanks for helping me solve this problem

baskaryan added a commit that referenced this issue Jul 19, 2023
- Description: version check to make sure chromadb >=0.4.0 does not
throw an error, and uses the default sqlite persistence engine when the
directory is set,
  - Issue: the issue #7887 

For attention of
  - DataLoaders / VectorStores / Retrievers: @rlancemartin, @eyurtsev

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
@kevinknights29
Copy link

Thanks for taking quick action on this issue.

I was trying to figure out how to use the Chroma class with this new update, and found out that this code works:

import chromadb
from langchain.embeddings.sentence_transformer import SentenceTransformerEmbeddings
from langchain.vectorstores import Chroma

client = chromadb.PersistentClient(path="./db")
embeddings = SentenceTransformerEmbeddings(
    model_name="all-mpnet-base-v2",
)
vector_db = Chroma(
    client=client,
    collection_name="your-collection-name",
    embedding_function=embeddings,
)
print(f"Documents Loaded: {vector_db._collection.count()}")

Sharing in case someone else needs it.

@aevedis
Copy link
Contributor

aevedis commented Jul 19, 2023

Thanks for taking quick action on this issue.

I was trying to figure out how to use the Chroma class with this new update, and found out that this code works:

import chromadb
from langchain.embeddings.sentence_transformer import SentenceTransformerEmbeddings
from langchain.vectorstores import Chroma

client = chromadb.PersistentClient(path="./db")
embeddings = SentenceTransformerEmbeddings(
    model_name="all-mpnet-base-v2",
)
vector_db = Chroma(
    client=client,
    collection_name="your-collection-name",
    embedding_function=embeddings,
)
print(f"Documents Loaded: {vector_db._collection.count()}")

Sharing in case someone else needs it.

Hi @kevinknights29,

But how can I instead save embeddings and docs into into? Intuitively, I would use the following code:

import chromadb
from langchain.vectorstores import Chroma
from langchain.embeddings.openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings(openai_api_key = key)

client = chromadb.PersistentClient(path="db_metadata_v5")
vector_db = Chroma(
    client=client,
    embedding_function=embeddings,
)
vector_db = Chroma.from_documents(documents=chunks, embedding=embeddings, persist_directory=output_dir)
vector_db.persist()

But now, according to this, the function is no longer supported. So the final two lines throw an error, and indeed, I have "TypeError: 'NoneType' object is not iterable".
Have you found a solution to this as well?

@maheeppartap
Copy link

maheeppartap commented Jul 19, 2023

@aevedis vector_db = Chroma.from_documents(documents=chunks, embedding=embeddings, persist_directory=output_dir) should now be db = vector_db.from_documents(documents=chunks, embedding=embeddings, persist_directory=output_dir) instead, otherwise you are just overwriting the vector_db variable.
also vector_db.persist() is no longer needed and has been removed. It should be implicitly called when you call from_documents.

@aevedis
Copy link
Contributor

aevedis commented Jul 19, 2023

db = vector_db.from_documents(documents=chunks, embedding=embeddings, persist_directory=output_dir)

@maheeppartap Eh, but it still does not work. I get TypeError: 'NoneType' object is not iterable

@jeffchuber, maybe we need something on langchain side? Do you have any proposals? :)

@Maipengfei
Copy link

Maipengfei commented Jul 19, 2023 via email

@kevinknights29
Copy link

kevinknights29 commented Jul 19, 2023

Thanks for taking quick action on this issue.
I was trying to figure out how to use the Chroma class with this new update, and found out that this code works:

import chromadb
from langchain.embeddings.sentence_transformer import SentenceTransformerEmbeddings
from langchain.vectorstores import Chroma

client = chromadb.PersistentClient(path="./db")
embeddings = SentenceTransformerEmbeddings(
    model_name="all-mpnet-base-v2",
)
vector_db = Chroma(
    client=client,
    collection_name="your-collection-name",
    embedding_function=embeddings,
)
print(f"Documents Loaded: {vector_db._collection.count()}")

Sharing in case someone else needs it.

Hi @kevinknights29,

But how can I instead save embeddings and docs into into? Intuitively, I would use the following code:

import chromadb
from langchain.vectorstores import Chroma
from langchain.embeddings.openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings(openai_api_key = key)

client = chromadb.PersistentClient(path="db_metadata_v5")
vector_db = Chroma(
    client=client,
    embedding_function=embeddings,
)
vector_db = Chroma.from_documents(documents=chunks, embedding=embeddings, persist_directory=output_dir)
vector_db.persist()

But now, according to this, the function is no longer supported. So the final two lines throw an error, and indeed, I have "TypeError: 'NoneType' object is not iterable". Have you found a solution to this as well?


Based on: https://github.com/hwchase17/langchain/blob/master/langchain/vectorstores/chroma.py

You could:

import chromadb
from langchain.vectorstores import Chroma
from langchain.embeddings.openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings(openai_api_key = key)

client = chromadb.PersistentClient(path="db_metadata_v5")
vector_db = Chroma.from_documents(
     client=client, 
     documents=chunks, 
     embedding=embeddings, 
     persist_directory=output_dir
)
vector_db.persist()

This is possible because the from_documents method has a client argument.

Could you give it a try? I don't see why it wouldn't work.

@jeffchuber
Copy link
Contributor

Hi everyone, https://github.com/hwchase17/langchain/releases/tag/v0.0.236 was just released this morning and is backwards compatible. @kevinknights29 @Maipengfei please upgrade and if you have any issues, please ask in our discord - https://discord.gg/MMeYNTmh3x - we are responding very quickly right now!

@kevinknights29
Copy link

@jeffchuber, Thanks for the heads-up!

@aevedis
Copy link
Contributor

aevedis commented Jul 19, 2023

@jeffchuber, thank you a lot!

@aevedis
Copy link
Contributor

aevedis commented Jul 20, 2023

Hey @kevinknights29, this is just to notify you that in the end the issue has been fixed! The below code suffices, as it is backwards compatible as stated by @jeffchuber.

from langchain.vectorstores import Chroma

output_dir = "./db_metadata_v5"
db = Chroma.from_documents(chunks, embeddings, persist_directory=output_dir)

The difference is that now the embeddings, the text and various metadata are being stored in sqlite3. Querying works just as it used to.
I believe that the issue can now finally be closed.

Note: I am on chromadb v0.4.2 and langchain v0.0.237.

@jeffchuber
Copy link
Contributor

jeffchuber commented Jul 20, 2023

@gpapp thanks again for making the backwards compatibility PR!

@vincentwang79

This comment was marked as resolved.

@jeffchuber
Copy link
Contributor

@vincentwang79 this worked for me... https://gist.github.com/jeffchuber/a9ebc0ad5c7b053b8d1c50449c07f893

chroma==0.4.2
langchain==0.0.237

@vincentwang79
Copy link

@vincentwang79 this worked for me... https://gist.github.com/jeffchuber/a9ebc0ad5c7b053b8d1c50449c07f893

chroma==0.4.2 langchain==0.0.237

Yes, your code also works in my environment. I must have got something wrong. Thanks!

@abdullah-028
Copy link

abdullah-028 commented Jul 21, 2023

persist_dir='/Users/mac/Documents/Python_Scripts/python_scripts_researchpak/'
persist_dir = os.path.join(persist_dir, filename)
vectordb = Chroma.from_documents(documents=manualData, embedding=embeddings, persist_directory=persist_dir)
vectordb.persist()
before I was using the above way to store embeddings. After reinstalling chromadb. Now facing issue of depreciated configuration of chroma. how can I resolve this.

@abhitatachar2000
Copy link

abhitatachar2000 commented Jul 21, 2023

Hey everyone,
I guess this will help https://docs.trychroma.com/migration
Check out the end of this page, you'll find the reason for the error here.

Edit: Adding more context here:
With version chroma 0.4.4 there has been some changes with respect to how .persist() and .reset() work. Verify how you are creating your client for the vector db

That fixed the error for me.

@aevedis
Copy link
Contributor

aevedis commented Jul 21, 2023

@abdullah-028, just try: https://gist.github.com/jeffchuber/a9ebc0ad5c7b053b8d1c50449c07f893. It should work fine.

Only make sure to be on chromadb 0.4.2 and langchain 0.0.237.

@yoryis
Copy link

yoryis commented Jul 22, 2023

It is working for me with: chromadb 0.4.2 and langchain 0.0.237

aerrober pushed a commit to aerrober/langchain-fork that referenced this issue Jul 24, 2023
- Description: version check to make sure chromadb >=0.4.0 does not
throw an error, and uses the default sqlite persistence engine when the
directory is set,
  - Issue: the issue langchain-ai#7887 

For attention of
  - DataLoaders / VectorStores / Retrievers: @rlancemartin, @eyurtsev

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
@kesavan1994
Copy link

How to save and load chromadb using langchain ?

@jiapei100
Copy link

Same issue here today.

  • chromadb 0.4.4
  • langchain 0.0.250

Still buggy.

What is the final solution then?

@jiapei100
Copy link

@vdedourek2
How did you solve the problem? Can you please at least quote which one's solution works for you?
Or, can you please post your solution again directly?
Thank you ...

@victorlee0505
Copy link

victorlee0505 commented Aug 3, 2023

  • chromadb 0.4.4
  • langchain 0.0.249

This is what works for me

import chromadb
from chromadb.config import Settings

path='./db'
settings = Settings(
        persist_directory=path,
        anonymized_telemetry=False
)

client = chromadb.PersistentClient(settings=settings , path=path)

Create new db

db = Chroma.from_documents(
                    client=client,
                    documents=texts,
                    embedding=embeddings,
                )

Read existing db

db = Chroma(
              client=client,
              embedding_function=embeddings,
          )
db.add_documents(texts)

Retriever from existing db

db = Chroma(
            client=client,
            embedding_function=embeddings,
        )
retriever = db.as_retriever( ... )

@jiapei100
Copy link

@victorlee0505

Thank you so much.... It's working now... ^_^
PrivateGPT's ingest.py .

I blieve you should be able provide a pull request over there. At least one more file to be modified: privateGPT.py accordingly...

Thanks...

@jeffchuber
Copy link
Contributor

thank you @victorlee0505 !

@jimysancho
Copy link

jimysancho commented Oct 10, 2023

@victorlee0505

Hello. I am trying to use chromadb with the PersistentClient way. The problem is I am getting the error:

ValueError: You are using a deprecated configuration of Chroma.

If you do not have data you wish to migrate, you only need to change how you construct
your Chroma client. Please see the "New Clients" section of https://docs.trychroma.com/migration.


If you do have data you wish to migrate, we have a migration tool you can use in order to
migrate your data to the new Chroma architecture.
Please pip install chroma-migrate and run chroma-migrate to migrate your data and then
change how you construct your Chroma client.

See https://docs.trychroma.com/migration for more information or join our discord at https://discord.gg/8g5FESbj for help!

The thing is! I am already using the new version, and I do not have data to migrate. Can someone help me with issue please? I can't solve this problem

@abhitatachar2000
Copy link

abhitatachar2000 commented Oct 10, 2023

This seems to have been an error with migration. Such an error occurs in the case where you have some data that you were using with an older version of chromaDB and then you have updated the version.

So basically, now it's asking you to migrate the data to the newer version.

For an immediate fix, you can try changing the path of the persistent storage for the vector database and give it a try.

Maybe try this:

import chromadb
from chromadb.config import Settings

client = chromadb.PersistentClient(path="/new_path", settings = Settings(allow_reset=True)

Here note that I have mentioned the new_path which is essentially different from the old path (the one you are currently using).

@jimysancho
Copy link

@abhitatachar2000

Thanks for your answer!

It is not working though...

I get the same error. Like I mentioned, I do not have any data to migrate. I am using the version: 0.4.14.

Anyone, how should I proceed?

Thanks!

@victorlee0505
Copy link

@jimysancho

this is my setting

client = chromadb.PersistentClient(settings=CHROMA_SETTINGS_HF, path=persist_directory)
from chromadb.config import Settings
PERSIST_DIRECTORY_HF = './storage_hf'


CHROMA_SETTINGS_HF = Settings(
        # chroma_db_impl='duckdb+parquet',
        persist_directory=PERSIST_DIRECTORY_HF,
        anonymized_telemetry=False
)

so my guess of ValueError: You are using a deprecated configuration of Chroma.
I have commented # chroma_db_impl='duckdb+parquet' in my setting which is deprecated.

@mrinterestfull
Copy link

Gentleman,
Oct 24:
based on conversation here. I'm guessing this is the correct way?

from chromadb.config import Settings
persist_directory = 'docs/chroma/'

path=persist_directory
settings = Settings(
persist_directory=path,
anonymized_telemetry=False
)

client = chromadb.PersistentClient(settings=settings , path=path)
#client = chromadb.PersistentClient(path=persist_directory, settings = Settings(allow_reset=True))

but making a client gives an error:
image

AttributeError: type object 'hnswlib.Index' has no attribute 'file_handle_count'

Where do I go from here?

@mrinterestfull
Copy link

Also, for those coming from deeplearning.ai and trying to run the syntax in their juputerworkbook, you might as a workaround for now until this is fixed downgrade chroma until langchain supports 0.4+
#pip install chromadb==0.3.29 only works in this version

@jeffchuber
Copy link
Contributor

@lszyba1 langchain does not support 0.4 chroma? can you provide more info/repro? this is concerning

@mrinterestfull
Copy link

mrinterestfull commented Oct 24, 2023

Hello Jeff
When you watch and download the jupyter notebook for deeplearning.ai short course:
https://www.deeplearning.ai/short-courses/langchain-chat-with-your-data/
In section 03 they have following code. When trying to replicate that code on your own computer I'm getting first the "deprecated warning on syntax for chroma", based on comment above, I'm guessing the correct syntax, which then leads to hnswlib.index error.

The syntax in question:
image
image

steps to reproduce:
pip install langchain[all]
pip install chromadb
then run the code above.

@jeffchuber
Copy link
Contributor

@lszyba1 perhaps you can help me diagnose more? i ran the notebook here - https://learn.deeplearning.ai/langchain-chat-with-your-data/lesson/4/vectorstores-and-embedding- and it looks like it ran ok? thanks!

Screenshot 2023-10-24 at 9 03 17 PM

@mrinterestfull
Copy link

Hello
Thanks.
Yes. it does work there. Looks like they pinned their environment to certain version of software.

Now copy/download the notebook onto your computer.
Debian Linux 11.
setup a new environment
virtualenv -p python3 env_py3
source env_py3/bin/activate
pip install jupyterlab
pip install panel
pip install python-dotenv
pip install langchain[all]
pip install chromadb
pip install lxml

open the notebook and try to run the "75" from your screenshot (you will need openai key, + few of prior lines) .
by default chromadb will be 0.4+ so that line will fail that you are using depreciated configuration options.
....then you will try to figure what the correct syntax is...when you do then you get hnswlib attribute error inside chroma.
and that is where I'm at.

@jeffchuber
Copy link
Contributor

@lszyba1 very strange. I pulled down the notebook locally and pip install chromadb in the notebook, and confirmed it's using 0.4.15. It seemed to run with no issues.

Can you provide more info on the failure? sorry about the trouble

@mrinterestfull
Copy link

mrinterestfull commented Oct 27, 2023

@jeffchuber That is weird...here is a test.py file that we can be on a same page.

machinelearning-lecture01.pdf

test.py

import openai
import sys
sys.path.append('../..')

from dotenv import load_dotenv, find_dotenv
_ = load_dotenv(find_dotenv()) # read local .env file

openai.api_key  = os.environ['OPENAI_API_KEY']

from langchain.document_loaders import PyPDFLoader

# Load PDF
loaders = [
    # Duplicate documents on purpose - messy data
    PyPDFLoader("machinelearning-lecture01.pdf")
]
docs = []
for loader in loaders:
    docs.extend(loader.load())

# Split
from langchain.text_splitter import RecursiveCharacterTextSplitter
text_splitter = RecursiveCharacterTextSplitter(
    chunk_size = 1500,
    chunk_overlap = 150
)


splits = text_splitter.split_documents(docs)

len(splits)


from langchain.embeddings.openai import OpenAIEmbeddings
embedding = OpenAIEmbeddings()

from langchain.vectorstores import Chroma

persist_directory = 'docs/chroma/'

#sentence3 = "the weather is awsome outside"
#embedding.embed_query(sentence3)


vectordb = Chroma.from_documents(
    documents=splits,
    embedding=embedding,
    persist_directory=persist_directory
)

vectordb.persist()

2023-10-27_11-07

@jeffchuber
Copy link
Contributor

@lszyba1 let's try on a minimal example... this could be a version issue with python on your computer (very common!)

import langchain
import chromadb
print(langchain.__version__)
print(chromadb.__version__)

#0.0.324
#0.4.15

import os
import getpass

os.environ['OPENAI_API_KEY'] = "<key>"


from langchain.document_loaders import TextLoader
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.text_splitter import CharacterTextSplitter
from langchain.vectorstores import Chroma

# Load the document, split it into chunks, embed each chunk and load it into the vector store.
raw_documents = TextLoader('sotu.txt').load()
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
documents = text_splitter.split_documents(raw_documents)

db = Chroma.from_documents(documents, OpenAIEmbeddings())

query = "What did the president say about Ketanji Brown Jackson"
docs = db.similarity_search(query)
print(docs[0].page_content)

sotu.txt

Madam Speaker, Madam Vice President, our First Lady and Second Gentleman. Members of Congress and the Cabinet. Justices of the Supreme Court. My fellow Americans.  

Last year COVID-19 kept us apart. This year we are finally together again. 

Tonight, we meet as Democrats Republicans and Independents. But most importantly as Americans. 

With a duty to one another to the American people to the Constitution. 

And with an unwavering resolve that freedom will always triumph over tyranny. 

Six days ago, Russia’s Vladimir Putin sought to shake the foundations of the free world thinking he could make it bend to his menacing ways. But he badly miscalculated. 

He thought he could roll into Ukraine and the world would roll over. Instead he met a wall of strength he never imagined. 

He met the Ukrainian people. 

From President Zelenskyy to every Ukrainian, their fearlessness, their courage, their determination, inspires the world. 

Groups of citizens blocking tanks with their bodies. Everyone from students to retirees teachers turned soldiers defending their homeland. 

In this struggle as President Zelenskyy said in his speech to the European Parliament “Light will win over darkness.” The Ukrainian Ambassador to the United States is here tonight. 

Let each of us here tonight in this Chamber send an unmistakable signal to Ukraine and to the world. 

Please rise if you are able and show that, Yes, we the United States of America stand with the Ukrainian people. 

Throughout our history we’ve learned this lesson when dictators do not pay a price for their aggression they cause more chaos.   

They keep moving.   

And the costs and the threats to America and the world keep rising.   

That’s why the NATO Alliance was created to secure peace and stability in Europe after World War 2. 

The United States is a member along with 29 other nations. 

It matters. American diplomacy matters. American resolve matters. 

Putin’s latest attack on Ukraine was premeditated and unprovoked. 

He rejected repeated efforts at diplomacy. 

He thought the West and NATO wouldn’t respond. And he thought he could divide us at home. Putin was wrong. We were ready.  Here is what we did.   

We prepared extensively and carefully. 

We spent months building a coalition of other freedom-loving nations from Europe and the Americas to Asia and Africa to confront Putin. 

I spent countless hours unifying our European allies. We shared with the world in advance what we knew Putin was planning and precisely how he would try to falsely justify his aggression.  

We countered Russia’s lies with truth.   

And now that he has acted the free world is holding him accountable. 

Along with twenty-seven members of the European Union including France, Germany, Italy, as well as countries like the United Kingdom, Canada, Japan, Korea, Australia, New Zealand, and many others, even Switzerland. 

We are inflicting pain on Russia and supporting the people of Ukraine. Putin is now isolated from the world more than ever. 

Together with our allies –we are right now enforcing powerful economic sanctions. 

We are cutting off Russia’s largest banks from the international financial system.  

Preventing Russia’s central bank from defending the Russian Ruble making Putin’s $630 Billion “war fund” worthless.   

We are choking off Russia’s access to technology that will sap its economic strength and weaken its military for years to come.  

Tonight I say to the Russian oligarchs and corrupt leaders who have bilked billions of dollars off this violent regime no more. 

The U.S. Department of Justice is assembling a dedicated task force to go after the crimes of Russian oligarchs.  

We are joining with our European allies to find and seize your yachts your luxury apartments your private jets. We are coming for your ill-begotten gains. 

And tonight I am announcing that we will join our allies in closing off American air space to all Russian flights – further isolating Russia – and adding an additional squeeze –on their economy. The Ruble has lost 30% of its value. 

The Russian stock market has lost 40% of its value and trading remains suspended. Russia’s economy is reeling and Putin alone is to blame. 

Together with our allies we are providing support to the Ukrainians in their fight for freedom. Military assistance. Economic assistance. Humanitarian assistance. 

We are giving more than $1 Billion in direct assistance to Ukraine. 

And we will continue to aid the Ukrainian people as they defend their country and to help ease their suffering.  

Let me be clear, our forces are not engaged and will not engage in conflict with Russian forces in Ukraine.  

Our forces are not going to Europe to fight in Ukraine, but to defend our NATO Allies – in the event that Putin decides to keep moving west.  

For that purpose we’ve mobilized American ground forces, air squadrons, and ship deployments to protect NATO countries including Poland, Romania, Latvia, Lithuania, and Estonia. 

As I have made crystal clear the United States and our Allies will defend every inch of territory of NATO countries with the full force of our collective power.  

And we remain clear-eyed. The Ukrainians are fighting back with pure courage. But the next few days weeks, months, will be hard on them.  

Putin has unleashed violence and chaos.  But while he may make gains on the battlefield – he will pay a continuing high price over the long run. 

And a proud Ukrainian people, who have known 30 years  of independence, have repeatedly shown that they will not tolerate anyone who tries to take their country backwards.  

To all Americans, I will be honest with you, as I’ve always promised. A Russian dictator, invading a foreign country, has costs around the world. 

And I’m taking robust action to make sure the pain of our sanctions  is targeted at Russia’s economy. And I will use every tool at our disposal to protect American businesses and consumers. 

Tonight, I can announce that the United States has worked with 30 other countries to release 60 Million barrels of oil from reserves around the world.  

America will lead that effort, releasing 30 Million barrels from our own Strategic Petroleum Reserve. And we stand ready to do more if necessary, unified with our allies.  

These steps will help blunt gas prices here at home. And I know the news about what’s happening can seem alarming. 

But I want you to know that we are going to be okay. 

When the history of this era is written Putin’s war on Ukraine will have left Russia weaker and the rest of the world stronger. 

While it shouldn’t have taken something so terrible for people around the world to see what’s at stake now everyone sees it clearly. 

We see the unity among leaders of nations and a more unified Europe a more unified West. And we see unity among the people who are gathering in cities in large crowds around the world even in Russia to demonstrate their support for Ukraine.  

In the battle between democracy and autocracy, democracies are rising to the moment, and the world is clearly choosing the side of peace and security. 

This is a real test. It’s going to take time. So let us continue to draw inspiration from the iron will of the Ukrainian people. 

To our fellow Ukrainian Americans who forge a deep bond that connects our two nations we stand with you. 

Putin may circle Kyiv with tanks, but he will never gain the hearts and souls of the Ukrainian people. 

He will never extinguish their love of freedom. He will never weaken the resolve of the free world. 

We meet tonight in an America that has lived through two of the hardest years this nation has ever faced. 

The pandemic has been punishing. 

And so many families are living paycheck to paycheck, struggling to keep up with the rising cost of food, gas, housing, and so much more. 

I understand. 

I remember when my Dad had to leave our home in Scranton, Pennsylvania to find work. I grew up in a family where if the price of food went up, you felt it. 

That’s why one of the first things I did as President was fight to pass the American Rescue Plan.  

Because people were hurting. We needed to act, and we did. 

Few pieces of legislation have done more in a critical moment in our history to lift us out of crisis. 

It fueled our efforts to vaccinate the nation and combat COVID-19. It delivered immediate economic relief for tens of millions of Americans.  

Helped put food on their table, keep a roof over their heads, and cut the cost of health insurance. 

And as my Dad used to say, it gave people a little breathing room. 

And unlike the $2 Trillion tax cut passed in the previous administration that benefitted the top 1% of Americans, the American Rescue Plan helped working people—and left no one behind. 

And it worked. It created jobs. Lots of jobs. 

In fact—our economy created over 6.5 Million new jobs just last year, more jobs created in one year  
than ever before in the history of America. 

Our economy grew at a rate of 5.7% last year, the strongest growth in nearly 40 years, the first step in bringing fundamental change to an economy that hasn’t worked for the working people of this nation for too long.  

For the past 40 years we were told that if we gave tax breaks to those at the very top, the benefits would trickle down to everyone else. 

But that trickle-down theory led to weaker economic growth, lower wages, bigger deficits, and the widest gap between those at the top and everyone else in nearly a century. 

Vice President Harris and I ran for office with a new economic vision for America. 

Invest in America. Educate Americans. Grow the workforce. Build the economy from the bottom up  
and the middle out, not from the top down.  

Because we know that when the middle class grows, the poor have a ladder up and the wealthy do very well. 

America used to have the best roads, bridges, and airports on Earth. 

Now our infrastructure is ranked 13th in the world. 

We won’t be able to compete for the jobs of the 21st Century if we don’t fix that. 

That’s why it was so important to pass the Bipartisan Infrastructure Law—the most sweeping investment to rebuild America in history. 

This was a bipartisan effort, and I want to thank the members of both parties who worked to make it happen. 

We’re done talking about infrastructure weeks. 

We’re going to have an infrastructure decade. 

It is going to transform America and put us on a path to win the economic competition of the 21st Century that we face with the rest of the world—particularly with China.  

As I’ve told Xi Jinping, it is never a good bet to bet against the American people. 

We’ll create good jobs for millions of Americans, modernizing roads, airports, ports, and waterways all across America. 

And we’ll do it all to withstand the devastating effects of the climate crisis and promote environmental justice. 

We’ll build a national network of 500,000 electric vehicle charging stations, begin to replace poisonous lead pipes—so every child—and every American—has clean water to drink at home and at school, provide affordable high-speed internet for every American—urban, suburban, rural, and tribal communities. 

4,000 projects have already been announced. 

And tonight, I’m announcing that this year we will start fixing over 65,000 miles of highway and 1,500 bridges in disrepair. 

When we use taxpayer dollars to rebuild America – we are going to Buy American: buy American products to support American jobs. 

The federal government spends about $600 Billion a year to keep the country safe and secure. 

There’s been a law on the books for almost a century 
to make sure taxpayers’ dollars support American jobs and businesses. 

Every Administration says they’ll do it, but we are actually doing it. 

We will buy American to make sure everything from the deck of an aircraft carrier to the steel on highway guardrails are made in America. 

But to compete for the best jobs of the future, we also need to level the playing field with China and other competitors. 

That’s why it is so important to pass the Bipartisan Innovation Act sitting in Congress that will make record investments in emerging technologies and American manufacturing. 

Let me give you one example of why it’s so important to pass it. 

If you travel 20 miles east of Columbus, Ohio, you’ll find 1,000 empty acres of land. 

It won’t look like much, but if you stop and look closely, you’ll see a “Field of dreams,” the ground on which America’s future will be built. 

This is where Intel, the American company that helped build Silicon Valley, is going to build its $20 billion semiconductor “mega site”. 

Up to eight state-of-the-art factories in one place. 10,000 new good-paying jobs. 

Some of the most sophisticated manufacturing in the world to make computer chips the size of a fingertip that power the world and our everyday lives. 

Smartphones. The Internet. Technology we have yet to invent. 

But that’s just the beginning. 

Intel’s CEO, Pat Gelsinger, who is here tonight, told me they are ready to increase their investment from  
$20 billion to $100 billion. 

That would be one of the biggest investments in manufacturing in American history. 

And all they’re waiting for is for you to pass this bill. 

So let’s not wait any longer. Send it to my desk. I’ll sign it.  

And we will really take off. 

And Intel is not alone. 

There’s something happening in America. 

Just look around and you’ll see an amazing story. 

The rebirth of the pride that comes from stamping products “Made In America.” The revitalization of American manufacturing.   

Companies are choosing to build new factories here, when just a few years ago, they would have built them overseas. 

That’s what is happening. Ford is investing $11 billion to build electric vehicles, creating 11,000 jobs across the country. 

GM is making the largest investment in its history—$7 billion to build electric vehicles, creating 4,000 jobs in Michigan. 

All told, we created 369,000 new manufacturing jobs in America just last year. 

Powered by people I’ve met like JoJo Burgess, from generations of union steelworkers from Pittsburgh, who’s here with us tonight. 

As Ohio Senator Sherrod Brown says, “It’s time to bury the label “Rust Belt.” 

It’s time. 

But with all the bright spots in our economy, record job growth and higher wages, too many families are struggling to keep up with the bills.  

Inflation is robbing them of the gains they might otherwise feel. 

I get it. That’s why my top priority is getting prices under control. 

Look, our economy roared back faster than most predicted, but the pandemic meant that businesses had a hard time hiring enough workers to keep up production in their factories. 

The pandemic also disrupted global supply chains. 

When factories close, it takes longer to make goods and get them from the warehouse to the store, and prices go up. 

Look at cars. 

Last year, there weren’t enough semiconductors to make all the cars that people wanted to buy. 

And guess what, prices of automobiles went up. 

So—we have a choice. 

One way to fight inflation is to drive down wages and make Americans poorer.  

I have a better plan to fight inflation. 

Lower your costs, not your wages. 

Make more cars and semiconductors in America. 

More infrastructure and innovation in America. 

More goods moving faster and cheaper in America. 

More jobs where you can earn a good living in America. 

And instead of relying on foreign supply chains, let’s make it in America. 

Economists call it “increasing the productive capacity of our economy.” 

I call it building a better America. 

My plan to fight inflation will lower your costs and lower the deficit. 

17 Nobel laureates in economics say my plan will ease long-term inflationary pressures. Top business leaders and most Americans support my plan. And here’s the plan: 

First – cut the cost of prescription drugs. Just look at insulin. One in ten Americans has diabetes. In Virginia, I met a 13-year-old boy named Joshua Davis.  

He and his Dad both have Type 1 diabetes, which means they need insulin every day. Insulin costs about $10 a vial to make.  

But drug companies charge families like Joshua and his Dad up to 30 times more. I spoke with Joshua’s mom. 

Imagine what it’s like to look at your child who needs insulin and have no idea how you’re going to pay for it.  

What it does to your dignity, your ability to look your child in the eye, to be the parent you expect to be. 

Joshua is here with us tonight. Yesterday was his birthday. Happy birthday, buddy.  

For Joshua, and for the 200,000 other young people with Type 1 diabetes, let’s cap the cost of insulin at $35 a month so everyone can afford it.  

Drug companies will still do very well. And while we’re at it let Medicare negotiate lower prices for prescription drugs, like the VA already does. 

Look, the American Rescue Plan is helping millions of families on Affordable Care Act plans save $2,400 a year on their health care premiums. Let’s close the coverage gap and make those savings permanent. 

Second – cut energy costs for families an average of $500 a year by combatting climate change.  

Let’s provide investments and tax credits to weatherize your homes and businesses to be energy efficient and you get a tax credit; double America’s clean energy production in solar, wind, and so much more;  lower the price of electric vehicles, saving you another $80 a month because you’ll never have to pay at the gas pump again. 

Third – cut the cost of child care. Many families pay up to $14,000 a year for child care per child.  

Middle-class and working families shouldn’t have to pay more than 7% of their income for care of young children.  

My plan will cut the cost in half for most families and help parents, including millions of women, who left the workforce during the pandemic because they couldn’t afford child care, to be able to get back to work. 

My plan doesn’t stop there. It also includes home and long-term care. More affordable housing. And Pre-K for every 3- and 4-year-old.  

All of these will lower costs. 

And under my plan, nobody earning less than $400,000 a year will pay an additional penny in new taxes. Nobody.  

The one thing all Americans agree on is that the tax system is not fair. We have to fix it.  

I’m not looking to punish anyone. But let’s make sure corporations and the wealthiest Americans start paying their fair share. 

Just last year, 55 Fortune 500 corporations earned $40 billion in profits and paid zero dollars in federal income tax.  

That’s simply not fair. That’s why I’ve proposed a 15% minimum tax rate for corporations. 

We got more than 130 countries to agree on a global minimum tax rate so companies can’t get out of paying their taxes at home by shipping jobs and factories overseas. 

That’s why I’ve proposed closing loopholes so the very wealthy don’t pay a lower tax rate than a teacher or a firefighter.  

So that’s my plan. It will grow the economy and lower costs for families. 

So what are we waiting for? Let’s get this done. And while you’re at it, confirm my nominees to the Federal Reserve, which plays a critical role in fighting inflation.  

My plan will not only lower costs to give families a fair shot, it will lower the deficit. 

The previous Administration not only ballooned the deficit with tax cuts for the very wealthy and corporations, it undermined the watchdogs whose job was to keep pandemic relief funds from being wasted. 

But in my administration, the watchdogs have been welcomed back. 

We’re going after the criminals who stole billions in relief money meant for small businesses and millions of Americans.  

And tonight, I’m announcing that the Justice Department will name a chief prosecutor for pandemic fraud. 

By the end of this year, the deficit will be down to less than half what it was before I took office.  

The only president ever to cut the deficit by more than one trillion dollars in a single year. 

Lowering your costs also means demanding more competition. 

I’m a capitalist, but capitalism without competition isn’t capitalism. 

It’s exploitation—and it drives up prices. 

When corporations don’t have to compete, their profits go up, your prices go up, and small businesses and family farmers and ranchers go under. 

We see it happening with ocean carriers moving goods in and out of America. 

During the pandemic, these foreign-owned companies raised prices by as much as 1,000% and made record profits. 

Tonight, I’m announcing a crackdown on these companies overcharging American businesses and consumers. 

And as Wall Street firms take over more nursing homes, quality in those homes has gone down and costs have gone up.  

That ends on my watch. 

Medicare is going to set higher standards for nursing homes and make sure your loved ones get the care they deserve and expect. 

We’ll also cut costs and keep the economy going strong by giving workers a fair shot, provide more training and apprenticeships, hire them based on their skills not degrees. 

Let’s pass the Paycheck Fairness Act and paid leave.  

Raise the minimum wage to $15 an hour and extend the Child Tax Credit, so no one has to raise a family in poverty. 

Let’s increase Pell Grants and increase our historic support of HBCUs, and invest in what Jill—our First Lady who teaches full-time—calls America’s best-kept secret: community colleges. 

And let’s pass the PRO Act when a majority of workers want to form a union—they shouldn’t be stopped.  

When we invest in our workers, when we build the economy from the bottom up and the middle out together, we can do something we haven’t done in a long time: build a better America. 

For more than two years, COVID-19 has impacted every decision in our lives and the life of the nation. 

And I know you’re tired, frustrated, and exhausted. 

But I also know this. 

Because of the progress we’ve made, because of your resilience and the tools we have, tonight I can say  
we are moving forward safely, back to more normal routines.  

We’ve reached a new moment in the fight against COVID-19, with severe cases down to a level not seen since last July.  

Just a few days ago, the Centers for Disease Control and Prevention—the CDC—issued new mask guidelines. 

Under these new guidelines, most Americans in most of the country can now be mask free.   

And based on the projections, more of the country will reach that point across the next couple of weeks. 

Thanks to the progress we have made this past year, COVID-19 need no longer control our lives.  

I know some are talking about “living with COVID-19”. Tonight – I say that we will never just accept living with COVID-19. 

We will continue to combat the virus as we do other diseases. And because this is a virus that mutates and spreads, we will stay on guard. 

Here are four common sense steps as we move forward safely.  

First, stay protected with vaccines and treatments. We know how incredibly effective vaccines are. If you’re vaccinated and boosted you have the highest degree of protection. 

We will never give up on vaccinating more Americans. Now, I know parents with kids under 5 are eager to see a vaccine authorized for their children. 

The scientists are working hard to get that done and we’ll be ready with plenty of vaccines when they do. 

We’re also ready with anti-viral treatments. If you get COVID-19, the Pfizer pill reduces your chances of ending up in the hospital by 90%.  

We’ve ordered more of these pills than anyone in the world. And Pfizer is working overtime to get us 1 Million pills this month and more than double that next month.  

And we’re launching the “Test to Treat” initiative so people can get tested at a pharmacy, and if they’re positive, receive antiviral pills on the spot at no cost.  

If you’re immunocompromised or have some other vulnerability, we have treatments and free high-quality masks. 

We’re leaving no one behind or ignoring anyone’s needs as we move forward. 

And on testing, we have made hundreds of millions of tests available for you to order for free.   

Even if you already ordered free tests tonight, I am announcing that you can order more from covidtests.gov starting next week. 

Second – we must prepare for new variants. Over the past year, we’ve gotten much better at detecting new variants. 

If necessary, we’ll be able to deploy new vaccines within 100 days instead of many more months or years.  

And, if Congress provides the funds we need, we’ll have new stockpiles of tests, masks, and pills ready if needed. 

I cannot promise a new variant won’t come. But I can promise you we’ll do everything within our power to be ready if it does.  

Third – we can end the shutdown of schools and businesses. We have the tools we need. 

It’s time for Americans to get back to work and fill our great downtowns again.  People working from home can feel safe to begin to return to the office.   

We’re doing that here in the federal government. The vast majority of federal workers will once again work in person. 

Our schools are open. Let’s keep it that way. Our kids need to be in school. 

And with 75% of adult Americans fully vaccinated and hospitalizations down by 77%, most Americans can remove their masks, return to work, stay in the classroom, and move forward safely. 

We achieved this because we provided free vaccines, treatments, tests, and masks. 

Of course, continuing this costs money. 

I will soon send Congress a request. 

The vast majority of Americans have used these tools and may want to again, so I expect Congress to pass it quickly.   

Fourth, we will continue vaccinating the world.     

We’ve sent 475 Million vaccine doses to 112 countries, more than any other nation. 

And we won’t stop. 

We have lost so much to COVID-19. Time with one another. And worst of all, so much loss of life. 

Let’s use this moment to reset. Let’s stop looking at COVID-19 as a partisan dividing line and see it for what it is: A God-awful disease.  

Let’s stop seeing each other as enemies, and start seeing each other for who we really are: Fellow Americans.  

We can’t change how divided we’ve been. But we can change how we move forward—on COVID-19 and other issues we must face together. 

I recently visited the New York City Police Department days after the funerals of Officer Wilbert Mora and his partner, Officer Jason Rivera. 

They were responding to a 9-1-1 call when a man shot and killed them with a stolen gun. 

Officer Mora was 27 years old. 

Officer Rivera was 22. 

Both Dominican Americans who’d grown up on the same streets they later chose to patrol as police officers. 

I spoke with their families and told them that we are forever in debt for their sacrifice, and we will carry on their mission to restore the trust and safety every community deserves. 

I’ve worked on these issues a long time. 

I know what works: Investing in crime prevention and community police officers who’ll walk the beat, who’ll know the neighborhood, and who can restore trust and safety. 

So let’s not abandon our streets. Or choose between safety and equal justice. 

Let’s come together to protect our communities, restore trust, and hold law enforcement accountable. 

That’s why the Justice Department required body cameras, banned chokeholds, and restricted no-knock warrants for its officers. 

That’s why the American Rescue Plan provided $350 Billion that cities, states, and counties can use to hire more police and invest in proven strategies like community violence interruption—trusted messengers breaking the cycle of violence and trauma and giving young people hope.  

We should all agree: The answer is not to Defund the police. The answer is to FUND the police with the resources and training they need to protect our communities. 

I ask Democrats and Republicans alike: Pass my budget and keep our neighborhoods safe.  

And I will keep doing everything in my power to crack down on gun trafficking and ghost guns you can buy online and make at home—they have no serial numbers and can’t be traced. 

And I ask Congress to pass proven measures to reduce gun violence. Pass universal background checks. Why should anyone on a terrorist list be able to purchase a weapon? 

Ban assault weapons and high-capacity magazines. 

Repeal the liability shield that makes gun manufacturers the only industry in America that can’t be sued. 

These laws don’t infringe on the Second Amendment. They save lives. 

The most fundamental right in America is the right to vote – and to have it counted. And it’s under assault. 

In state after state, new laws have been passed, not only to suppress the vote, but to subvert entire elections. 

We cannot let this happen. 

Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. 

Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service. 

One of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court. 

And I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation’s top legal minds, who will continue Justice Breyer’s legacy of excellence. 

A former top litigator in private practice. A former federal public defender. And from a family of public school educators and police officers. A consensus builder. Since she’s been nominated, she’s received a broad range of support—from the Fraternal Order of Police to former judges appointed by Democrats and Republicans. 

And if we are to advance liberty and justice, we need to secure the Border and fix the immigration system. 

We can do both. At our border, we’ve installed new technology like cutting-edge scanners to better detect drug smuggling.  

We’ve set up joint patrols with Mexico and Guatemala to catch more human traffickers.  

We’re putting in place dedicated immigration judges so families fleeing persecution and violence can have their cases heard faster. 

We’re securing commitments and supporting partners in South and Central America to host more refugees and secure their own borders. 

We can do all this while keeping lit the torch of liberty that has led generations of immigrants to this land—my forefathers and so many of yours. 

Provide a pathway to citizenship for Dreamers, those on temporary status, farm workers, and essential workers. 

Revise our laws so businesses have the workers they need and families don’t wait decades to reunite. 

It’s not only the right thing to do—it’s the economically smart thing to do. 

That’s why immigration reform is supported by everyone from labor unions to religious leaders to the U.S. Chamber of Commerce. 

Let’s get it done once and for all. 

Advancing liberty and justice also requires protecting the rights of women. 

The constitutional right affirmed in Roe v. Wade—standing precedent for half a century—is under attack as never before. 

If we want to go forward—not backward—we must protect access to health care. Preserve a woman’s right to choose. And let’s continue to advance maternal health care in America. 

And for our LGBTQ+ Americans, let’s finally get the bipartisan Equality Act to my desk. The onslaught of state laws targeting transgender Americans and their families is wrong. 

As I said last year, especially to our younger transgender Americans, I will always have your back as your President, so you can be yourself and reach your God-given potential. 

While it often appears that we never agree, that isn’t true. I signed 80 bipartisan bills into law last year. From preventing government shutdowns to protecting Asian-Americans from still-too-common hate crimes to reforming military justice. 

And soon, we’ll strengthen the Violence Against Women Act that I first wrote three decades ago. It is important for us to show the nation that we can come together and do big things. 

So tonight I’m offering a Unity Agenda for the Nation. Four big things we can do together.  

First, beat the opioid epidemic. 

There is so much we can do. Increase funding for prevention, treatment, harm reduction, and recovery.  

Get rid of outdated rules that stop doctors from prescribing treatments. And stop the flow of illicit drugs by working with state and local law enforcement to go after traffickers. 

If you’re suffering from addiction, know you are not alone. I believe in recovery, and I celebrate the 23 million Americans in recovery. 

Second, let’s take on mental health. Especially among our children, whose lives and education have been turned upside down.  

The American Rescue Plan gave schools money to hire teachers and help students make up for lost learning.  

I urge every parent to make sure your school does just that. And we can all play a part—sign up to be a tutor or a mentor. 

Children were also struggling before the pandemic. Bullying, violence, trauma, and the harms of social media. 

As Frances Haugen, who is here with us tonight, has shown, we must hold social media platforms accountable for the national experiment they’re conducting on our children for profit. 

It’s time to strengthen privacy protections, ban targeted advertising to children, demand tech companies stop collecting personal data on our children. 

And let’s get all Americans the mental health services they need. More people they can turn to for help, and full parity between physical and mental health care. 

Third, support our veterans. 

Veterans are the best of us. 

I’ve always believed that we have a sacred obligation to equip all those we send to war and care for them and their families when they come home. 

My administration is providing assistance with job training and housing, and now helping lower-income veterans get VA care debt-free.  

Our troops in Iraq and Afghanistan faced many dangers. 

One was stationed at bases and breathing in toxic smoke from “burn pits” that incinerated wastes of war—medical and hazard material, jet fuel, and more. 

When they came home, many of the world’s fittest and best trained warriors were never the same. 

Headaches. Numbness. Dizziness. 

A cancer that would put them in a flag-draped coffin. 

I know. 

One of those soldiers was my son Major Beau Biden. 

We don’t know for sure if a burn pit was the cause of his brain cancer, or the diseases of so many of our troops. 

But I’m committed to finding out everything we can. 

Committed to military families like Danielle Robinson from Ohio. 

The widow of Sergeant First Class Heath Robinson.  

He was born a soldier. Army National Guard. Combat medic in Kosovo and Iraq. 

Stationed near Baghdad, just yards from burn pits the size of football fields. 

Heath’s widow Danielle is here with us tonight. They loved going to Ohio State football games. He loved building Legos with their daughter. 

But cancer from prolonged exposure to burn pits ravaged Heath’s lungs and body. 

Danielle says Heath was a fighter to the very end. 

He didn’t know how to stop fighting, and neither did she. 

Through her pain she found purpose to demand we do better. 

Tonight, Danielle—we are. 

The VA is pioneering new ways of linking toxic exposures to diseases, already helping more veterans get benefits. 

And tonight, I’m announcing we’re expanding eligibility to veterans suffering from nine respiratory cancers. 

I’m also calling on Congress: pass a law to make sure veterans devastated by toxic exposures in Iraq and Afghanistan finally get the benefits and comprehensive health care they deserve. 

And fourth, let’s end cancer as we know it. 

This is personal to me and Jill, to Kamala, and to so many of you. 

Cancer is the #2 cause of death in America–second only to heart disease. 

Last month, I announced our plan to supercharge  
the Cancer Moonshot that President Obama asked me to lead six years ago. 

Our goal is to cut the cancer death rate by at least 50% over the next 25 years, turn more cancers from death sentences into treatable diseases.  

More support for patients and families. 

To get there, I call on Congress to fund ARPA-H, the Advanced Research Projects Agency for Health. 

It’s based on DARPA—the Defense Department project that led to the Internet, GPS, and so much more.  

ARPA-H will have a singular purpose—to drive breakthroughs in cancer, Alzheimer’s, diabetes, and more. 

A unity agenda for the nation. 

We can do this. 

My fellow Americans—tonight , we have gathered in a sacred space—the citadel of our democracy. 

In this Capitol, generation after generation, Americans have debated great questions amid great strife, and have done great things. 

We have fought for freedom, expanded liberty, defeated totalitarianism and terror. 

And built the strongest, freest, and most prosperous nation the world has ever known. 

Now is the hour. 

Our moment of responsibility. 

Our test of resolve and conscience, of history itself. 

It is in this moment that our character is formed. Our purpose is found. Our future is forged. 

Well I know this nation.  

We will meet the test. 

To protect freedom and liberty, to expand fairness and opportunity. 

We will save democracy. 

As hard as these times have been, I am more optimistic about America today than I have been my whole life. 

Because I see the future that is within our grasp. 

Because I know there is simply nothing beyond our capacity. 

We are the only nation on Earth that has always turned every crisis we have faced into an opportunity. 

The only nation that can be defined by a single word: possibilities. 

So on this night, in our 245th year as a nation, I have come to report on the State of the Union. 

And my report is this: the State of the Union is strong—because you, the American people, are strong. 

We are stronger today than we were a year ago. 

And we will be stronger a year from now than we are today. 

Now is our moment to meet and overcome the challenges of our time. 

And we will, as one people. 

One America. 

The United States of America. 

May God bless you all. May God protect our troops.

@mrinterestfull
Copy link

Hello
yes, that code works.
Getting loser:

Breaking it down:

org:
splits = text_splitter.split_documents(docs)
vectordb = Chroma.from_documents(
documents=splits,
embedding=embedding,
persist_directory=persist_directory
)

yours:
documents = text_splitter.split_documents(raw_documents)
db = Chroma.from_documents(
documents,
OpenAIEmbeddings()
)

The difference is that I'm passing persistent_directory...you are not.

This does now work:
vectordb = Chroma.from_documents(
documents=splits,
embedding=embedding,
)

#vectordb.persist()

but what is the new syntax for making sure the chromadb is saved in a folder.
Per documents in langchain:
https://python.langchain.com/docs/integrations/vectorstores/chroma#basic-example-including-saving-to-disk
you do that by passing
persist_directory="./chroma_db"
which trigger original error.

And if I look at chroma docs, they use client.

Note we are importing:
from langchain.vectorstores import Chroma

Thanks
Lucas

@jeffchuber
Copy link
Contributor

jeffchuber commented Oct 27, 2023

using the same script i posted above, and adding

db = Chroma.from_documents(
    documents, 
    OpenAIEmbeddings(), 
    persist_directory='sotu_db' # new
    )

still executes perfectly.

here is the integration to prove that it should support this

https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/vectorstores/chroma.py

sorry im not sure what else to say

@mrinterestfull
Copy link

Thank you!!!!!!!!!!!!!!!!!!!!

Well, this was crazy ride, but the final answer is :

langchain 0.0.228
chromadb 0.4.15
has the issue with "deprecated old config"
vs
langchain 0.0.325
chromadb 0.4.15

does not have any issues.

So the issue was langchain all along even do the error is coming from chroma. I guess implementation in in 228 had the problem.

Its unclear to me why pip install langchain (maybe early in a week when I re-created virtualenv would pull 0.228 version from July instead of any of the Oct versions).

nonetheless

Thank you for the time. The imports of version lines were the most critical. guess next time I'll start there first.
pip install langchain --upgrade

solves the issue and

vectordb = Chroma.from_documents(
    documents=splits,
    embedding=embedding,
    persist_directory="./chroma_db"
)

vectordb.persist()

now works without a problem in a same-way as deeplearning.ai tutorial.

@jeffchuber
Copy link
Contributor

@lszyba1 glad to hear :)

@mrinterestfull
Copy link

Should this ticket be closed?
Since it references the error that is now solved. Keeping it open would maybe cause additional confusion as to whether this is still active bug or just archive.

Thanks
Lucas

@rtomaf
Copy link

rtomaf commented Nov 1, 2023

Still getting:

ValueError: You are using a deprecated configuration of Chroma.

langchain==0.0.329, chromadb==0.4.15.

File that fails is super simple

vector_store = Chroma()

Nothing else. If I do something similar with Pinecone, it doesn't fail.

Any clue or where to look for?

@jeffchuber
Copy link
Contributor

@rtomaf, im sorry im not able to reproduce this.

@rtomaf
Copy link

rtomaf commented Nov 5, 2023

Sorry, had an .env being loaded with:

chroma_db_impl='duckdb+parquet'

That made it complain

Copy link

dosubot bot commented Feb 9, 2024

Hi, @gpapp,

I'm helping the LangChain team manage their backlog and am marking this issue as stale. It seems like there has been a lot of discussion and troubleshooting around the compatibility issue with ChromaDB. Users have reported encountering errors related to deprecated configurations and attribute issues when using the latest versions of ChromaDB and LangChain. Some users have found success by downgrading to an older version of ChromaDB, while others have shared their settings and code snippets that have worked for them. The LangChain team has also provided guidance and suggestions for resolving the issue, including checking the versions of the libraries being used and ensuring proper configuration settings. The issue appears to be ongoing, with users continuing to seek assistance and share their experiences with different approaches.

Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you!

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Feb 9, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature Ɑ: vector store Related to vector store module
Projects
None yet
Development

No branches or pull requests