amsterdam dreams:
My "Codegeist Unleashed" Journey

I have always wanted to travel to the land of street herring, quaint wooden shoes, and endless canals 🇳🇱🇳🇱🇳🇱Although I ultimately found working with Forge to be satisfyingly difficult, yet supremely rewarding, the trip to Amsterdam inspired me to start coding!I detailed my strenuous 4 day journey to create, what I hope will be, a winning submission for Codegeist 2023!

inspiration

A few weeks before I entered this hackathon, I had been experimenting with AI apps and chatbots. One of the concepts I learned about along the way was vector databases. Vector databases, I learned, were essential to any AI application that needed to reference large amounts of data fast. Using these results in a much faster application than referencing plain text alone.After sitting and meditating on several ideas that came to me after reviewing the Forge documentation, I saw the opportunity to create a way for a chatbot to interact with data on Confluence. It would fit nicely into the hackathon's requirements, as this idea would use OpenAI's API (along with some other tech).

Development

Thanks to Dugald Morrow's quickstart guides and example code, I was able to get a huge headstart on knowing where to implement the functions necessary for Conjure. I spent a full 4 days of work on the app. Here's roughly how this went down:

Day 1

  • Created the project files based on the quickstart repo.

  • Ran many tests to make sure my idea was going to work.

  • Heavily modified the quickstart after studying it and all of its routes and paths.

Day 2

  • Lots of coding. Created a backend API that upserts a Confluence page into Pinecone.

  • I wanted to incorporate "Responsible AI", so I came to develop a small JS algorithm that will check for any potentially sensitive info on the page. This avoids accidentally uploading API keys and other data to third party servers.

  • Deployed my backend to Vercel. I needed to use the Pinecone node package, so this required a separate backend service that allowed me to install any node packages.

Day 3

  • Coding, implementation

  • Started thinking about my video presentation

  • Felt very overwhelmed at the depth of this contest, but pushed through because I knew I was already halfway through

  • More coding (more frustrations that were eventually overcome 😉)

  • Finally, at the end of the day, I had a working Forge app and deployed it to production.

Day 4

  • Recorded my video using Dropbox Capture. I hate recording video walkthroughs and always feel like I mess up, so this took several attempts. I refuse to use a script because it comes off unnatural to me, so I did my best to "wing it"

  • Put together this journal entry

  • Assembled the final pieces for my submission and sent it off!

And without further ado, here's my submission video!

How to use

You can set these environment variables as such:forge variables set --encrypt OPEN_API_KEY your-keyforge variables set --encrypt PINECONE_INDEX_NAME your-keyforge variables set --encrypt PINECONE_ENV_NAME your-keyforge variables set --encrypt PINECONE_API_KEY your-keyexport FORGE_USER_VAR_OPEN_API_KEY=your-keyThese are referenced in the src/config.ts file.

cd [app-folder]
yarn
cd static/llm-ui
yarn
yarn build
cd ../..
forge register
forge deploy
forge install

  • Navigate to any Confluence page.

  • In the context byline near the top, click the "Upsert" link.

  • Your document is now in the database!

  • It's time to setup our chatbot.

  • Install Flowise AI.

  • Install this Chatflow template from the repo.

  • Add your credentials for Open AI and Pinecone to Flowise.

  • In Flowise, click the </> embed button.

  • Use this embed code to add your chatbot to any website!