Skip to main content
Glama

IMPORTANT

Ouso Code issource-available, not OSI-licensed open source. Personal, internal-company, evaluation, and local integration use are allowed; hosted competing services and commercial redistribution require permission. See LICENSE.md.

Every new chat, your coding agent forgets why you chose Postgres, what fixed last month's OOM, and the convention you agreed on yesterday โ€” so you re-explain your own codebase, again. Ouso Code gives it a memory that persists across sessions and editors, over MCP, running 100% on your machine: your own SQLite file, your own model. No account. No API key. Nothing leaves your laptop.

Why you'll actually use it

  • ๐Ÿ  Truly local. Your SQLite, your model โ€” local Ollama by default, or any OpenAI / Azure endpoint. Zero data leaves your machine unless you point it at a cloud model.

  • ๐Ÿงฉ One memory, every editor. Cursor, Claude Code, Codex, Windsurf, Claude Desktop โ€” capture in one, recall in all. One file. One brain. caller records which editor wrote each memory.

  • โšก 60-second setup. npm run setup writes ready-to-paste configs for all five editors, with your paths already filled in. No sign-up, no key.

  • ๐Ÿ’ธ Use the quota you already have. Let frontier models plan and review, while cheaper models handle small edits, tests, docs, and narrow subagent work from the same shared memory.

  • ๐ŸŽฏ Code-aware, not prose-aware. It splits identifiers the way you read them โ€” useAuth vs useUser, error E1042 vs E1043 โ€” so near-identical symbols don't blur together.

  • ๐Ÿ”ฌ Provable, not marketing. Every benchmark below runs on your machine in one command. No vendor numbers you can't check.

Related MCP server: AIVectorMemory

Install

Works on Windows, macOS, and Linux. No API key needed with local Ollama:

ollama pull nomic-embed-text   # default local embedder

Windows PowerShell:

git clone https://github.com/Ouso-ai/Ouso-Code.git
cd Ouso-Code
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1

macOS / Linux:

git clone https://github.com/Ouso-ai/Ouso-Code.git
cd Ouso-Code
bash scripts/install.sh

Manual path for any OS:

npm install
npm run setup

npm run setup creates .env, migrates your local SQLite DB, and writes ready-to-paste MCP configs with this machine's absolute paths. Full cross-platform guide: docs/INSTALL.md.

Connect your IDE

IDE

Where the generated config goes

Cursor

examples/generated/cursor-mcp.json โ†’ project .cursor/mcp.json or ~/.cursor/mcp.json

Claude Desktop

examples/generated/claude-desktop-mcp.json โ†’ macOS ~/Library/Application Support/Claude/claude_desktop_config.json ยท Windows %APPDATA%\Claude\claude_desktop_config.json ยท Linux ~/.config/Claude/claude_desktop_config.json

Windsurf

examples/generated/windsurf-mcp.json โ†’ ~/.codeium/windsurf/mcp_config.json

Codex

examples/generated/codex-config.toml block โ†’ ~/.codex/config.toml

Claude Code (CLI)

run the claude mcp add ouso-code โ€ฆ line that setup prints

The rhythm

Four calls, and your agent stops forgetting โ€” and stops wasting frontier-model tokens on tiny work:

memory_set_workspace   โ† on open: bind repo, branch, open files (later calls auto-scope)
memory_route_task      โ† before choosing a model: decide frontier vs lower-cost handoff
memory_recall_code     โ† before a model call: pull the memories that matter for the task
memory_add_fact        โ† after a decision or debug win: capture it in one line

That's it. Your agent recalls the right context going in, and banks what it learns coming out.

Tool

What it does

memory_set_workspace

Bind repo, branch, open files so later calls auto-scope

memory_route_task

Recommend frontier/balanced/economy model use and generate a shared-memory handoff prompt

memory_recall_code

Hybrid recall of the memories that matter for a query

memory_add_fact

Capture a decision / insight / fix instantly

memory_store

Persist conversation turns; keeps the salient one

memory_index_anchor

Link a file/symbol to a memory (no whole-repo indexing)

memory_list_recent

List the most recent memories for this repo

memory_record_delegate_result

Store lower-cost model/subagent results back into the shared memory

Model routing

Most teams burn their best model on everything: orchestration, risky refactors, one-line tests, README edits. Ouso Code adds a memory-backed router so Cursor, Codex, and Claude Code can use a simple split:

  • Frontier models (gpt-5.5, claude-opus-4.8, or your configured names) plan, coordinate, and review risky work.

  • Balanced/economy models (gpt-5.3-code-spark, claude-sonnet, or your configured names) handle small implementation, tests, docs, and narrow subagent tasks.

  • Ouso memory is the shared context layer, so the cheaper model gets the same repo decisions and can write its result back for the orchestrator to review.

Call memory_route_task before picking a model:

{
  "task": "Add a focused unit test for JWT refresh-token rotation.",
  "task_kind": "test",
  "risk": "low",
  "files": ["src/auth/tokens.ts"]
}

