The connection string is likely in the form:token="..."conn_str = f"duckdb:///md:{token}@my_db"SQLChain‚ÄãYou can use the SQLChain to query data in your Motherduck instance in natural language.from langchain.llms import OpenAI, SQLDatabase, SQLDatabaseChaindb = SQLDatabase.from_uri(conn_str)db_chain = SQLDatabaseChain.from_llm(OpenAI(temperature=0), db, verbose=True)From here, see the SQL Chain documentation on how to use.LLMCache‚ÄãYou can also easily use Motherduck to cache LLM requests.
Once again this is done through the SQLAlchemy wrapper.import sqlalchemyfrom langchain.globals import set_llm_cacheeng = sqlalchemy.create_engine(conn_str)set_llm_cache(SQLAlchemyCache(engine=eng))From here, see the LLM Caching documentation on how to use.PreviousMongoDB AtlasNextMot√∂rheadInstallation and SetupSQLChainLLMCacheCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
Motherduck is a managed DuckDB-in-the-cloud service.
Motherduck is a managed DuckDB-in-the-cloud service. ->: The connection string is likely in the form:token="..."conn_str = f"duckdb:///md:{token}@my_db"SQLChain‚ÄãYou can use the SQLChain to query data in your Motherduck instance in natural language.from langchain.llms import OpenAI, SQLDatabase, SQLDatabaseChaindb = SQLDatabase.from_uri(conn_str)db_chain = SQLDatabaseChain.from_llm(OpenAI(temperature=0), db, verbose=True)From here, see the SQL Chain documentation on how to use.LLMCache‚ÄãYou can also easily use Motherduck to cache LLM requests.
Once again this is done through the SQLAlchemy wrapper.import sqlalchemyfrom langchain.globals import set_llm_cacheeng = sqlalchemy.create_engine(conn_str)set_llm_cache(SQLAlchemyCache(engine=eng))From here, see the LLM Caching documentation on how to use.PreviousMongoDB AtlasNextMot√∂rheadInstallation and SetupSQLChainLLMCacheCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.