Simple API
The Simple API provides opinionated, batteries-included endpoints for quick integration. No need to manage embeddings, types, or tiers—just send text and get results.
Tip
Remember
/v1/simple/rememberStore a memory with auto-classification, auto-embedding, and auto-consolidation. If a very similar memory exists (similarity > 0.90), it's merged automatically.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Memory content |
Example Request
curl -X POST "https://fathippo.ai/api/v1/simple/remember" \
-H "Authorization: Bearer mem_your_api_key" \
-H "Content-Type: application/json" \
-d '{"text": "User prefers TypeScript over JavaScript"}'Response (Created)
{
"id": "mem_abc123",
"stored": true
}Response (Consolidated)
If merged with an existing similar memory:
{
"id": "mem_existing456",
"stored": true,
"consolidated": true,
"mergedWith": "mem_existing456"
}Auto-Classification
The Simple API automatically detects memory type and importance based on content patterns:
| Pattern | Type | Tier |
|---|---|---|
"my name is", "I am called" | identity | critical |
"must always", "never ever", "fundamental" | constraint | critical |
"always", "never", "prefer", "important" | preference | high |
Default | fact | normal |
Recall
/v1/simple/recallSearch memories and get just the text content—perfect for injection into prompts. Automatically tracks access and updates memory strength.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Natural language search query |
limit | number | No | Max results (default: 5, max: 20) |
Example Request
curl -X POST "https://fathippo.ai/api/v1/simple/recall" \
-H "Authorization: Bearer mem_your_api_key" \
-H "Content-Type: application/json" \
-d '{"query": "user language preferences", "limit": 3}'Response
{
"results": [
"User prefers TypeScript over JavaScript",
"User likes Python for data science tasks",
"User wants concise code examples"
],
"count": 3
}Note
Get Context
/v1/simple/contextGet a pre-formatted context string ready to inject into your AI's system prompt. Combines critical and relevant memories into markdown format.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | User message for relevance matching |
limit | number | No | Max memories to include (default: 10) |
Example Request
curl -X POST "https://fathippo.ai/api/v1/simple/context" \
-H "Authorization: Bearer mem_your_api_key" \
-H "Content-Type: application/json" \
-d '{"message": "Help me write some code"}'Response
{
"context": "## User Context\n\n### Core Identity\n- User is John, a software engineer in Singapore\n- User prefers morning work hours (9am-12pm SGT)\n\n### Relevant Memories\n- User prefers TypeScript over JavaScript\n- User wants concise code examples\n- User likes functional programming patterns",
"tokensUsed": 78,
"memoriesUsed": 5
}Usage Pattern
Here's a complete example using the Simple API with OpenAI:
import requests
from openai import OpenAI
API_KEY = "mem_your_api_key"
BASE_URL = "https://fathippo.ai/api/v1/simple"
client = OpenAI()
def chat_with_memory(user_message: str) -> str:
# Get relevant context
context_resp = requests.post(
f"{BASE_URL}/context",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"message": user_message}
).json()
# Build messages
messages = [
{
"role": "system",
"content": f"You are a helpful assistant.\n\n{context_resp['context']}"
},
{"role": "user", "content": user_message}
]
# Get response
response = client.chat.completions.create(
model="gpt-4o",
messages=messages
)
assistant_message = response.choices[0].message.content
# Store any learnings (could be extracted from conversation)
if "remember" in user_message.lower():
requests.post(
f"{BASE_URL}/remember",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"text": user_message}
)
return assistant_message
# Example
response = chat_with_memory("Remember that I prefer dark mode")
print(response)