It returns primary_tier, delegate_tier, risk reasons, recalled memories, and a ready-to-paste handoff_prompt for the lower-cost model/subagent. MCP cannot force an IDE's model picker to switch; the tool gives the current model a concrete routing packet and shared-memory prompt. After the delegate finishes, call memory_record_delegate_result so the orchestrator and every future model can recall the work. See the full routing manual: docs/MODEL_ROUTING.md.

How recall works

Repo-scoped memories are ranked by four independent, well-known signals and combined with a vector-dominant weighted blend โ€” semantic match leads; keyword, recency, and workspace overlap rescue or break near-ties. When a query explicitly asks for the current/latest state, recency gets a transparent boost so stale notes stop winning just because they are semantically similar.

Signal

Method

Default

Semantic

cosine over embeddings

your model's dimension

Lexical

Okapi BM25 (code-aware: splits camelCase/snake_case)

k1=1.2, b=0.75

Recency

exponential decay

30-day half-life

Workspace

active-file overlap

on/off

Blend

min-max normalized, vector-dominant

base vector 1.0 / lexical 0.35 / recency 0.15 / workspace 0.35; freshness-intent recency 1.0

Every constant is a documented public default (override via OUSO_RECALL_WEIGHTS) โ€” nothing is secretly tuned. Recall only scores memories embedded with the same model; switch models? npm run reembed.

Reproducible evaluation

The repository includes synthetic fixtures that compare keyword-only, vector-only, and hybrid ranking over the same memories. Run both evaluations with your chosen embedder:

npm run compare
npm run compare:current

The second command tests a deliberately difficult case: an old fact and a newer superseding fact are both present, and the query asks what is true now. Results are printed from the model and configuration you actually ran. The deterministic mock embedder is useful for CI behavior tests, but it is not a quality benchmark; use Ollama or a real OpenAI-compatible embedding model for product evaluation.

Ouso Code exposes transparent local retrieval methods and their limitations. Fixed performance claims are intentionally omitted until a versioned result bundle records the model, configuration, raw output, and exact commit together.

Upgrade to hosted Ouso Recall

Ouso's hosted product uses the same MCP tool boundary, so you can swap the server entry without changing the surrounding editor workflow:

npx -y @ouso-ai/mcp-bridge   # needs OUSO_API_KEY from https://ouso.ai

Configuration

DATABASE_URL=file:./data/ouso-code.sqlite     # your local store

OUSO_EMBED_PROVIDER=ollama                     # ollama | openai | azure | mock
OUSO_EMBED_MODEL=nomic-embed-text
OLLAMA_BASE_URL=http://localhost:11434

# Cloud (OUSO_EMBED_PROVIDER=openai) โ€” OpenAI / Azure /v1 / any compatible proxy:
# OPENAI_API_KEY=sk-...           OR   AZURE_OPENAI_API_KEY=...
# OPENAI_BASE_URL=https://api.openai.com/v1   AZURE_OPENAI_ENDPOINT=https://<r>.openai.azure.com/openai/v1
# OPENAI_EMBED_MODEL=text-embedding-3-small   AZURE_OPENAI_EMBEDDING_DEPLOYMENT=...
# OUSO_EMBED_DIM=1024             # optional, force embedding dimension

# OUSO_RECALL_WEIGHTS=1.0,0.35,0.15,0.35   # vector,lexical,recency,activeFile; explicit override disables freshness boost
# OUSO_FUSION=weighted                # weighted (default) | rrf
# OUSO_STORAGE_DRIVER=sqlite          # only sqlite is built in today

# Optional display labels for memory_route_task handoff prompts:
# OUSO_MODEL_FRONTIER=gpt-5.5,claude-opus-4.8
# OUSO_MODEL_BALANCED=claude-sonnet,gpt-5.3-code-spark
# OUSO_MODEL_ECONOMY=gpt-5.3-code-spark,claude-sonnet

FAQ

Development

npm test                                 # typecheck + leak scan + smoke + routing + shared memory + MCP + maintenance tests
npm run typecheck
npm run leak-scan                         # blocks proprietary identifiers from leaking in
OUSO_SMOKE_MOCK=1 npm run test:smoke
npm run test:routing                      # model-routing acceptance tests
npm run test:shared                       # cross-IDE/shared-memory behavior
npm run test:mcp                          # starts the real MCP server and calls every tool
npm run test:maintenance                  # migrate + reembed maintenance paths
npm run eval                              # recall@k on committed scenarios
npm run compare                           # method comparison (this README's numbers)
npm run compare:current                   # the current-state task

npm test is the release gate: it uses mock embeddings, starts the real MCP stdio server, calls every public tool, verifies model routing and delegate-result recall, and checks migration/re-embedding paths without needing Ollama or an API key.


F
license - not found
-
quality - not tested
B
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ouso-ai/Ouso-Code'

If you have feedback or need assistance with the MCP directory API, please join our Discord server