Skip to content

Latest commit

 

History

History
155 lines (122 loc) · 3.7 KB

File metadata and controls

155 lines (122 loc) · 3.7 KB
title Quickstart
description Start Memongo, add one memory, and search it.
icon play

Prerequisites

  • Node.js 20+
  • Bun 1.2+
  • Docker, for local MongoDB

1. Clone and install

git clone https://github.com/romiluz13/memongo.git
cd memongo
bun install

2. Start MongoDB

For the default local path:

docker compose -f docker/docker-compose.yml up -d
export MEMONGO_MONGODB_URI="mongodb://127.0.0.1:27017/?directConnection=true"
export MEMONGO_API_KEY="local-dev-secret"

For Atlas Local Preview with MongoDB automated embeddings:

export VOYAGE_API_KEY="al-your-atlas-model-api-key"
./docker/mongodb/start-preview.sh
export MEMONGO_MONGODB_URI="mongodb://127.0.0.1:27017/?directConnection=true"

VOYAGE_API_KEY must be a MongoDB Atlas Model API key with the al-... prefix when you use MongoDB auto-embed. Direct Voyage keys with the pa-... prefix do not enable MongoDB auto-embed.

3. Start the API

cd apps/api
bun run dev

The API runs at http://127.0.0.1:3847.

4. Verify

curl -s http://127.0.0.1:3847/health
curl -s http://127.0.0.1:3847/v1/status \
  -H "authorization: Bearer local-dev-secret"

Look for a healthy API response and a memory status payload.

5. Add and search memory

```typescript import { MemongoClient } from "@memongo/client";

const client = new MemongoClient({ baseUrl: "http://127.0.0.1:3847", apiKey: "local-dev-secret", });

await client.add({ content: "The user prefers dark mode and TypeScript.", sessionId: "user-123", });

const results = await client.search({ query: "What are the user's preferences?", sessionKey: "user-123", maxResults: 5, });

console.log(results);

</Tab>
<Tab title="cURL">
```bash
curl -s http://127.0.0.1:3847/v1/add \
  -H "content-type: application/json" \
  -H "authorization: Bearer local-dev-secret" \
  -d '{"content":"The user prefers dark mode and TypeScript.","sessionId":"user-123"}'

curl -s http://127.0.0.1:3847/v1/search \
  -H "content-type: application/json" \
  -H "authorization: Bearer local-dev-secret" \
  -d '{"query":"What are the user preferences?","sessionKey":"user-123","maxResults":5}'

Optional surfaces

Memongo can be used directly by apps or exposed to agents as a Company Brain. Start read-first, then add explicit write workflows once scopes and safety are clear.

Operator console:

cd apps/web
MEMONGO_API_URL=http://127.0.0.1:3847 bun run dev

MCP server:

cd apps/mcp
MEMONGO_API_URL=http://127.0.0.1:3847 \
MEMONGO_API_KEY=local-dev-secret \
bun run start

Common endpoints

Method Path Description
GET /health Service health
GET /openapi.json OpenAPI document
GET /v1/status Memory provider status
POST /v1/add Add content to memory
POST /v1/write-event Write conversation event
POST /v1/write-structured Write structured memory
POST /v1/search Search memory
POST /v1/search-kb Search knowledge base
POST /v1/profile Synthesize a profile
POST /v1/context-bundle Build an answer-ready context bundle

Next steps

Learn how Memongo stores and retrieves memory. Understand the Company Brain contract. Understand packages, data flow, and deployment. Connect MCP clients and AI apps safely.