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?
