This project was inspired by Mark Tinderholt’s post on creating a JFK assassination chatbot using the JFK files. You can find it Here. As a Formula 1 fan, I wanted to understand the sport’s complex financial regulations more, and what better way of doing that than building a project around it? So I built a chatbot that lets me query the official FIA Formula 1 Financial Regulations PDF available on the FIA official website using natural language.

With AWS Kendra for document indexing and Amazon Bedrock’s Titan model for answering questions in a conversational style, I was able to turn a static document into a dynamic knowledge bot.

🚀 What I Built

A Python-based CLI application that:

  1. Queries AWS Kendra for relevant context.
  2. Uses Bedrock’s Amazon Titan Text G1 -Express model to generate chat-like answers.

🧠 Why This Project?

I wanted to:

  • Understand how to combine semantic search (Kendra) with LLMs (Bedrock).
  • understand how LLMs products are built
  • Make a dense PDF document more explorable.

🧪 Technologies Used

  • AWS S3 – To store the source PDF.
  • Amazon Kendra – As the search engine to index and retrieve document snippets.
  • Amazon Bedrock – To generate natural language answers based on Kendra’s output.
  • boto3 – AWS SDK for Python.

📝 Python Script Overview

  1. query_kendra(query_text, index_id) – Sends a query to Kendra and collects document excerpts.
  2. query_bedrock(query, context) – Sends context and query to Bedrock Titan to get a conversational response.
  3. kendra_bedrock_query(user_query, index_id) – Main function that stitches the two together.

🧱 Architecture Overview

Image description

  • CLI App (Python) → Kendra (document search) → Bedrock (contextual response)
  • S3 acts as the document repository
  • IAM roles/policies allow access to services

💡 What I Learned

  • Kendra doesn’t require Textract if the PDF text is extractable. I originally used Textract to index PDF files and store the index in S3 for Amazon Kendra to query. However, I later realized that Kendra can handle this process independently. Now, I only need Textract for specific cases, such as processing receipts or extracting text from images.
  • Bedrock’s Titan G1 Express can process large contexts and return quality responses. I would like to do this with a more powerful model to see the difference in responses. I felt some answers would have been better.

  • IAM permissions need to include both kendra, bedrock, logs, and s3 access for things to sync correctly.

🧾 Sample Question

Q: What is cost cap administration?

A: Cost Cap Administration is a process of cost control that involves setting a limit on the amount of money that can be spent on a project or activity. This limit is typically set by an external organization, such as a government agency or a regulatory body, and is designed to ensure that the project or activity is completed within the allocated budget. The Cost Cap Administration process typically involves the following steps:
1. Establishing the cost cap: The cost cap is set by the external organization that is responsible for managing the project or activity. This limit is typically based on a variety of factors, such as the expected costs of the project, the expected revenue, and the expected risks.
2. Monitoring the costs: The Cost Cap Administration team monitors the costs of the project or activity on a regular basis. This includes reviewing invoices, tracking expenses, and analyzing financial data.
3. Adjusting the costs: If the costs of the project or activity exceed the cost cap, the Cost Cap Administration team must take action to adjust the costs. This may include reducing the scope of the project, reducing the number of employees, or reducing the amount of time that the project is scheduled to take.
4. Reporting the costs: The Cost Cap Administration team must report the costs of the project or activity to the external organization that is responsible for managing the project or activity. This report must include a detailed breakdown of the costs, including the amount of money that was spent, the amount of money that was saved, and the reasons for the changes in costs.
5. Enforcing the cost cap: The Cost Cap Administration team must enforce the cost cap. This may include issuing fines or penalties to the project or activity if the costs exceed the cost cap.
6. Reviewing the cost cap: The Cost Cap Administration team must review the cost cap on a regular basis to ensure that it is still appropriate. This may include adjusting the cost cap based on changes in the project or activity, or adjusting the cost cap based on feedback from the external organization that is responsible for managing the project or activity.

In conclusion, the Cost Cap Administration process is a critical process for ensuring that a project or activity is completed within the allocated budget. It involves establishing the cost cap, monitoring the costs, adjusting the costs, reporting the costs, enforcing the cost cap, and reviewing the cost cap on a regular basis. By following these steps, the Cost Cap Administration team can help to ensure that the project or activity is successful and that the external organization that is responsible for managing the project or activity is satisfied with the results.

Q: How much is a team eligible to spend each year?

A: $15,000,000

Q: What is the punishment for cost cap breach?

A: Based on the provided content, the punishment for cost cap breach is sanctions.

Q: What are the sanctions for cost cap breach?

A: Based on the provided content, the sanctions for cost cap breach include a financial penalty.

📌 Future Improvements

  • Build a full web app around it
  • Support multi-document uploads. This would become a full F1 rules and regulations chatbot.
  • Save chat history

🔗 GitHub Repo

https://github.com/audu97/FIA-F1-financial-reg/tree/main


Thanks for reading! Feel free to fork the project, open issues, or suggest new directions!