Metadata-Version: 2.4
Name: contextmesh
Version: 1.0.0
Summary: Persistent semantic memory layer for AI agents
Project-URL: Homepage, https://contextmesh.dev
Project-URL: Documentation, https://docs.contextmesh.dev
Project-URL: Repository, https://github.com/contextmesh/contextmesh
Project-URL: Bug Tracker, https://github.com/contextmesh/contextmesh/issues
Author-email: ContextMesh <hello@contextmesh.dev>
License: MIT
License-File: LICENSE
Keywords: agents,ai,claude,context,cursor,embeddings,llm,mcp,memory,semantic-search,vector
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# ContextMesh

**Persistent memory layer for AI agents.**

Every agent starts blind. ContextMesh gives them shared memory.

## What it is

A simple API + vector store that any AI agent (Claude, Cursor, custom) can write context to and read from. Namespaced per workspace. Semantic search. Cross-tool, cross-session.

## Structure

```
contextmesh/
  api/
    vector_store.py   # Qdrant wrapper — embed, store, query
    embedder.py       # text → 1536-dim vector (OpenAI ada-002)
    main.py           # FastAPI — 4 endpoints
    auth.py           # API key validation + plan limits
    requirements.txt
  mcp_server.py       # MCP protocol server (stdio)
  sdk/
    contextmesh.py    # Python SDK
    contextmesh.js    # JS/TS SDK
  dashboard/
    index.html        # Web dashboard
  landing/
    index.html        # Marketing landing page
  infra/
    docker-compose.yml
```

## Quick Start

### 1. Run locally

```bash
cd infra
OPENAI_API_KEY=sk-... docker-compose up
```

### 2. Generate a dev key

```bash
curl -X POST "http://localhost:8000/dev/generate-key?workspace_id=myteam&plan=team"
```

### 3. Use the Python SDK

```python
from contextmesh import Mesh
mesh = Mesh("cm_live_your_key", base_url="http://localhost:8000")

mesh.remember("prod DB is postgres 15 on AWS us-east-1", tags=["database"])
results = mesh.query("what should I know about our database?")
```

### 4. Use the MCP server

Add to `~/.cursor/mcp.json` or `~/.claude/mcp.json`:

```json
{
  "contextmesh": {
    "command": "python3",
    "args": ["/path/to/contextmesh/mcp_server.py"],
    "env": {
      "CM_KEY": "cm_live_your_key",
      "CM_URL": "http://localhost:8000"
    }
  }
}
```

## API Endpoints

| Method | Path | Description |
|--------|------|-------------|
| POST | /remember | Store context |
| POST | /query | Semantic search |
| DELETE | /forget/{id} | Remove entry |
| GET | /list | Browse entries |
| GET | /usage | Check plan usage |
| GET | /health | Liveness check |

## Deploy to Fly.io

```bash
fly launch
fly secrets set OPENAI_API_KEY=sk-... REDIS_URL=redis://...
fly deploy
```

## Pricing (production)

| Plan | Price | Workspaces | Entries | Queries/mo |
|------|-------|-----------|---------|-----------|
| Solo | $19/mo | 1 | 500k | 100k |
| Team | $99/mo | 10 | 5M | 1M |
| Enterprise | $599/mo | ∞ | ∞ | ∞ |
