> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sense-lab.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Configure AMFS — environment variables, SDK options, and agent identity.

Configuration is minimal. Two environment variables connect you; everything else has sensible defaults.

## Environment Variables

| Variable        | Description                                                      | Required |
| :-------------- | :--------------------------------------------------------------- | :------- |
| `AMFS_HTTP_URL` | Your AMFS API URL (e.g. `https://amfs-login.sense-lab.ai`)       | Yes      |
| `AMFS_API_KEY`  | Your API key (from Dashboard → Settings → API Keys)              | Yes      |
| `AMFS_AGENT_ID` | Override auto-detected agent identity (for CI, scripts, servers) | No       |

When `AMFS_HTTP_URL` is set, the SDK and MCP server route all operations through the authenticated HTTP API. No config files, no adapter setup, no database connection strings.

```bash theme={null}
export AMFS_HTTP_URL="https://amfs-login.sense-lab.ai"
export AMFS_API_KEY="<your-api-key>"
```

***

## SDK Options

When using the Python SDK directly, pass options to the constructor:

```python theme={null}
from amfs import AgentMemory

mem = AgentMemory(
    agent_id="checkout-agent",
    decay_half_life_days=30.0,
)
```

| Parameter              | Type             | Description                                   |
| :--------------------- | :--------------- | :-------------------------------------------- |
| `agent_id`             | `str`            | Identity for this agent (required)            |
| `session_id`           | `str`            | Session identifier; auto-generated if omitted |
| `ttl_sweep_interval`   | `float`          | Seconds between TTL sweep runs                |
| `decay_half_life_days` | `float`          | Confidence decay half-life in days            |
| `conflict_policy`      | `ConflictPolicy` | How to handle concurrent write conflicts      |

The SDK auto-detects the HTTP adapter when `AMFS_HTTP_URL` is set — no adapter configuration needed.

***

## Agent Identity

Agents are identified by their `agent_id`. This determines:

* Who gets credit for writes (provenance)
* What shows up in the Dashboard
* How `recall()` and `my_entries()` scope results

**MCP agents** should call `amfs_set_identity` at the start of each session. Without it, identity is auto-detected from the IDE environment:

| Environment         | Detected ID              |
| :------------------ | :----------------------- |
| Cursor              | `cursor/<username>`      |
| Claude Code         | `claude-code/<username>` |
| `AMFS_AGENT_ID` set | value of `AMFS_AGENT_ID` |
| Fallback            | `agent/<username>`       |

**SDK and REST clients** pass `agent_id` in the constructor or header.

***

## Scoped API Keys

API keys can be restricted to specific entity paths and permissions:

```
amfs_sk_live_abc123  →  checkout-service/**  [READ_WRITE]
                        shared/patterns/*     [READ]
```

Create and manage scoped keys in **Dashboard → Settings → API Keys**. Use the narrowest scope that works — one key per agent or service.

***

## Namespaces

Namespaces isolate memory between environments. Entries in different namespaces don't see each other.

Namespaces are managed through the Dashboard. The default namespace is `default`.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/amfs/getting-started/quickstart">Write, read, and search memory.</Card>
  <Card title="MCP Setup" icon="plug" href="/amfs/guides/mcp">Connect your IDE to AMFS.</Card>
  <Card title="Core Concepts" icon="brain" href="/amfs/concepts/overview">How AMFS works under the hood.</Card>
  <Card title="Environment Variables" icon="list" href="/amfs/reference/environment-variables">Full reference with all options.</Card>
</CardGroup>
