Skip to main content
Glama
README.md
# MemoryLane

**MemoryLane gives AI agents durable context.**

Agent-native memory layer for persistent context, semantic recall, session history, SDK, CLI, API, and MCP.

[![npm](https://img.shields.io/npm/v/@talocode/memorylane)](https://www.npmjs.com/package/@talocode/memorylane)
[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

---

## Install

```bash
npm install -g @talocode/memorylane
```

Or run directly:

```bash
npx @talocode/memorylane demo
```

## Quick Start

```bash
# Save a memory
memorylane remember "User prefers short, direct X posts" --tag writing --tag preference

# Recall it later
memorylane recall "How should I write X posts?"

# Search memories
memorylane search "Talocode"

# List everything
memorylane list

# Run interactive demo
memorylane demo
```

## CLI

```bash
memorylane --version
memorylane --help

# Core commands
memorylane remember <text> [--tag ...] [--importance N] [--session id]
memorylane recall <query> [--limit N] [--tags ...]
memorylane search <query> [--limit N] [--tags ...]
memorylane list [--limit N] [--tag ...]
memorylane get <id>
memorylane delete <id>
memorylane clear --yes

# Sessions
memorylane sessions create --title "My Session"
memorylane sessions list
memorylane sessions show <sessionId>

# Import/Export
memorylane export --out export.json
memorylane import export.json

# Server
memorylane serve --port 3040

# MCP
memorylane mcp

# Diagnostics
memorylane doctor
memorylane demo
```

## API

Start the server:

```bash
memorylane serve --port 3040
```

### Endpoints

| Method | Path | Description |
|--------|------|-------------|
| GET | `/health` | Health check |
| GET | `/v1/memorylane/health` | API health check |
| GET | `/v1/memorylane/capabilities` | List available endpoints |
| POST | `/v1/memorylane/memories` | Save a memory |
| GET | `/v1/memorylane/memories` | List memories |
| GET | `/v1/memorylane/memories/:id` | Get a memory |
| DELETE | `/v1/memorylane/memories/:id` | Delete a memory |
| POST | `/v1/memorylane/recall` | Recall memories |
| POST | `/v1/memorylane/search` | Search memories |
| POST | `/v1/memorylane/sessions` | Create a session |
| GET | `/v1/memorylane/sessions` | List sessions |
| GET | `/v1/memorylane/sessions/:id` | Get session with memories |
| POST | `/v1/memorylane/export` | Export all data |
| POST | `/v1/memorylane/import` | Import data |

### Example

```bash
curl -X POST http://localhost:3040/v1/memorylane/memories \
  -H "Content-Type: application/json" \
  -d '{"text": "User prefers short posts", "tags": ["writing", "preference"], "importance": 8}'

curl -X POST http://localhost:3040/v1/memorylane/recall \
  -H "Content-Type: application/json" \
  -d '{"query": "How should I write?", "limit": 5}'
```

## SDK

```typescript
import { MemoryLaneClient } from "@talocode/memorylane";

const memory = new MemoryLaneClient({ baseUrl: "http://localhost:3040" });

await memory.remember({
  text: "User prefers short posts",
  tags: ["writing", "preference"],
  importance: 8,
});

const results = await memory.recall({
  query: "How should I write?",
  limit: 5,
});
```

## MCP

Add to your MCP config:

```json
{
  "mcpServers": {
    "memorylane": {
      "command": "memorylane",
      "args": ["mcp"]
    }
  }
}
```

Available tools: `memorylane_remember`, `memorylane_recall`, `memorylane_search`, `memorylane_list_memories`, `memorylane_create_session`, `memorylane_list_sessions`, `memorylane_export`, `memorylane_import`.

## Cloud Auth

Local usage is open-source and keyless. For Talocode Cloud API access, set:

```bash
export TALOCODE_API_KEY="your-key"
export MEMORYLANE_CLOUD_MODE=true
```

## Install Options

- **npm**: `npm install -g @talocode/memorylane`
- **npx**: `npx @talocode/memorylane`
- **Linux/macOS**: `curl -fsSL https://raw.githubusercontent.com/talocode/memorylane/main/install.sh | bash`
- **Windows**: `iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/talocode/memorylane/main/install.ps1'))`
- **Android (Termux)**: `pkg install nodejs && npm install -g @talocode/memorylane`

## Examples

See the [examples](./examples) directory:
- [Basic Agent Memory](./examples/basic-agent-memory/README.md)
- [Session Recall](./examples/session-recall/README.md)
- [MCP Agent Memory](./examples/mcp-agent-memory/README.md)

## Docs

- [API Reference](./docs/API.md)
- [CLI Reference](./docs/CLI.md)
- [SDK Reference](./docs/SDK.md)
- [MCP Reference](./docs/MCP.md)
- [Cloud Auth](./docs/CLOUD_AUTH.md)
- [Install Guide](./docs/INSTALL.md)

## Talocode ecosystem

Part of **[Talocode](https://github.com/talocode)** — open-source workflow layers for builders. Explore sibling projects:

| Project | What it is |
|---------|------------|
| **[ScreenLane](https://github.com/talocode/screenlane)** | Screen-aware voice command layer |
| **[Tera](https://github.com/talocode/tera)** | AI chat & assistant |
| **[Codra](https://github.com/talocode/codra)** | Local coding agent |
| **[GateLane](https://github.com/talocode/gatelane)** | MCP gateway & agent tool control plane |
| **[ContextLane](https://github.com/talocode/contextlane)** | Context ingestion for persistent agents |
| **[MemoryLane](https://github.com/talocode/memorylane)** | Persistent agent memory **(this repo)** |
| **[SignalLane](https://github.com/talocode/signallane)** | X growth intelligence |
| **[ReplyLane](https://github.com/talocode/replylane)** | X reply opportunity intelligence |
| **[CrawlerLane](https://github.com/talocode/crawlerlane)** | Crawler / SEO intelligence |
| **[WebDataLane](https://github.com/talocode/webdatalane)** | Web extraction to structured data |
| **[SearchLane](https://github.com/talocode/searchlane)** | Search layer for agents |
| **[InvoiceLane](https://github.com/talocode/invoicelane)** | Invoicing tools |
| **[GeoLane](https://github.com/talocode/geolane)** | Geo intelligence |
| **[UgcLane](https://github.com/talocode/ugclane)** | UGC workflows |
| **[OpenSourceLane](https://github.com/talocode/opensourcelane)** | Open-source distribution tools |
| **[StackLane](https://github.com/talocode/stacklane)** | Builder stack platform |
| **[Tradia](https://github.com/talocode/tradia)** | Trading intelligence |
| **[Agent Browser](https://github.com/talocode/agent-browser)** | Browser automation for agents |
| **[Talocode](https://github.com/talocode/talocode)** | Org home & control plane |
| **[Skills](https://github.com/talocode/skills)** | Shared agent skills |
| **[X Agent](https://github.com/talocode/x-agent)** | X automation agent |
| **[LaunchPix](https://github.com/talocode/launchpix)** | Launch tooling |
| **[ForgeCAD](https://github.com/talocode/forgecad)** | CAD workflows |
| **[WorkLane](https://github.com/talocode/worklane)** | Work automation |
| **[ClipLoop](https://github.com/talocode/cliploop)** | Clip / video loops |

MCP-compatible agents integrate via each product's MCP server where available ([Model Context Protocol](https://modelcontextprotocol.io/)).

More: [github.com/talocode](https://github.com/talocode) · [talocode.site](https://talocode.site) · [docs.talocode.site](https://docs.talocode.site)

## License

MIT

Maintenance

ActivityStale
ResponsivenessNo issues