• Tesla's CFO says tariffs would 'have an impact' on company's profitability
    www.cnbc.com
    Tesla's finance chief said on Wednesday that the company's profitability could take a hit if the new presidential administration implements tariffs.
    0 Yorumlar ·0 hisse senetleri ·32 Views
  • How execs can bridge the AI knowledge gap
    www.fastcompany.com
    From streamlining administrative tasks to enhancing brainstorming sessions, AI is becoming an essential workplace companion. Yet, despite its transformative promise, its integration isnt as simple as flipping a switch.We recently conducted research at Lucid Software to uncover AI usage in the workplace. We found that more than a third of workers globally are already using AI for fundamental tasks like generating ideas (39%), creating content (37%), communicating summaries (33%), and finding documentation (31%). When thinking about how weve adopted the technology into our products, our decade-long investment in intelligence has been key to building an AI-ready platform that automates data visualization and enables rapid iteration while aligning seamlessly with how people work.The true potential for AI to continue transforming daily tasks and even larger strategic work will only be possible if AI fits into employees workflows in iterative and practical ways that allow teams to master the technology.Employees feel optimistic about AIThe global survey of over 2,500 knowledge workers revealed critical insights about AIs growing impact on the workplace. Overall, the findings paint an optimistic picture: nearly two-thirds (63%) of employees view AI as the gateway to more fulfilling work and improved work-life balance.When we more deeply explored whats fueling this positive outlook, three key benefits emerged: 62% of employees highlight productivity gains, 40% value cost savings and tech stack consolidation, and 38% see enhanced communication and decision making.But what really caught my attention is the striking tangible impact on productivity; more than 50% of workers believe AI will save them at least three hours of work per week. Thats time they can plan to redirect and invest in strategic, higher-value initiatives. In fact, 45% of employees are already using AI to effectively advance projects. And while saving three hours per week is meaningful to workers, its likely just the beginning. As AI tools advance and adoption increases, the time saved could grow significantly in the years ahead.Barriers to AI adoption persistIn conversations with customers and prospects, weve noticed an interesting sentiment: While theyre excited about what AI can do, theyre overwhelmed by the number of available AI tools. This feedback underscores a key insightAI shouldnt feel like an extra layer of complexity. When AI is seamlessly integrated into the tools people already know and love, it streamlines their everyday workflows without adding another system to learn or manage.When we looked further into the barriers holding back AI adoption, our survey uncovered a large divide between organizational levels. While 83% of executives actively use AI-powered collaboration tools, this drops to just 42% of entry-level workers. Were also seeing a direct correlation between usage and confidence, too. Ninety percent of executives feel confident using AI-powered features, whereas 41% of entry-level employees feel hardly or not at all knowledgeable.AI regulation is top of mindProper regulation and security are important for companies and employees. AI is a powerful and exciting tool, but there must be guidelines in place to keep company information safe. Our research reveals that 88% of companies are implementing strict guidelines to safeguard their business and employeesbut effective implementation proves to be the larger obstacle at hand.The current disconnect between policy creation and awareness in the workforce is significant: While 70% of executives say their company has established AI policies, only 29% of entry-level employees are confident that these guardrails exist. Executives must spend time communicating and implementing these systems so teams are empowered to use AI with security top of mind.The path to more strategic AIAIs impact extends beyond productivity and efficiencyits about enhancing how we work, improving job satisfaction and cultivating better work-life balance. It must be rolled out strategically and practically through comprehensive employee training and transparent AI integration strategies, bridging knowledge gaps across organizational levels, and addressing security and privacy concerns.AI isnt about replacing people; its about empowering them. The future of work is collaborative and AI is a powerful partner that will amplify human potential. At Lucid, our goal is to make AI feel approachable, trustworthy, and impactfulsomething that genuinely helps teams get things done better and faster. Embracing this technology thoughtfully and inclusively will be key to organizational success and employee empowerment.Dave Grow is CEO of Lucid Software.
    0 Yorumlar ·0 hisse senetleri ·37 Views
  • 3 ways smarter design can solve the noise problem
    www.fastcompany.com
    By Gordon Boggis and Michael DiTulloImagine sitting in a caf where the clatter of a fork hitting a plate across the room drowns out your conversation with the person sitting next to you. Have you ever worked in an open office filled with overlapping video calls, making it almost impossible to focus on the document on your screen? Perhaps you recall discussing sensitive matters in a bank while overhearing equally private conversations from the next office. These everyday examples highlight how disruptive noise pollution can be and how important it is to prioritize acoustics.The reality is that poor acoustics are a pervasive yet solvable problem. Like a pebble in your shoe, the issue might go unnoticed initially but grows increasingly unbearable as its effects compound. Many dont realize the extent of the problem until they experience a well-designed acoustic environment.Moreover, poor acoustics dont just inconveniencethey impact cognitive well-being, productivity, and learning. Studies consistently show that exposure to uncontrolled noise increases stress levels, reduces focus, and impairs performance. In addition, a study by the Journal of Exposure Science & Environmental Epidemiology found that harmful noise impacts the central nervous system, increasing susceptibility to depression, anxiety, suicide, and behavioral problems.Acoustics affect the workplacePoor acoustics is of particular concern in learning and workplace environments. In the education realm, according to the American Speech-Language-Hearing Association, poor acoustical design can result in excessive noise that is disruptive to the learning process and may negatively affect speech perception, student behavior, and educational outcomes. Another recent study found similar results in higher education, with poor acoustics negatively impacting college students listening, learning, and well-being.Additionally, a recent report by JLL highlights how poor office acoustics and a lack of privacy negatively impact employee focus and productivity, with 58% of workers still preferring their home environments for concentration. These studies illustrate why workplace designers increasingly craft offices with diverse spaces tailored for collaboration and individual tasks, leveraging sound-insulating materials and technologies to create environments that support well-being and efficiency.3 key acoustic design principlesDespite this, businesses often overlook acoustic considerations in favor of aesthetics or cost-saving during design. The good news is that by integrating three fundamental principles into the design process, its possible to create functional spaces that are acoustically comfortable.Effective materialsMaterials with high noise reduction coefficient (NRC) ratings can significantly reduce sound reflection and absorption. Acoustic tiles, baffles, carpets, draperies, and upholstered furniture can work together to manage sound reverberation. Adding acoustic panels from 3 to 7 feet off the floor is particularly effective, as it targets the height where most sound waves from human activity occur. Opting for sustainable optionssuch as those made from recycled PET or reclaimed materialsadds an eco-conscious dimension to the solution.Minimize right anglesRight angles in architecture can amplify echoes, causing delayed and overlapping sounds that disrupt clarity. Breaking up these angles with irregular geometries or introducing acoustic baffles and clouds can disperse sound waves, reducing ambient noise. If structural changes arent feasible, strategically placing furniture, screens, and partitions can achieve similar effects.Optimize the ceilingOften called the fifth wall, ceilings are critical in sound management. Open ceilings with exposed ducts and concrete surfaces, while visually appealing, can act as large reflectors that amplify sound. Incorporating baffles, clouds, or other sound-absorbing elements can transform these spaces without compromising the aesthetic. In one example, a domed cafeteria amplified sound across the room until designers introduced acoustic baffles to disrupt the reverberations.While individual elements like acoustic baffles or tiles with high NRC ratings are important, true acoustic success comes from a holistic approach. Its not just about adding a couple of high-performing piecesits about understanding how all components interact to create an effective solution. This is where experts, such as acousticians, play a critical role. Acousticians analyze the space comprehensively, considering factors like room geometry, materials, and usage patterns to recommend tailored solutions. Additionally, many companies with in-house acoustic design teams offer consultation servicesoften at no additional cost. These professionals can assess the entire space to ensure the selected acoustic strategies work cohesively, avoiding the pitfalls of piecemeal fixes that may fail to address the bigger picture.Design spaces that people want to be inAcoustics should be treated as integral to design as lighting or layout. We can create equally functional and enriching environments by thinking of sound as a raw material. Spaces with sculpted and controlled soundscapes promote productivity and focused learning while reinforcing cognitive well-being. Whether its improving educational outcomes, supporting a return to the office, attracting customers to a retail space, or enhancing public venues, sound can be a powerful tool for shaping experience.Gordon Boggis is CEO of Carnegie. Michael DiTullo is head of product innovation at Kirei, a division of Carnegie Acoustic Solutions.
    0 Yorumlar ·0 hisse senetleri ·35 Views
  • Luxurious Getaway In Saudi Arabia Tempts With Stunning Cliff-Hanging Mountain Villas & Private Retreats
    www.yankodesign.com
    Called the Desert Rock, this luxurious getaway has been carved into the Hejaz Mountains in Saudi Arabia. It is a part of the countrys majestic Red Sea giga-project. It is designed to be a sophisticated holiday destination for affluent tourists. It is packed with cliff-hanging villas and private retreats, offering lush luxury. The Desert Rock is designed by Oppenheim Architecture, and it is closely located at the new airport by Foster + Partners.The project draws inspiration from the ancient Nabataean civilization, which is acclaimed for its rock-carved architecture in the Arabian Peninsula. The project is developed to attract more tourism to the country, although it does seem targeted towards the wealthier population. The luxurious retreat provides splendid views of the surrounding landscape while being safely tucked away into the mountains of Saudi Arabia.Designer: Oppenheim ArchitectureThe unique development spans over 7 acres and is a stunning architectural marvel nestled within a dramatic mountain landscape. It is equipped with a diverse range of accommodations which have been designed in harmony with the natural surroundings. The development includes marvelous Cliff Hanging Villas and Mountain Crevice Villas. These villas have been perched on the edge of the mountainside, while the Mountain Cave Suites have been constructed into the rock, offering a unique and unparalleled exposure and connection with nature.You also have the option of the Royal Villa which offers maximum exclusivity, privacy, and luxury. This villa is strategically situated to offer seclusion, providing a serene escape from the outside world. The process began with the excavation of a massive tunnel into the mountain, which required meticulous planning and engineering expertise. The accommodations were carved out of the mountain over seven years, which is quite a feat.We are ready to welcome guests to Desert Rock, our third self-operated hotel in the Red Sea Global hospitality portfolio, said John Pagano, Group CEO of Red Sea Global. This is more than just a hotel it is a unique property, crafted into the rock face, offering a truly immersive experience where luxury and nature come together to create a truly unforgettable escape.The Desert Rock is a significant part of the impressive Red Sea giga-project. It is at the forefront of the nations strategy alongside projects like Neom and Qiddiya to convert it from an oil-based economy to a tourism-centric one. The completion of Desert Rock coincides with the launch of Sindalah, the first project within the Neom development. If youre interested in visiting this stunning property, then the reservations are now open. However, this place is far from budget-friendly, and the price will depend on the choice of villa and duration of stay. Approximate costs were around US$2,200 for a night.The post Luxurious Getaway In Saudi Arabia Tempts With Stunning Cliff-Hanging Mountain Villas & Private Retreats first appeared on Yanko Design.
    0 Yorumlar ·0 hisse senetleri ·33 Views
  • Cant Focus? Now You Can Pet This Furry Keyboard For Comfort While You Work
    www.yankodesign.com
    Alright, you love your feline more than anything in this world, or simply want the cozy warmth of a furry peripheral in your desk setup? Then there is an actual peripheral thatll rival any other fancy keyboard option. The Angry Miao subsidiary Dry Studio has created a cat-themed mechanical keyboard dubbed Petbrick 65. This cozy peripheral comes with a detachable furry shell that makes you feel comfy at all times. The number 65 signifies the 65 percent mechanical nature of this keyboard.As per the maker, this is the worlds first pettable custom mechanical keyboard in the world. Angry Miao is no stranger to making striking peripherals like the Cyberboard R2, and its subsidiary coming up with something really out of the box is not surprising. Making a cat-inspired designer keyboard makes sense, as most of the internet junkies are obsessed with felines.Designer: Dry StudioThe fluffy outer shell is handmade and is similar to Jellycat toys. It is purely magnetic on the sides to attach and be snug in place no matter how hard typer you are. It can be cleaned easily (machine washable material) since keyboards can collect a lot of gunk and debris. The maker describes it as, a keyboard you can actually pet. The accessory comes in both wired and wireless modes depending on whether you are using it in a stationary setup on your desk or with a laptop for more convenience. It can be connected over a 2.5GHz wireless connection and the 5,000mAh battery should last a very long time.Using the Petbrick 65 keyboard, cat lovers can emulate the feeling of petting their furry friend while not having them sitting on the desk, ready to mess up your workflow with the slightest of mood swings. Dry Studio says the outer fluffy shell is as soft as satin fabric since it is made by a seasoned toy factory specializing in making soft toy fabric material. The cat-themed fur weighing 3.3 pounds is matched by the color keys in a similar theme, along with the three preset RGB color modes to set the right mood. Also, there is a high glossy transparent mold that improves the dynamic RGB lighting with a smooth and responsive typing experience.Petbrick 65 keyboard custom mechanical keyboard comes with patented Leaf-Spring mount having 8-layer construction, sandblasted POM plate, specially tuned cotton poron, IXPE 8 switch pad, and dual layer ultra-low-density EPDM sound-dampening foam. The keys on the keyboard carry the cat theme including the Shift key with cat legs and cartoonish cat paws for the space bar. For the initial launch, two colors are available 14 Calico and 17 Odd-eye at a steep price of $239.The post Cant Focus? Now You Can Pet This Furry Keyboard For Comfort While You Work first appeared on Yanko Design.
    0 Yorumlar ·0 hisse senetleri ·32 Views
  • Dario Amodei challenges DeepSeeks $6 million AI narrative: What Anthropic thinks about Chinas latest AI move
    venturebeat.com
    Anthropic co-founder Dario Amodei reveals DeepSeek's Chinese AI breakthrough actually cost billions, not $6 million, challenging market narratives and explaining why AI development remains resource-intensive despite engineering improvements.Read More
    0 Yorumlar ·0 hisse senetleri ·37 Views
  • Pig API: Give your AI agents a virtual desktop to automate Windows apps
    venturebeat.com
    Join our daily and weekly newsletters for the latest updates and exclusive content on industry-leading AI coverage. Learn MoreIn the evolving landscape of AI, enterprises face the challenge of integrating modernsolutions with legacy systems that often lack the necessary application programming interfaces (APIs) for seamless integration. Approximately 66% of organizations continue to rely on legacy applications for core operations, leading to increased maintenance costs and security vulnerabilities. Tools like PigAPI have taken a different approach to this problem by enabling AI agents to interact directly with graphical user interfaces (GUIs) within virtual Windows desktops hosted in the cloud. This connects modern AI capabilities with legacy software, allowing for automation of tasks such as data entry and workflow management without the need for local infrastructure. Additionally, users can intervene at any point, taking control of the virtual machine (VM) to guide or adjust tasks as needed. For businesses grappling with legacy challenges, this hybrid approach offers a practical solution to modernize operations without overhauling existing systems.Breaking through legacy system barriers Traditional robotic process automation (RPA) tools, such as UiPath and Automation Anywhere, are designed to automate repetitive tasks by mimicking human interactions with software applications. However, these tools often encounter significant challenges when dealing with legacy systems, particularly those that are GUI-based and lack modern integration points. The absence of user-friendly APIs in these older systems makes integration cumbersome and prone to errors. Additionally, RPA solutions are typically rule-based and struggle to adapt to dynamic changes in user interfaces or workflows, leading to brittle automation processes that require constant maintenance and updates.By contrast, AI agents, such as those enabled by Pig API, offer a more flexible and intelligent approach to automation. Unlike traditional RPA tools, AI agents are not solely rule-based; they can learn and adapt to changes in the user interface, making them more resilient to updates or modifications in legacy systems. This adaptability reduces the need for constant maintenance and allows for more complex task automation. Furthermore, by operating within virtual environments, AI agents can scale more efficiently, handling multiple tasks across different systems simultaneously without the constraints of physical hardware. For example, in the finance sector, AI agents can facilitate the migration of data from outdated accounting systems to modern customer relationship management (CRM) platforms by mimicking manual data entry processes. In healthcare, they can interact with legacy electronic health record (EHR) systems to extract and input patient information, streamlining administrative tasks and reducing the potential for human error. Technical details: How Pig API powers GUI automation with AI agentsPig API enables AI agents to interact directly with GUIs within cloud-hosted virtual Windows desktops. Through its Python software development kit (SDK), Pig makes it possible for developers to integrate virtual environments into workflows, automating processes that traditionally required manual effort.Connecting AI agents to cloud-hosted virtual desktopsAt the heart of Pig API is its ability to create and manage VMs for AI agents. These cloud-hosted environments eliminate the need for local infrastructure, allowing enterprises to scale workflows seamlessly. For instance, developers can easily initialize a VM, connect to it, and define tasks for their AI agents using a straightforward process. Heres an example:This setup provides AI agents with a dedicated environment to perform tasks such as interacting with desktop applications, simulating user inputs and automating workflows. By abstracting the complexities of GUI interaction, Pig ensures that developers of varying expertise can leverage its capabilities effectively.Simulating human-like interactionsPig API enables AI agents to perform a variety of actions that closely mimic human behavior. This includes moving a mouse, clicking, dragging, typing into forms or spreadsheets and capturing screenshots of the current desktop view. These tools allow agents to make informed decisions during their operations and execute complex workflows.Source: https://github.com/pig-dot-dev/pig-pythonLLM integration for multi-step workflowsOne of Pig APIs standout features is its integration with large language models (LLMs) such as Anthropics Claude or OpenAIs GPT. This capability enables AI agents to incorporate decision-making into their automation workflows, handling tasks that go beyond predefined rules. For instance, consider the following example of a data extraction and processing workflow:In this workflow, the AI agent opens a browser, navigates to a specified URL, extracts relevant customer reviews and organizes data into an Excel spreadsheet. By integrating with LLMs, Pig enables agents to execute multi-step tasks that combine GUI automation with AI-driven logic, demonstrating its potential for streamlining complex operations.Pig API in the automation ecosystemThe automation landscape includes a variety of tools tailored for different use cases, from traditional RPA platforms to advanced agentic AI solutions. Tools like UiPath and AutoHotkey excel at automating structured workflows and repetitive tasks, but are often limited when it comes to unstructured processes or GUI-heavy environments. Both require predefined scripts or rule-based logic, making them less adaptable to changes in user interfaces or dynamic workflows. Pig API positions itself as a solution for scenarios where traditional automation tools encounter barriers, particularly in interacting with legacy Windows applications. Other emerging solutions, such as Microsofts UFO project and Anthropics Computer Use, also aim to enhance automation through intelligent agents capable of interacting with GUIs. However, these technologies remain in their experimental stages and focus more on augmenting user productivity rather than enterprise-scale workflows. Pigs specific focus on enabling agents to operate within isolated virtual environments provides an alternative that aligns with the needs of enterprises dealing with legacy systems.Whats next for Pig API and AI automationAs enterprises continue to navigate the complexities of integrating modern AI solutions with legacy systems, tools like Pig API take a new approach to bridging this gap. By enabling AI agents to interact directly with GUIs within virtual Windows desktops, Pig opens up new possibilities for automation in environments that have traditionally been difficult to modernize. Its cloud-hosted architecture and ability to work without APIs position it as a valuable tool for enterprises looking to extend the lifespan of legacy systems while improving operational efficiency.While Pig offers a promising solution for GUI-based automation, it is one of several tools exploring this space. Its success will depend on continued development, transparency around security and compliance and its ability to integrate seamlessly into broader enterprise workflows. For organizations exploring AI-driven automation, Pig represents an option worth evaluating, particularly for industries reliant on outdated but critical software systems.Daily insights on business use cases with VB DailyIf you want to impress your boss, VB Daily has you covered. We give you the inside scoop on what companies are doing with generative AI, from regulatory shifts to practical deployments, so you can share insights for maximum ROI.Read our Privacy PolicyThanks for subscribing. Check out more VB newsletters here.An error occured.
    0 Yorumlar ·0 hisse senetleri ·38 Views
  • Mark Zuckerberg says Meta isnt worried about DeepSeek
    www.theverge.com
    Nearly everyone seems to be suddenly freaking out about the rise of DeepSeek. Meta isnt worried, though.That was CEO Mark Zuckerbergs message to investors during his companys fourth-quarter earnings call on Wednesday. During the Q&A portion of the call with Wall Street analysts, Zuckerberg fielded multiple questions about DeepSeeks impressive AI models and what the implications are for Metas AI strategy. He said that what DeepSeek was able to accomplish with relatively little money has only strengthened our conviction that this is the right thing to be focused on.Zuckerberg noted that theres a number of novel things they did were still digesting and that Meta plans to implement DeepSeeks advancements into Llama. DeepSeek caused a massive sell-off in AI stocks due to fears that models will no longer need as much computing power. Zuckerberg tried to dispel concerns that the billions of dollars hes spending on GPUs will go to waste: I continue to think that investing very heavily in CapEx and infra is going to be a strategic advantage over time.His argument is in line with the growing consensus that computing resources will move from the training phase of AI development towards helping models better reason. In Zuckerbergs own words, this doesnt mean you need less compute because you can apply more compute at inference time in order to generate a higher level of intelligence and a higher quality of service. Meta is gearing up to release Llama 4 with multimodal and agentic capabilities in the coming months, according to Zuckerberg. He expects Metas AI assistant to reach one billion users this year.He also took a thinly veiled jab at OpenAI, Anthropic, and other unprofitable startups by noting that Meta has a strong business model to support the roughly $60 billion it will spend on AI this year versus others who dont necessarily have business models to support it on a sustainable basis.Zuckerberg also made sure to praise President Donald Trump. We now have a US administration that is proud of our leading companies, prioritizes American technology winning, and will defend our values and interests abroad, he said. Moments before the earnings call started, news broke that Meta is paying Trump $25 million to settle a lawsuit he brought against the company for banning his account after the January 6th insurrection. (The vast majority of the money is going to pay for Trumps presidential library.)Meanwhile, Meta is a cash-printing machine. Revenue for the fourth quarter of 2024 was $48.39 billion a 22-percent increase from the year-ago period while net profit was a staggering $20.8 billion (up 43-percent from a year before). During the earnings call, CFO Susan Li said that Meta hasnt seen any noticeable impact from its content policy changes on ad spending. 3.35 billion people used at least one of Metas apps daily in the fourth quarter a 5-percent increase from the year-ago period.See More:
    0 Yorumlar ·0 hisse senetleri ·36 Views
  • Teslas next-generation vehicle: all the news about Elon Musks next big EV bet
    www.theverge.com
    For years, Tesla CEO Elon Musk has been promising an affordable electric vehicle, likely priced at $25,000, as a way to broaden the appeal of plug-in vehicles.He first mentioned it in a 2018 interview with YouTuber Marques Brownlee, saying a $25,000 car, thats something we can do. Then in 2020, at the companys first Battery Day event, he speculated that Tesla could eventually produce upward of 20 million of these vehicles in a year or roughly twice the current production of Toyota, GM, or Volkswagen.Things started to accelerate last year at Teslas shareholder event, where the companys executives spoke about a specialized manufacturing technique that they called the Unboxed Process. This breakthrough would allow Tesla to dramatically reduce the cost of manufacturing, enabling it to sell a vehicle at the $25,000 price point.The next-gen vehicle will likely be a crossover or hatchback and could feature design elements lifted from the Tesla Cybertruck. But moreover, it would be the fulfillment of a promise made years ago to make EVs more affordable to the masses.Elon Musk makes a lot of promises, some of which he cant keep. Lets hope this isnt one of them.
    0 Yorumlar ·0 hisse senetleri ·44 Views
  • MongoRAG: Leveraging MongoDB Atlas as a Vector Database with Databricks-Deployed Embedding Model and LLMs for Retrieval-Augmented Generation
    towardsai.net
    Author(s): Dwaipayan Bandyopadhyay Originally published on Towards AI. Today, in this article, I will give a detailed walkthrough about how we can leverage MongoDBs own Atlas as a Vector Search Index and Embedding model and LLM served as an endpoint in the Databricks portal to do Retrieval Augmented Generation (RAG) on a piece of data.Source : Image by AuthorIn todays AI World, where large amounts of structured and unstructured data are generated daily, accurately using knowledge has become the cornerstone of modern-day technology. Retrieval Augmented Generation (RAG) is a widely used approach that solves real-world data problems by amalgamating the power of Generative AI and Information Retrieval.Retrieval Augmented Generation generally consists of Three major steps, I will explain them briefly down below Information Retrieval The very first step involves retrieving relevant information from a knowledge base, database, or vector database, where we store the embeddings of the data from which we will retrieve information. This Retrieval part is typically done via Similarity Search, in which we find the similarities between the embedded query and the embeddings already stored in the Vector Database.Augmentation Step After retrieving the similar information from the Vector Database, it gets combined with the query asked by the user so that the retriever gets the context to what has been asked and form a better answer for the query.Generation Step This is the final step, where a Large Language Model comes into play, we feed the augmented information to the LLM, and it generates a proper human readable answer based on that information provided. Feeding of the augmented information is crucial because otherwise the AI might generate some random information as it doesnt have any context of what has been asked.What is MongoDB Atlas?Atlas is a multi-cloud database service provided by MongoDB in which the developers can create clusters, databases and indexes directly in the cloud, without installing anything locally. Basically, its MongoDB on Cloud, users can create an account by signing up from their official website provided below MongoDB Atlas: Cloud Document Database | MongoDBAfter signing in for the very first time, just follow the steps mentioned in the below documentation to spin up a free cluster.Get Started with Atlas MongoDB AtlasAfter the Cluster has been created, its time to create a Database and a collection. Now, as MongoDB is a NoSQL Database, we have to create a Database first (unlike Schema for SQL Databases, although the concept is same), then inside the Database we have to create a collection, in which we can store documents (It is like creating a table inside a Database). If this feels confusing, please refer to the following article of how to create a Collection and Database, but remember, do not add any documents, just create collection and a database.Connecting MongoDB with Python The Coding part starts nowNow, we will connect MongoDB with Python, so that we can do the rest of the steps programmatically, without using the UI for a second.To connect and access MongoDB Atlas via Python, we need to install a package called pymongo. It can be installed via the following pip command.pip install pymongoAfter it has been installed, we will import the class MongoClient to connect with MongoDB via Python. For that we will require the connection string, which can be found under Drivers settings after clicking on Connect from the Cluster. The process can be found in the following link, Step 2.Quick Start: Getting Started With MongoDB Atlas and Python | MongoDBAfter the connection string is found, write and execute the below to connect with MongoDBfrom pymongo import MongoClientclient = MongoClient("YOUR_CONNECTION_URL")dbName = "YOUR_DATABASE_NAME"collectionName = "YOUR_COLLECTION_NAME"collection = client[dbName][collectionName]This will establish the connection with MongoDB, if no errors are encountered, then the connection has been successfully made with MongoDB.After the connection has been established, lets talk about all the other packages we require to do the entire RAG process, apart from pymongo. Install the following packages via pippip install langchainpip install langchain_databrickspip install langchain_mongodbWe only require these three packages to do the entire process. After they are installed successfully, lets import all the necessary classes from these packages.Importing Necessary classes from the packagesfrom pymongo import MongoClientfrom langchain_mongodb.vectorstores import MongoDBAtlasVectorSearchfrom langchain.document_loaders import TextLoaderfrom langchain.text_splitter import RecursiveCharacterTextSplitterfrom langchain.chains import RetrievalQAfrom langchain_databricks import ChatDatabricksfrom langchain_databricks import DatabricksEmbeddingsAs we have already established the connection with Databricks, lets just load our data and do the chunking using RecursiveCharacterTextSplitter. We will be keeping each chunk size as 1000 with an overlapping of 100 characters and a new paragraph(\n\n) as a separator.# Importing the data using TextLoaderloader = TextLoader("story.txt")data = loader.load()# Configuring the Chunking strategytext_splitter = RecursiveCharacterTextSplitter( chunk_size=1000, chunk_overlap=100, separators="\n\n")# keeping the chunks in this variablechunked_docs = text_splitter.split_documents(data)Configuring LLM and Embedding ModelsNext, we will configure our Embedding model and Large Language Model which we are going to use. Now, here we will be using the models which are serving as an endpoint in Databricks Portal. If someone dont have the access of Databricks, then they can go with the regular approach of using OpenAIEmbeddings and ChatOpenAI classes, and configure them accordingly.embeddings = DatabricksEmbeddings( endpoint="databricks-gte-large-en")llm = ChatDatabricks( target_uri="databricks", endpoint="databricks-meta-llama-3-1-70b-instruct", temperature=0.0,)We will be using the GTE-Large embedding model and the Meta LLama 3.1 70B Instruct models for this demo.Creating a Vector Search Index in MongoDB AtlasNow, after all the configuration is done, we will be creating a Vector Search Index in Atlas, in which we will store our embeddings and use them later to do the RAG. There are two ways to create the Vector Search Index, one is either the UI or the other way is via Code. Now Atlas provides us with a default Search Index name i.e vector_index, if someone wants to go by this name, then they can just write and execute the following codevectorStore = MongoDBAtlasVectorSearch.from_documents( chunked_docs, embeddings, collection=collection).create_vector_search_index( dimensions=1024 )This will create a vector search index named vector_index with the dimension 1024, inside the collection we created earlier. We just have the pass the chunked documents, alongside the embeddings and the collection configuration via which we connected to Atlas.Image before the creation of the Search Index (execution of the above code)Source : Image by AuthorImage after executing the above code (creation of the default search index)Source : Image by AuthorAs we can see now, after the execution of the above piece of code, our search index with the default name vector_index has been created and 129 documents have been inserted (which is the number of chunks created earlier)But, if someone wants to go a step further and create their own Search Index by providing own custom name, then we need to make some changes in the above code. First, we need to create the custom index using the name provided by the user, and then insert the embeddings into it, this cannot be done in one go (if done programmatically).Creating custom vector search indexMongoDBAtlasVectorSearch(index_name="mongo_rag", collection=collection, embedding=embeddings).create_vector_search_index( dimensions=1024)Here, we are creating an index called mongo_rag first with the dimension of 1024, now the dimension is very crucial whether we create the by-default index or custom index, because if this dimension doesnt match with the one of the Embedding model, then it will be a major issue, the application will not even execute. for the embedding model used here i.e GTE-Large, the dimension is 1024.Image after creating the custom index (embeddings are not yet added)Source : Image by AuthorAs we can see here, the index has been created successfully, but the Documents are still at 129 values as we havent populated the embeddings here. We should delete the previously added chunks first, otherwise we will just push the same chunks again, which will be a repetition which might introduce hallucinations.Populating the Custom Index with EmbeddingsUsing the following code, we can populate the custom index with the embeddingsvectorStore = MongoDBAtlasVectorSearch.from_documents(index_name="mongo_rag", embedding=embeddings, documents=chunked_docs, collection=collection)In this approach, while inserting embeddings into the search index, we are providing the index_name here, this will let us store the indexes in that particular search index.Designing the RAG functionIn this step, we will just design a generic RAG function using the LLMs and Endpoint configuration we defined earlier.def query_data(query): # Perform Atlas Vector Search using Langchain's vectorStore # similarity_search returns MongoDB documents most similar to the query docs = vectorStore.similarity_search(query, k=3) # Putting the similar chunks into a list to print it later similar_chunks = [chunk for chunk in docs] # Setting up the retriever defined using MongDBAtlasVectorSearch retriever = vectorStore.as_retriever() # Load "stuff" documents chain. Stuff documents chain takes a list of documents, # inserts them all into a prompt and passes that prompt to an LLM. qa = RetrievalQA.from_chain_type(llm, chain_type="stuff", retriever=retriever) # Execute the chain retriever_output = qa.invoke(query) # Return Atlas Vector Search output, and output generated using RAG Architecture return (f"Similar Chunks\n-{similar_chunks}\n, Answer-{retriever_output}")Now we will pass a sample query and check how it is workingquery = "Explain the Character of Macbeth"query_data(query)Answer'Similar Chunks\n-[Document(metadata={\'_id\': \'6798ecf0a3137ba55ff6b544\', \'source\': \'story.txt\'}, page_content="1606\\nTHE TRAGEDY OF MACBETH\\n\\n\\nby William Shakespeare\\n\\n\\n\\nDramatis Personae\\n\\n DUNCAN, King of Scotland\\n MACBETH, Thane of Glamis and Cawdor, a general in the King\'s\\narmy\\n LADY MACBETH, his wife\\n MACDUFF, Thane of Fife, a nobleman of Scotland\\n LADY MACDUFF, his wife\\n MALCOLM, elder son of Duncan\\n DONALBAIN, younger son of Duncan\\n BANQUO, Thane of Lochaber, a general in the King\'s army\\n FLEANCE, his son\\n LENNOX, nobleman of Scotland\\n ROSS, nobleman of Scotland\\n MENTEITH nobleman of Scotland\\n ANGUS, nobleman of Scotland\\n CAITHNESS, nobleman of Scotland\\n SIWARD, Earl of Northumberland, general of the English forces\\n YOUNG SIWARD, his son\\n SEYTON, attendant to Macbeth\\n HECATE, Queen of the Witches\\n The Three Witches\\n Boy, Son of Macduff \\n Gentlewoman attending on Lady Macbeth\\n An English Doctor\\n A Scottish Doctor\\n A Sergeant\\n A Porter\\n An Old Man\\n The Ghost of Banquo and other Apparitions\\n Lords, Gentlemen, Officers, Soldiers, Murtherers, Attendants,"), Document(metadata={\'_id\': \'6798ecf0a3137ba55ff6b5a7\', \'source\': \'story.txt\'}, page_content="Was a most sainted king; the queen that bore thee,\\n Oftener upon her knees than on her feet,\\n Died every day she lived. Fare thee well!\\n These evils thou repeat\'st upon thyself\\n Have banish\'d me from Scotland. O my breast,\\n Thy hope ends here!\\n MALCOLM. Macduff, this noble passion,\\n Child of integrity, hath from my soul\\n Wiped the black scruples, reconciled my thoughts\\n To thy good truth and honor. Devilish Macbeth\\n By many of these trains hath sought to win me\\n Into his power, and modest wisdom plucks me\\n From over-credulous haste. But God above\\n Deal between thee and me! For even now\\n I put myself to thy direction and \\n Unspeak mine own detraction; here abjure\\n The taints and blames I laid upon myself,\\n For strangers to my nature. I am yet\\n Unknown to woman, never was forsworn,\\n Scarcely have coveted what was mine own,\\n At no time broke my faith, would not betray\\n The devil to his fellow, and delight"), Document(metadata={\'_id\': \'6798ecf0a3137ba55ff6b57d\', \'source\': \'story.txt\'}, page_content="Particular addition, from the bill\\n That writes them all alike; and so of men. \\n Now if you have a station in the file,\\n Not i\' the worst rank of manhood, say it,\\n And I will put that business in your bosoms\\n Whose execution takes your enemy off,\\n Grapples you to the heart and love of us,\\n Who wear our health but sickly in his life,\\n Which in his death were perfect.\\n SECOND MURTHERER. I am one, my liege,\\n Whom the vile blows and buffets of the world\\n Have so incensed that I am reckless what\\n I do to spite the world.\\n FIRST MURTHERER. And I another\\n So weary with disasters, tugg\'d with fortune,\\n That I would set my life on any chance,\\n To mend it or be rid on\'t.\\n MACBETH. Both of you\\n Know Banquo was your enemy.\\n BOTH MURTHERERS. True, my lord.\\n MACBETH. So is he mine, and in such bloody distance\\n That every minute of his being thrusts \\n Against my near\'st of life; and though I could")]\n, Answer-{\'query\': \'Explain the Character of Macbeth\', \'result\': "Based on the provided context, Macbeth is a complex character who is the Thane of Glamis and Cawdor, and a general in the King\'s army. He is a prominent figure in the play and is driven by a desire for power and prestige. \\n\\nInitially, Macbeth is portrayed as a respected and accomplished military leader, but as the play progresses, his darker qualities are revealed. He is shown to be ruthless, ambitious, and willing to do whatever it takes to achieve his goals, including murder. \\n\\nMacbeth\'s relationship with his wife, Lady Macbeth, also plays a significant role in shaping his character. He is influenced by her goading and encouragement, which pushes him to commit regicide and seize the throne. \\n\\nHowever, Macbeth\'s actions are also motivated by a sense of insecurity and paranoia, as he becomes increasingly obsessed with the idea of being overthrown and killed. This fear drives him to order the murder of his friend Banquo and his family, further highlighting his descent into darkness and tyranny.\\n\\nThroughout the play, Macbeth\'s character undergoes a significant transformation, from a respected nobleman to a tyrannical and isolated ruler. His downfall is ultimately sealed when he is killed by Macduff, and his head is brought to Malcolm, the rightful king. \\n\\nIt\'s worth noting that the provided context only gives a glimpse into Macbeth\'s character, and a more comprehensive understanding would require a broader analysis of the entire play."}'The output can be further modified based on the requirement.Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming asponsor. Published via Towards AI
    0 Yorumlar ·0 hisse senetleri ·43 Views