Skip to content

Instantly share code, notes, and snippets.

@dewmal
Created January 12, 2025 16:18
Show Gist options
  • Save dewmal/e8f0296bd9743d3fa9dd5841a65d3cdd to your computer and use it in GitHub Desktop.
Save dewmal/e8f0296bd9743d3fa9dd5841a65d3cdd to your computer and use it in GitHub Desktop.
Building a RAG System with Ollama and LanceDB: A Comprehensive Tutorial
import asyncio
import httpx
import lancedb
import pandas as pd
from abc import ABC, abstractmethod
from typing import List, Dict, Any, AsyncGenerator, Optional
from lancedb.pydantic import LanceModel, Vector
from lancedb.embeddings import EmbeddingFunctionRegistry
# Base Classes
class LLM(ABC):
@abstractmethod
async def generate(self, prompt: str, system_prompt: Optional[str] = None) -> str:
"""Generate a response for the given prompt"""
pass
@abstractmethod
async def streaming_generate(self, prompt: str, system_prompt: Optional[str] = None) -> AsyncGenerator[str, None]:
"""Generate a streaming response for the given prompt"""
pass
class Embedder(ABC):
@abstractmethod
async def embed_documents(self, documents: List[str]) -> List[List[float]]:
"""Embed a list of documents"""
pass
@abstractmethod
async def embed_query(self, query: str) -> List[float]:
"""Embed a single query"""
pass
class VectorStore(ABC):
@abstractmethod
async def store_embeddings(self, documents: List[str], embeddings: List[List[float]],
metadata: List[Dict[str, Any]] = None) -> None:
"""Store document embeddings with optional metadata"""
pass
@abstractmethod
async def search(self, query_embedding: List[float], limit: int = 3) -> List[Dict[str, Any]]:
"""Search for similar documents using query embedding"""
pass
# Ollama LLM Implementation
class AsyncOllamaLLM(LLM):
def __init__(self, model_name: str = "llama3.1", base_url: str = "http://localhost:11434"):
self.model_name = model_name
self.base_url = base_url
self.client = httpx.AsyncClient()
async def _post_request(self, endpoint: str, payload: Dict[str, Any]) -> Dict[str, Any]:
response = await self.client.post(
f"{self.base_url}/{endpoint}",
json=payload
)
return response.json()
async def generate(self, prompt: str, system_prompt: Optional[str] = None) -> str:
messages = []
if system_prompt:
messages.append({"role": "system", "content": system_prompt})
messages.append({"role": "user", "content": prompt})
response = await self._post_request("api/chat", {
"model": self.model_name,
"messages": messages,
"stream": False
})
return response['message']['content']
async def streaming_generate(self, prompt: str, system_prompt: Optional[str] = None) -> AsyncGenerator[str, None]:
messages = []
if system_prompt:
messages.append({"role": "system", "content": system_prompt})
messages.append({"role": "user", "content": prompt})
async with self.client.stream(
"POST",
f"{self.base_url}/api/chat",
json={
"model": self.model_name,
"messages": messages,
"stream": True
}
) as response:
async for line in response.aiter_lines():
if line.strip():
chunk = httpx.json.loads(line)
yield chunk['message']['content']
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc_val, exc_tb):
await self.client.aclose()
# Ollama Embedder Implementation
class AsyncOllamaEmbedder(Embedder):
def __init__(self, model_name: str = "mxbai-embed-large", base_url: str = "http://localhost:11434"):
self.model_name = model_name
self.base_url = base_url
self.client = httpx.AsyncClient()
# Initialize LanceDB registry and embedder
registry = EmbeddingFunctionRegistry.get_instance()
self._lance_embedder = registry.get("ollama").create(name=model_name)
@property
def SourceField(self):
return self._lance_embedder.SourceField
@property
def VectorField(self):
return self._lance_embedder.VectorField
def ndims(self):
return self._lance_embedder.ndims()
async def _get_embedding(self, text: str) -> List[float]:
response = await self.client.post(
f"{self.base_url}/api/embeddings",
json={
"model": self.model_name,
"prompt": text
}
)
return response.json()['embedding']
async def embed_documents(self, documents: List[str]) -> List[List[float]]:
embeddings = []
for doc in documents:
embedding = await self._get_embedding(doc)
embeddings.append(embedding)
return embeddings
async def embed_query(self, query: str) -> List[float]:
return await self._get_embedding(query)
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc_val, exc_tb):
await self.client.aclose()
# LanceDB Vector Store Implementation
def create_lance_schema(embedder):
class LanceDBSchema(LanceModel):
text: str = embedder.SourceField()
vector: Vector(embedder.ndims()) = embedder.VectorField()
index: int
title: str
url: str
return LanceDBSchema
class AsyncLanceDBStore(VectorStore):
def __init__(self, embedder, db_path: str = "./lancedb", table_name: str = "documents"):
self.db = lancedb.connect(db_path)
self.table_name = table_name
self.table = None
self._lock = asyncio.Lock()
self.schema = create_lance_schema(embedder)
async def store_embeddings(self, documents: List[str], embeddings: List[List[float]],
metadata: List[Dict[str, Any]] = None) -> None:
if metadata is None:
metadata = [{"title": "", "url": "", "index": i} for i in range(len(documents))]
table_name = self.db.table_names()
if self.table_name in table_name:
self.table = self.db.open_table(self.table_name)
data = []
for doc, emb, meta in zip(documents, embeddings, metadata):
data.append({
"text": doc,
"vector": emb,
"index": meta.get("index", 0),
"title": meta.get("title", ""),
"url": meta.get("url", "")
})
async with self._lock:
if self.table is None:
self.table = await asyncio.to_thread(
self.db.create_table,
self.table_name,
data=data,
schema=self.schema.to_arrow_schema()
)
else:
await asyncio.to_thread(self.table.add, data)
async def search(self, query_embedding: List[float], limit: int = 3) -> List[Dict[str, Any]]:
if self.table is None:
raise ValueError("No documents have been stored yet")
async with self._lock:
results = await asyncio.to_thread(
lambda: self.table.search(query_embedding)
.limit(limit)
.to_pydantic(self.schema)
)
return [
{
"text": r.text,
"title": r.title,
"url": r.url,
"index": r.index
}
for r in results
]
# Component Factory
class AsyncComponentFactory:
def __init__(self, config: Dict[str, Any]):
self.config = config
@staticmethod
async def create_llm(type: str, **kwargs) -> LLM:
if type == "ollama":
return AsyncOllamaLLM(**kwargs)
raise ValueError(f"Unknown LLM type: {type}")
@staticmethod
async def create_embedder(type: str, **kwargs) -> Embedder:
if type == "ollama":
return AsyncOllamaEmbedder(**kwargs)
raise ValueError(f"Unknown embedder type: {type}")
@staticmethod
async def create_vector_store(type: str, embedder: Embedder, **kwargs) -> VectorStore:
if type == "lancedb":
return AsyncLanceDBStore(embedder=embedder, **kwargs)
raise ValueError(f"Unknown vector store type: {type}")
# Main RAG System
class BBCNewsRAG:
def __init__(self, config: Dict[str, Any]):
self.config = config
self.factory = AsyncComponentFactory(config)
self.llm = None
self.embedder = None
self.vector_store = None
async def initialize(self):
"""Initialize all RAG components"""
self.llm = await self.factory.create_llm(**self.config["llm"])
self.embedder = await self.factory.create_embedder(**self.config["embedder"])
self.vector_store = await self.factory.create_vector_store(
embedder=self.embedder,
**self.config["vector_store"]
)
async def ingest_data(self, df: pd.DataFrame):
"""Ingest the BBC news data from pandas DataFrame into the vector store"""
documents = df['text'].tolist()
embeddings = await self.embedder.embed_documents(documents)
metadata = df.apply(
lambda row: {
'title': row['title'],
'url': row['url'],
'index': row['index']
},
axis=1
).tolist()
await self.vector_store.store_embeddings(
documents=documents,
embeddings=embeddings,
metadata=metadata
)
async def query(self, question: str, system_prompt: str = None) -> str:
"""Query the RAG system"""
query_embedding = await self.embedder.embed_query(question)
results = await self.vector_store.search(query_embedding)
response = await self.llm.generate(
prompt=f"Question: {question}\nContext: {results}",
system_prompt=system_prompt or "Answer the question based on the provided context."
)
return response
async def close(self):
"""Clean up resources"""
if self.llm:
await self.llm.__aexit__(None, None, None)
if self.embedder:
await self.embedder.__aexit__(None, None, None)
# Example usage
async def main():
# Configuration
config = {
"llm": {
"type": "ollama",
"model_name": "llama3.2"
},
"embedder": {
"type": "ollama",
"model_name": "nomic-embed-text"
},
"vector_store": {
"type": "lancedb",
"db_path": "./data/lancedb",
"table_name": "documents"
}
}
# Create RAG instance
rag = BBCNewsRAG(config)
await rag.initialize()
try:
# Read data using pandas
df = pd.read_csv('data/data.txt')
# Ingest data
await rag.ingest_data(df)
# Example query
question = "Who is Aarin Chiekrie? What does he do?"
response = await rag.query(
question,
system_prompt="You are a helpful assistant that provides accurate information about the BBC news based on the provided articles."
)
print(f"Question: {question}")
print(f"Answer: {response}")
finally:
# Clean up
await rag.close()
if __name__ == "__main__":
asyncio.run(main())
@dewmal
Copy link
Author

