Get started
Quickstart
An agent that remembers in about two minutes, on the cloud API or the embedded engine.
The fastest path to an agent that remembers. Pick the column that matches how you want to run MenteDB. Both are runnable in about two minutes, and both use the same one-call-per-turn model.
Cloud (managed)
No SDK, no infrastructure. Get a key at app.mentedb.com and call the REST endpoint.
export MENTEDB_API_KEY=mdb_your_key_here
pip install requestsimport os, requests
API = "https://api.mentedb.com/v1/process_turn"
HEADERS = {"Authorization": f"Bearer {os.environ['MENTEDB_API_KEY']}"}
def process_turn(user_message, assistant_response, turn_id):
resp = requests.post(API, headers=HEADERS, json={
"user_message": user_message,
"assistant_response": assistant_response,
"turn_id": turn_id,
})
resp.raise_for_status()
# the response is the turn data directly
return resp.json()
# Turn 0: tell it something.
process_turn("I switched from Postgres to SQLite for side projects", "Noted.", 0)
# Turn 1: it remembers.
result = process_turn("what database am I using for side projects?", "", 1)
for memory in result["context"]:
print(memory["content"])Self-hosted (embedded)
The engine runs in your process, data on local disk. Install the SDK and point it at a folder.
pip install mentedb
# for automatic fact extraction, point it at an LLM:
export MENTEDB_LLM_PROVIDER=anthropic # openai | anthropic | ollama
export MENTEDB_LLM_API_KEY=sk-ant-...Embeddings default to a local provider. For stronger semantic recall pass one explicitly, for example MenteDB("./data", embedding_provider="bedrock") (AWS Bedrock Titan, uses your standard AWS credentials and AWS_REGION; also openai, cohere, or local candle).
from mentedb import MenteDB
db = MenteDB("./agent-memory")
# Turn 0: tell it something.
db.process_turn(
user_message="I switched from Postgres to SQLite for side projects",
assistant_response="Noted.",
turn_id=0,
)
# Turn 1: it remembers.
result = db.process_turn(
user_message="what database am I using for side projects?",
turn_id=1,
)
for memory in result.context:
print(memory.content)
db.close()On the first turn context is empty because nothing has been learned yet. By the second turn it carries the facts, preferences, and corrections from earlier in the conversation, and across sessions. Prepend result.context to your next prompt and you have an agent with memory.