Skip to content

kristianfreeman/d1-memory-langchainjs-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example application showing how to use a Langchain chain with a Cloudflare D1-driven memory store.

The relevant code can be found in worker.js. Note that the Langchain integration will instantiate a new table and manage it for you -- all you need to do is set up your own D1 database with relevant database_id, as seen in wrangler.toml:

$ npx wrangler d1 database create YOUR_DB_NAME

You will also need to pass in an OPENAI_API_KEY as a secret:

$ echo "API_KEY_HERE" | npx wrangler secret put OPENAI_API_KEY

About

d1-memory-langchainjs-example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published