Documentation

SourceAnt Memory Docs

Everything you need to give your AI tools persistent project context.

Quick Start

Get context flowing to your AI tools in three steps:

1

Sign in and connect a repository

Go to the dashboard and connect your GitHub repository. Memory will analyze the codebase and generate initial context proposals.

2

Review proposals

AI-generated context proposals appear on the Proposals page. Approve, edit, or reject them. Approved proposals become active context objects.

3

Configure the MCP server

Run npx @sourceant/memory setup --token YOUR_TOKEN in your project directory, or manually add the config to your AI tool. Context flows automatically when your AI touches relevant code.

MCP Setup

The fastest way to get started — run this in your project directory:

Quick setup
npx @sourceant/memory setup --token YOUR_TOKEN

This configures the MCP server and sets up automatic context retrieval for any MCP-compatible tool (Claude Code, Claude Desktop, VS Code, Cursor, Windsurf, etc.).

Manual configuration

Alternatively, add the following to your MCP client configuration:

mcp_config.json
{
  "mcpServers": {
    "sourceant-memory": {
      "command": "npx",
      "args": ["-y", "@sourceant/memory"],
      "env": {
        "SOURCEANT_TOKEN": "<your-token>"
      }
    }
  }
}

Get your token from the Settings page in the dashboard.

MCP Tools

get_context

Retrieves relevant context before modifying code. Returns decisions, constraints, and workarounds that apply to the specified files or symbols.

ParameterTypeDescription
pathsstring[]File paths being modified
symbolsstring[]Function or class names being modified
intentstringWhat you're trying to accomplish
repostringRepository in owner/name format (optional)
Example
get_context({
  paths: ["src/api/auth/login.ts"],
  symbols: ["validateToken"],
  intent: "refactoring error handling"
})

propose_context

Proposes a new context object for human review. Use when you discover important constraints or decisions during a coding session.

ParameterTypeDescription
kindstringOne of: decision, constraint, workaround, convention, plan
summarystringOne-line summary of the context
whystringDetailed explanation of why this matters
repostringRepository in owner/name format (required)
scopeobjectPaths and symbols this context applies to
Example
propose_context({
  kind: "decision",
  summary: "Use JWTs for API auth",
  why: "Stateless auth allows horizontal scaling without session storage.",
  repo: "myorg/myapp",
  scope: {
    paths: ["src/auth/"],
    symbols: ["authenticate", "verifyToken"]
  }
})

Context Kinds

Decision

A deliberate choice made by the team. Example: "Use PostgreSQL JSONB for flexible schema storage."

Constraint

An external limitation that affects implementation. Example: "API rate limit of 100 req/min on the payments provider."

Workaround

A temporary solution for a known issue. Example: "Retry with exponential backoff due to upstream flakiness."

Convention

A team standard or pattern. Example: "All API responses use the envelope format with data/error/meta keys."

Plan

Something planned or intended for the future. Example: "Migrate from REST to GraphQL in Q3 starting with the read endpoints."

Organization Contexts

Organization contexts apply across all your repositories. Use them for team-wide standards like security practices, commit conventions, and testing guidelines.

Create and manage them from the Organization page in the dashboard. Tag contexts with categories like security, testing, or architecture for easy filtering.

Organization contexts are served alongside repository-specific contexts when your AI tools query Memory, ensuring team standards are always visible.

API Reference

The Memory API is available at /api/memory/. All endpoints require authentication via your SourceAnt session.

GET/api/memory/repos/{id}/contexts

List context objects for a repository. Supports kind, status, and q query params.

POST/api/memory/repos/{id}/contexts

Create a new context object. Body: kind, summary, why, scope_paths, scope_symbols.

GET/api/memory/org/contexts

List organization-wide context objects. Supports kind, status, and q query params.

POST/api/memory/org/contexts

Create an organization context. Body: kind, summary, why, scope_tags.

GET/api/memory/proposals

List all proposals across connected repositories.

PUT/api/memory/proposals/{id}/approve

Approve a proposal, creating an active context object from it.

PUT/api/memory/proposals/{id}/reject

Reject a proposal.