Sign up at atlas.bsyncs.com, create an organisation, and generate an API key from the Dashboard → API Keys tab.Your key will look like: atlas_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Store your API key in an environment variable — never hardcode it in source files.
import osfrom atlas_mem import AtlasMembrain = AtlasMem( api_key=os.environ["ATLAS_API_KEY"], base_url="https://api.bsyncs.com", # or your self-hosted URL user_id="user-123", # isolate memories per user session_id="session-abc", # optional: enables working memory)# Store a factbrain.add("Sarah Jenkins is the Lead Software Engineer at Acme Corp.")brain.add("Acme Corp recently migrated their primary database to PostgreSQL.")brain.add("Sarah prefers async Python and has 8 years of backend experience.")# Search for relevant contextresults = brain.search("Who manages engineering at Acme?")# Inject into your LLM system promptprint(results.format())
Expected output:
[Memory Context]- Sarah Jenkins is the Lead Software Engineer at Acme Corp. (high confidence, via episodic)- sarah_jenkins WORKS_AT acme_corp (high confidence, via semantic)- Sarah prefers async Python and has 8 years of backend experience. (medium confidence, via episodic)