repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: Sarvam AI |
| #3 | --- |
| #4 | |
| #5 | **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. |
| #6 | |
| #7 | To use Sarvam AI's models, please set the `SARVAM_API_KEY` which you can get from their [platform](https://dashboard.sarvam.ai/). |
| #8 | |
| #9 | ## Usage |
| #10 | |
| #11 | ```python |
| #12 | import os |
| #13 | from mem0 import Memory |
| #14 | |
| #15 | os.environ["OPENAI_API_KEY"] = "your-api-key" # used for embedding model |
| #16 | os.environ["SARVAM_API_KEY"] = "your-api-key" |
| #17 | |
| #18 | config = { |
| #19 | "llm": { |
| #20 | "provider": "sarvam", |
| #21 | "config": { |
| #22 | "model": "sarvam-m", |
| #23 | "temperature": 0.7, |
| #24 | } |
| #25 | } |
| #26 | } |
| #27 | |
| #28 | m = Memory.from_config(config) |
| #29 | messages = [ |
| #30 | {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"}, |
| #31 | {"role": "assistant", "content": "How about thriller movies? They can be quite engaging."}, |
| #32 | {"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."}, |
| #33 | {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."} |
| #34 | ] |
| #35 | m.add(messages, user_id="alex") |
| #36 | ``` |
| #37 | |
| #38 | ## Advanced Usage with Sarvam-Specific Features |
| #39 | |
| #40 | ```python |
| #41 | import os |
| #42 | from mem0 import Memory |
| #43 | |
| #44 | config = { |
| #45 | "llm": { |
| #46 | "provider": "sarvam", |
| #47 | "config": { |
| #48 | "model": { |
| #49 | "name": "sarvam-m", |
| #50 | "reasoning_effort": "high", # Enable advanced reasoning |
| #51 | "frequency_penalty": 0.1, # Reduce repetition |
| #52 | "seed": 42 # For deterministic outputs |
| #53 | }, |
| #54 | "temperature": 0.3, |
| #55 | "max_tokens": 2000, |
| #56 | "api_key": "your-sarvam-api-key" |
| #57 | } |
| #58 | } |
| #59 | } |
| #60 | |
| #61 | m = Memory.from_config(config) |
| #62 | |
| #63 | # Example with Hindi conversation |
| #64 | messages = [ |
| #65 | {"role": "user", "content": "मैं SBI में joint account खोलना चाहता हूँ।"}, |
| #66 | {"role": "assistant", "content": "SBI में joint account खोलने के लिए आपको कुछ documents की जरूरत होगी। क्या आप जानना चाहते हैं कि कौन से documents चाहिए?"} |
| #67 | ] |
| #68 | m.add(messages, user_id="rajesh", metadata={"language": "hindi", "topic": "banking"}) |
| #69 | ``` |
| #70 | |
| #71 | ## Config |
| #72 | |
| #73 | All available parameters for the `sarvam` config are present in [Master List of All Params in Config](../config). |
| #74 |