Our Python library is still under heavy development. Expect there to be bugs and please, reach out if you encounter!

If you’re just getting started with Memora, we suggest you start with our quickstart guide first.

Installation

pip install memora

Quick example

Here’s a straightforward example of how to use our library:

import Memora

memora = Memora.auth('your-api-key-here')

citations = [
  'Life is like a box of chocolates.',
  'May the Force be with you.'
]

metadata = [
  { 'from': 'Forrest Gump' },
  { 'from': 'Stars Wars' }
]

(
  memora
    .add(citations)
    .metadata(metadata)
    .go()
)

docs = (
  memora
    .find('the movie citation about chocolates')
    .go()
)

print(docs[0])
// TODO with response

Design

The library employs the builder pattern, which makes it incredibly easy-to-use and ensures high readability, even for more complex queries. Here’s an example:

docs = (
  memora
    .on('documentation')
    .find('how to change my subscription to the pro plan')
    .where('tags', 'contains', 'support')
    .And('published_year', '>=', 2020)
    .go()
)

Core methods

Our library mainly revolves around three core methods: add(), find(), and delete(). We’ll go into detail about each of these in the following sections.

Was this page helpful?