📢 Announcing our research paper: Zentry achieves 26% higher accuracy than OpenAI Memory, 91% lower latency, and 90% token savings! Read the paper to learn how we're revolutionizing AI agent memory.
Sarvam AI is an Indian AI company developing language models with a focus on Indian languages and cultural context. Their latest model Sarvam-M is designed to understand and generate content in multiple Indian languages while maintaining high performance in English.To use Sarvam AI’s models, please set the SARVAM_API_KEY which you can get from their platform.
import osfrom Zentry import Memoryos.environ["OPENAI_API_KEY"] = "your-api-key" # used for embedding modelos.environ["SARVAM_API_KEY"] = "your-api-key"config = { "llm": { "provider": "sarvam", "config": { "model": "sarvam-m", "temperature": 0.7, } }}m = Memory.from_config(config)messages = [ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"}, {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."}, {"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."}, {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}]m.add(messages, user_id="alex")