What this doc covers
- Using Exa search_and_contents to find relevant webpages for a query and get their contents
- Performing Exa search based on text similarity rather than a search query
Answer your questions with context
LLMs are powerful because they compress large amounts of data into a format that allows convenient access, but this compressions isn’t lossless. LLMs are prone to hallucination, corrupting facts and details from training data. To get around this fundamental issue with LLM reliability, we can use Exa to bring the most relevant data into context—a fancy way of saying: put the info in the LLM prompt directly. This lets us combine the compressed data and reasoning abilities of the LLM with a curated selection of uncompressed, accurate data for the problem at hand for the best answers possible. Exa’s SDKs make incorporating quality data into your LLM pipelines quick and painless. Install the SDK by running this command in your terminal:Shell
Python
highlight
feature, which directly returns relevant text of customizable length for a query. You’ll need to run pip install openai
to get access to OpenAI’s SDK if you haven’t used it before. More information about the OpenAI Python SDK can be found here.
Python
Python
- LLMs don’t have knowledge past when their training was stopped, so they can’t know about recent events
- If an LLM doesn’t know the answer, it will often ‘hallucinate’ a correct-sounding response, and it can be difficult and inconvenient to distinguish these from correct answers
- Because of the opaque manner of generation and the problems mentioned above, it is difficult to trust an LLM’s responses when accuracy is important
Python
Python
the only mammals with powered flight, the evolutionary\xa0history of their wings has been poorly understood. However, research published Monday in Nature and PLoS Genetics has provided the first comprehensive look at the genetic origins of their incredible wings.But to appreciate the genetics of their wing development, it’s important to know how crazy a bat in flight truly\xa0looks.Try a little experiment: Stick your arms out to the side, palms facing forward, thumbs pointing up toward the ceiling. Now imagine that your fingers are\xa0long, arching down toward the floor like impossibly unkempt fingernails — but still made of bone, sturdy and spread apart. Picture the sides of your body connecting to your hands, a rubbery membrane attaching your leg and torso to those long fingers, binding you with strong, stretchy skin. Then, finally, imagine using your muscles to flap those enormous hands.Bats, man.As marvelous as bat flight is to behold, the genetic origins of their storied wings has remained murky. However, new findings from an international team of researchers led by Nadav Ahituv, PhD, of the University of California at San Francisco, Nicola Illing, PhD, of the University of Cape Town\xa0in\xa0South Africa\xa0and Katie Pollard, PhD of the UCSF-affiliated Gladstone Institutes has shed new light on how, 50 million years ago, bats took a tetrapod blueprint for arms and legs and went up into the sky.Using a sophisticated set of genetic tools, researchers approached the question of how bats evolved flight by looking not only at which genes were used in the embryonic development of wings, but at what point during development the genes were turned on and off, and — critically — what elements in the genome were regulating the expression of these genes. Genes do not just turn themselves on without input; genetic switches, called enhancers, act to regulate the timing and levels of gene expression in the body.',
Python
Python
Beyond Question Answering: Text Similarity Search
Exa can be used for more than simple question answering. One superpower of Exa’s special embeddings-based search is that we can search for websites containing text with similar meaning to a given paragraph or essay! Instead of providing a standard query like “a research paper about Georgism”, we can provide Exa with a paragraph about Georgism and find websites with similar contents. This is useful for finding additional sources for your research paper, finding alternatives/competitors for a product, etc.Python
Python
George