Orbit

Ai Friends

For people who want to stay up to date on what is happening in the world of Artificial Intelligence

πŸ‘₯ 7 members

← πŸ’¬ General
Jim Hitch

2d ago Β· πŸ’¬ General

RAG exploration: A Telegram bot that answers questions about the US constitution.

I wanted to try my hand at RAG to learn.

My first idea was to make a new agent in openclaw and have it do this job. A key goal was for it to only answer from the document. This didn’t work. The openclaw agent is designed to be helpful and no matter what I put in the agent.md or soul.md it would answer questions outside of the constitution.

So I changed the plan and got much better results:

  • Aiogram for the telegram bot.
  • OpenAI for the vector embedding
  • OpenAI for the inference that includes the nearest/closest neighbors to the question.
  • Chroma for the vector database.

I’m pretty happy with the the result!

There’s one issue around the chunking. I used the default chunking settings. This kept the bot from correctly answering the question, β€˜who signed the constitution?’

It only brought back the list up until a page break in the pdf. I’m going to add some custom chunks and metadata to fix that.

Have you tried anything similar? What did you learn?

image

πŸ’¬ 0 comments

Log in to join the discussion.