mongodben / mongodb-oracle

The MongoDB Oracle 🧙‍♀️🔮🌱
https://mongodb-oracle.vercel.app
8 stars 3 forks source link

add API route to run queries from clients #2

Closed mongodben closed 1 year ago

mongodben commented 1 year ago

TypeScript/Next.js server routes with endpoint to respond to natural language user queries in natural language response with accurate data from the indexed site. Format answers in Markdown with links to relevant content on the site.

mongodben commented 1 year ago

there's a basic POC here - https://github.com/mongodben/mongodb-oracle/blob/main/pre-skunk-poc/generate-index/lib/test-query.ts

for LLM summary, this script uses "text-davinci-003", which is based on OpenAI GPT-3. it works fine.

we could likely get better results using:

  1. the brand new ChatGPT API (docs)
  2. use GPT 3.5 instead of GPT 3 (i'm not sure how this would work offhand)
mongodben commented 1 year ago

more than 90% sure we can marginally improve the results quality while reducing cost 10x by using the model "gpt-3.5-turbo" with 0 other changes.

mongodben commented 1 year ago

resolved by https://github.com/mongodben/mongodb-oracle/pull/19