dewmal commented Jan 12, 2025

Data Set

url,title,index,text
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,0,Shoppers have said they hope a council's plans for a deserted store will boost the appeal of their high street.
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,1,The mayor of Bedford has outlined plans to convert a former Debenhams - purchased by a council for about £1.8m - into smaller commercial spaces and housing. 
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,2,"Tom Wootton, the elected Conservative mayor, said: ""It's going make a difference to the town - it's going to bring people in."""
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,3,"Supporting the proposed redevelopment, Alex Reader, 29, from Bedford, commented: ""We need a reason to come into town."""
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,4,"Mr Wootton said the short term plan was to get businesses into the space by Christmas and the long term plan was to keep the outside, knock it down inside and ""build shops on the ground floor and flats and apartments above""."
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,5,"He said Bedford Borough Council purchased the property, which closed in May 2021, ""very cheap because it was so run down"" and the money had come from ""earmarked reserves"" and the former government's Towns Fund project. "
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,6,"""It's a massive space, a massive part of Bedford, part of Bedford's history, but also Bedford's future because you cannot have this sort of size of place in the middle of the high street shut up for years."""
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,7,"He said by the end of the year smaller shopping spaces would be created and he wanted anyone with ideas to ""come and talk to us - we're all ears""."
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,8,"Mr Wootton said the renovation was ""going to cost a lot of money"" as the building was water damaged."
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,9,"""We're really keen that we get people living in town, as that's the thing that is going to pay for this redevelopment,"" he added."
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,10,"Giving her reaction, Ms Reader, who was in the town centre, said: ""I think it's important that we start reopening these shops. "
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,11,"""It's an eyesore when you just see shut doors."""
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,12,"She said she would prefer to see ""family-orientated"" businesses, such as play areas. "
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,13,"Lauren Steels, 32, a mother from the town, said she wanted to see ""more local stores and less chains, more of a market town look"". "
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,14,"""We've got lots of cafes and restaurants. It would be nice to have something a bit unique and bit different and something to entertain, not just shops."""
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,15,"Wasem Sebi, founder of Simply Creative Agency on Bedford High Street, said: ""Ensuring the right mix of retail and residential space is crucial to meet the needs of the Bedford community without over-saturating the housing sector."""
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,16,"He said the plans could ""transform"" the area, bring ""new life to the town centre"" and could help create ""a more dynamic and diverse urban environment"". "
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,17,Kay Orton said she rarely came into town since Marks & Spencer closed its doors in May 2019. 
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,18,"She said converting the empty store was ""positive"" but it ""all depends what the shops are""."
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,19,She said more variety could coax her back to the town centre. 
https://www.bbc.com/news/articles/clylqly0n28o,Bedford Debenhams plan: 'We need a reason to come into town' - BBC News,20,"Follow Beds, Herts and Bucks news on BBC Sounds, Facebook, external, Instagram, external and X, external."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,21,"The Spectator has been sold for £100m to Sir Paul Marshall, a hedge fund tycoon and major investor in GB News."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,22,"He beat around 20 other bidders to buy the right-leaning magazine, once edited by former Prime Minister Boris Johnson."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,23,It went back on sale in April after an Abu Dhabi-backed bid to buy it along with the Daily Telegraph and the Sunday Telegraph collapsed.
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,24,This came after the government intervened in January. Legislation banning foreign states from owning UK newspapers soon followed.
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,25,That deal would have transferred the ownership to the Gulf-backed Redbird IMI consortium.
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,26,"The Telegraph newspapers remain for sale, and Sir Paul is also in the running to buy those as he continues his bid to build an empire of right-wing media outlets. "
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,27,Others thought to be among the bidders include Rupert Murdoch’s News UK and former chancellor Nadhim Zahawi.
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,28,"After the deal was announced, Spectator chairman Andrew Neil said he would resign with immediate effect, having previously stated that hedge funds should not be allowed to own news publications because of the risk of conflict of interest."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,29,"""I made it clear many months ago that I would step down when a new owner took over. That time has now come,"" he posted on X, external, formerly Twitter."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,30,"The Spectator was established in 1828, making it one of the oldest politics and current affairs magazines in the world."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,31,"Sir Paul, who is buying the magazine through his Old Queen Street (OQS) media group, said: “As a long-term Spectator reader, I am delighted it is joining the OQS stable. "
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,32,"""The plan is for OQS to make good previous underinvestment in one of the world’s great titles."""
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,33,"Sir Paul started work in the City and set up his own hedge fund with business partner Ian Wace in 1997. According to Wace, a ""considerable proportion"" of the first $50m they had under management came from the famous investor and philanthropist George Soros."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,34,"Worth an estimated £875m, Sir Paul is not that well known outside the financial and political worlds. He is probably less famous than his son Winston, a former member of the folk-rock band Mumford & Sons."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,35,"A devout Christian, Sir Paul is also known for his philanthropy, co-founding the children's educational charity ARK, and donating millions to set up the Marshall Institute for Philanthropy and Social Entrepreneurship."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,36,In 2016 he was knighted for services to education and philanthropy.
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,37,"Politically, he was a member of the Liberal Democrats for many years, and in 1987 he stood to be an MP for the SDP, a forerunner of the party."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,38,"By 2016 his allegiance had switched to the Conservative Party and he was a supporter of Brexit, donating £100,000 to the Leave campaign."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,39,"In 2017 he founded the news website UnHerd, and he has invested tens of millions of pounds in GB News since its launch in 2021."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,40,"Earlier this year he was accused of liking or reposting tweets that appeared to be anti-Muslim in sentiment. He apologised and said the tweets were not representative of his views, but he was widely criticised. Former Guardian editor Alan Rusbridger said the ""hateful ‘likes’ make him unfit to be a media mogul, external""."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,41,LISTEN: Profile - Sir Paul Marshall
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,42,"Current Spectator editor Fraser Nelson told the BBC's World at One programme he felt ""pretty confident"" about the new owner."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,43,"""What you want in a proprietor is somebody who is willing to invest, who is willing to have the confidence in what the journalists are doing, and also is willing to protect editorial independence. And there’s not the slightest suggestion that Paul Marshall isn’t willing to do that,"" he said."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,44,"""The idea that he’s going to turn it into anything other than the journalistic enterprise which it is is just for the birds."""
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,45,"The Spectator and the Telegraph papers were put up for sale last year when they were seized by Lloyds Banking Group from long-time owners the Barclay family, who had failed to pay back a loan of more than £1bn."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,46,"They were sold to RedBird IMI in a deal which valued the publications at around £600m, before the government intervened and passed legislation, prompting RedBird to halt the takeover and put them back up for sale."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,47,"As a weekly news publication, the Spectator is not defined as a ""newspaper"" under the Enterprise Act and therefore does not fall within scope of the culture secretary’s powers to examine media mergers in the public interest."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,48,"""It is essential that the availability of a wide range of accurate and high-quality news and perspectives can be protected, and that the regime we have in place is equipped to keep up with changes and development in our media landscape,"" a spokesperson for the Department for Digital, Culture, Media and Sport said."
https://www.bbc.com/news/articles/cn8l35xl1l2o,GB News owner Sir Paul Marshall buys Spectator magazine for £100m - BBC News,49,"""The culture secretary is now considering recommendations previously put forward by the independent regulator Ofcom on the function of the current regime."""
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,50,"Barratt Developments, the UK's largest housebuilder, saw a sharp drop in profits after it built far fewer homes last year."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,51,"It completed just 14,000 in the year to June, compared to 17,000 for the previous 12 months, and says the total will be lower again next year."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,52,"Pre-tax profit fell by three quarters for the year, which Barratt blamed on high interest rates putting off housebuyers and inflation pushing up costs."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,53,"The completion figures pose a problem for the new Labour government's pledge to ""get Britain building""."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,54,"Chief executive David Thomas said the firm was ""well-positioned to meet the strong underlying demand for new homes""."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,55,"However, the firm forecasts it will only finish between 13,000 and 13,500 new homes next year."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,56,"The government has made increasing the supply of housing a priority, pledging to build 1.5 million more homes in England over the next five years."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,57,"It has promised to reform the planning process, free up parts of the green belt, and reintroduce mandatory housing targets for local authorities."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,58,"Mr Thomas said the firm welcomed the government's proposed reforms of the planning system as a ""key lever to increase house building, drive economic growth and tackle the chronic under-supply of high-quality, sustainable homes""."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,59,"The government hopes changes to planning policy will increase housebuilding, but Barratt's results show the extent to which mortgage rates affect how much it decides to build."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,60,"Aarin Chiekrie, an equity analyst at Hargreaves Lansdown, said Barratt's numbers were ""a painful read for investors"" despite being in line with market expectations."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,61,"""With fewer homes being sold and at lower prices, less cash has come through the front door,"" he wrote in a note."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,62,"""With a new government now in power, there’s increased hope that some of the issues hindering housebuilders, like planning regulations, can be fixed,"" he said."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,63,"""But further easing of mortgage rates will be necessary for activity to pick up significantly,"" he added."
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,64,Barratt also revealed a jump in the cash it has set aside for cladding removal as it continues to probe its buildings following the Grenfell fire tragedy.
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,65,"Having assessed 53% of its buildings, it says its ""current best estimate"" for the final cost of fixing them £628m, much higher than the £536m it had calculated last year. "
https://www.bbc.com/news/articles/c8rx23jdkd5o,Barratt: Biggest UK housing firm to build fewer homes - BBC News,66,"Barratt is in the process of acquiring fellow housebuilder Redrow, although the deal is still awaiting approval from the competition regulator."
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,67,People have been encouraged to register for a conference that aims to provide insights into the Isle of Man government's future plans.
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,68,"The 2024 Government Conference, which is set to take place on 17 and 18 September from 08:00 to 17:00 BST at the Comis Hotel in Santon, will focus on business and the economy."
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,69,"Cabinet Office Minister Kate Lord-Brennan said this year's event was ""geared towards the business community"" and was an ""important opportunity"" to provide updates on several topics."
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,70,"The combination of presentations, panel sessions and roundtable discussions would allow attendees to ""connect directly"" with ministers and key speakers, she said."
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,71,"The third annual event will also provide an opportunity to discuss island security, air and sea connectivity ambitions and the future delivery of public services."
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,72,"The conference is set to include panel discussions with Chief Minister Alfred Cannan and Treasury Minister Alex Allinson, as well as an update on the island's economic development initiatives by Enterprise Minister Tim Johnston."
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,73,"As part of the event, workshops will be held by representatives of the Institute of Directors Isle of Man on enhancing the island's business and economic proposition."
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,74,"Representatives from the Isle of Man Steam Packet Company and the airport will also be involved in panel discussions, and presentations will be provided with updates on preventing organised crime and the island's immigration services and enforcement."
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,75,Attendees can register for individual sessions or for a whole day.
https://www.bbc.com/news/articles/c5y53e7m3j7o,People encouraged to 'connect' with government at annual conference - BBC News,76,"Why not follow BBC Isle of Man on Facebook, external and X, external? You can also send story ideas to IsleofMan@bbc.co.uk"
https://www.bbc.com/news/articles/c4gvpy3yz1yo,EE tells parents not to give smartphones to primary-age children - BBC News,77,One of the UK's largest mobile network providers is advising parents not to give primary school-aged children their own smartphone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment