File size: 1,803 Bytes
dbb04e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# MnemoCore API Reference (Beta)

## Beta Notice

API contracts may change during beta without backward compatibility guarantees.
Use pinned commits if you need reproducibility.

## Base URL

Default local API URL:
- `http://localhost:8100`

## Endpoints

### `GET /`
Basic service status.

### `GET /health`
Returns health status, Redis connectivity, and engine stats.

### `POST /store`
Store a memory.

Request body:
```json

{

  "content": "string",

  "metadata": {"key": "value"},

  "agent_id": "optional-string",

  "ttl": 3600

}

```

### `POST /query`
Query semantic memory.

Request body:
```json

{

  "query": "string",

  "top_k": 5,

  "agent_id": "optional-string"

}

```

### `GET /memory/{memory_id}`

Fetch a memory by ID (Redis-first, engine fallback).



### `DELETE /memory/{memory_id}`
Delete a memory by ID.

### `POST /concept`
Define a concept for conceptual memory operations.

### `POST /analogy`
Run analogy inference.

### `GET /stats`
Return engine statistics.

### `GET /metrics`
Prometheus metrics endpoint.

## Example Requests

Store:
```bash

curl -X POST http://localhost:8100/store \

  -H "Content-Type: application/json" \

  -d '{"content":"Birds can migrate long distances"}'

```

Query:
```bash

curl -X POST http://localhost:8100/query \

  -H "Content-Type: application/json" \

  -d '{"query":"animal migration","top_k":3}'

```

## Error Behavior

- `404` for missing memory IDs.
- In degraded infrastructure modes, API may still return successful core operations while external storage writes fail.

## Compatibility Guidance

During beta, treat responses as evolving contracts:
- Parse defensively.
- Avoid rigid coupling to optional fields.
- Revalidate after version upgrades.