Goal
In a few minutes, you will run one Python script that does the core Tex flow:- Store a turn with
remember. - Ask a question with
recall. - Print the matching memory, confidence, and token usage.
Get an API key
Open app.getmetacognition.com/signup, create an account, and copy the key shown once.
Run this script
first_call.py
You should see the shellfish line with a score, plus
confidence and token usage. If you get AuthenticationError, check your key and base_url, then use Troubleshooting.Next
Once the script works, decide how you want to load secrets and whether you want to stay on the SDK.Load the key from a .env file
Use python-dotenv or your framework’s loader. Keep .env out of git. In production, load TEX_API_KEY from your normal secret store.
Call the API without the SDK
If you do not use the SDK, first exchange your API key for an access token and refresh token. SendAuthorization: Bearer ... on ingest and recall. Refresh the access token when it expires. The REST API overview lists the endpoints.
The SDK does this for you.
Reads
| Goal | Page |
|---|---|
| Understand what gets stored | How memory works |
| Tune recall quality | Recall and ranking |
| Ship real users | Scopes and multi-tenancy |
| Put a backend in front of a UI | Production chatbot (FastAPI) |
| Production errors | Errors and retries |
How memory works
Turns, observations, entities after each
remember.Scopes for real users
Map
session_id (and tenants) to your product.FastAPI backend
Small service pattern behind a UI.
Errors and retries
What the SDK throws and what it retries.

