Inspiration

Hospital capacity pressure is difficult to understand quickly because bed occupancy, A&E activity, emergency admissions, and long waits often sit in separate datasets. We wanted to build a simple assistant that lets someone ask plain-English questions and receive useful answers based on stored NHS capacity data.

What it does

NHS Capacity Memory Agent helps users ask questions about bed pressure, A&E demand, short-term pressure trends, and previous conversations.

The system can answer questions such as:

  • Which region has the highest bed occupancy?
  • What is the likely A&E pressure trend over the next 3 months?
  • What did I ask earlier about capacity pressure?

It retrieves NHS capacity data from CockroachDB, uses AWS Bedrock to generate the answer, and saves useful interactions back into CockroachDB memory. It also includes vector memory so related previous questions can be found even when the wording is different.

How we built it

We built the project with:

  • CockroachDB Cloud for structured NHS data, conversation memory, and vector search
  • AWS Bedrock for answer generation
  • AWS Lambda for the deployed API
  • FastAPI for the backend
  • Vercel for the web interface
  • Python for data loading, forecasting, memory, and orchestration

The database stores national capacity snapshots, regional bed pressure, A&E activity, agent memory, vector embeddings, and recommendations.

What we are proud of

We are proud that this is not only a dashboard. It is a working assistant with a full loop:

  1. The user asks a question.
  2. The system retrieves relevant NHS data from CockroachDB.
  3. AWS Bedrock generates a clear answer.
  4. The answer is saved as memory.
  5. Later questions can use previous conversation history.

Challenges we faced

The main challenges were connecting the different parts cleanly: CockroachDB, AWS Bedrock, AWS Lambda, vector memory, and the frontend. We also had to handle safe environment variables, deployment settings, and make sure the answers stayed grounded in the available data.

What we learned

We learned how to structure an AI product around a real database, not only a prompt. We also learned how CockroachDB can support both normal SQL queries and vector memory in the same system.

What's next

Next, we would improve the forecasting model, add more NHS datasets, build richer operational recommendations, and add a more detailed analytics view for NHS capacity planning teams.

Built With

Share this project:

Updates