Skip to main content
Glama
Thrizzio
by Thrizzio

LifeOS — Local-First Personal Context Layer for AI Agents

AI agents are powerful, but they have amnesia.
Every new conversation starts with zero knowledge of the person they are helping. Users are forced to re-explain their background, their goals, their active projects, and how they want to be spoken to.
LifeOS solves this by providing a local-first personal context and memory layer that gives AI agents access to the user's canonical knowledge through the Model Context Protocol (MCP).

    +-------------------------------------------------------------+
    |                      AI Reasoning Layer                     |
    |       Google Antigravity Agent  OR  Local Open LLM (Ollama) |
    +-------------------------------------------------------------+
                                   ▲
                          JSON-RPC │ over stdio
                                   ▼
    +-------------------------------------------------------------+
    |                      LifeOS MCP Server                      |
    |  - lifeos_get_context()         - lifeos_search()           |
    |  - lifeos_read_file()           - lifeos_get_instructions() |
    |  - lifeos_list_topics()         - lifeos_add_memory()       |
    +-------------------------------------------------------------+
            │                                             │
      Path Validation                               Vector Search
            ▼                                             ▼
+───────────────────────────+                 +───────────────────────────+
│   Canonical Truth Store   │                 │   Derived Vector Index    │
│   Plain Markdown Files    │                 │   PostgreSQL + pgvector   │
│   vault/<category>/*.md   │                 │   chunks table (dim: 384) │
+───────────────────────────+                 +───────────────────────────+
            │                                             ▲
      Watchdog Events                                     │
            └───────────────▶ Vault Indexer ──────────────┘
                              FastEmbed (Local ONNX)
                              BAAI/bge-small-en-v1.5

Core Philosophy: The Canonical Truth Inversion

  1. Markdown is the Canonical Source of Truth: Your life context lives in human-readable Markdown files on your own computer (vault/).

  2. PostgreSQL + pgvector is a Disposable Derived Index: The database exists solely to accelerate semantic vector search. If the database is deleted, the entire index is rebuilt from disk in seconds.

  3. Model Independence: Your memory belongs to you, not an AI vendor. Switch reasoning engines from Antigravity to local Ollama (Llama 3.2, Mistral, Qwen) without changing your vault or database.

  4. 100% Local & Zero Telemetry: Local embeddings via FastEmbed, local vector storage, and zero cloud API fees.


Related MCP server: Brainstem

Features

  • MCP stdio Protocol Discipline: Standard output (stdout) is strictly reserved for clean JSON-RPC traffic. All logs, diagnostics, and progress bars route to stderr or lifeos.log.

  • FastEmbed Local Embeddings: High-performance local ONNX embeddings with BAAI/bge-small-en-v1.5 generating 384-dimensional dense vectors with sub-20ms latency.

  • Deterministic Context Bootstrap (lifeos_get_context): Instant orientation reading profile, current goals, and behavioral instructions without vector search overhead.

  • Semantic Retrieval with Explicit Provenance: Every search hit cites its source document, heading, and similarity score ([Source: projects/chronolog.md | Heading: Architecture]).

  • Strict Vault Security: Path traversal protection, category whitelisting, lowercase kebab-case naming enforcement, and symlink escape defenses.

  • Controlled Memory Partition (vault/memory/): Agent-created memories are quarantined with YAML frontmatter metadata and cannot overwrite canonical user files.

  • Live Synchronization (watchdog): Vault edits automatically update the derived vector index in the background with event debouncing.


Quickstart

Prerequisites

  • Python 3.11+

  • Docker & Docker Compose (or local PostgreSQL with pgvector)

1. Clone & Set Up Virtual Environment

git clone https://github.com/your-username/LifeOS-MCP-weekend-challenge.git
cd LifeOS-MCP-weekend-challenge

# Create venv and install dependencies
uv venv .venv
.\.venv\Scripts\activate      # Windows
# source .venv/bin/activate   # macOS / Linux
uv pip install -r requirements.txt

2. Start PostgreSQL with pgvector

docker compose up -d

3. Run Setup & Pre-warm Local Embeddings

python scripts/setup.py

This verifies your environment, initializes database tables, downloads local embedding weights so the model is 100% offline, and verifies vault partitions.

4. Index the Vault

# Index your vault (or test with VAULT_PATH=./examples/sample_vault)
python scripts/index.py

5. Verify the System

python scripts/verify.py

MCP Server Tools

LifeOS exposes exactly 6 intentional, safe tools:

Tool

Signature

Purpose

lifeos_get_context

()

Deterministic bootstrap snapshot: profile, goals, active projects, and communication boundaries.

lifeos_search

(query: str, category: Optional[str] = None, top_k: int = 5)

Semantic vector search with explicit provenance headers.

lifeos_read_file

(relative_path: str)

Read exact Markdown file contents after strict boundary validation.

lifeos_get_instructions

()

Fast direct read of identity/how_i_want_ai_to_treat_me.md.

lifeos_list_topics

()

Structured tree summary of all categories and tracked files.

lifeos_add_memory

(category: str, filename: str, content: str)

Controlled memory write quarantined to vault/memory/ with agent metadata.


Antigravity Integration

Add LifeOS to your Antigravity MCP configuration:

{
  "mcpServers": {
    "lifeos": {
      "command": "C:/DEV WORK/Hactoberfest 2026/LifeOS-MCP-weekend-challenge/.venv/Scripts/python.exe",
      "args": [
        "C:/DEV WORK/Hactoberfest 2026/LifeOS-MCP-weekend-challenge/lifeos/server.py"
      ],
      "env": {
        "PYTHONUNBUFFERED": "1"
      }
    }
  }
}

Reload MCP servers in Antigravity. The agent will automatically call lifeos_get_context and lifeos_search when working with you. See docs/antigravity.md for full instructions.


Example Interactions

"Review my current gym plan."

LifeOS retrieves health/gym.md and health/routines.md, providing feedback aligned with your PPL routine and shoulder mobility notes.

"Should I work on Chronolog or PhysioEvidence tonight?"

LifeOS searches your goals and journal, citing [Source: journal/2026-10-02.md] to remind you that Chronolog is your sole primary portfolio priority for systems internships.

"How should you respond when I start catastrophizing about my progress?"

LifeOS reads identity/how_i_want_ai_to_treat_me.md, refuses empty cheerleading, checks actual git logs against goals/current.md, and gives you 1–3 concrete, high-leverage next actions.


Running Standalone Local Reasoning (Ollama)

Ensure Ollama is running (ollama serve) with llama3.2:

python -m lifeos.local_model "Based on my current goals, what is my biggest technical priority?"

See docs/local-model.md for hardware guides and setup details.


Testing

Run the test suite (100% offline with zero cloud dependencies):

python -m pytest tests/ -v

Project Structure

├── ARCHITECTURE.md          # Living architectural specification
├── CONTEXT.md               # Domain vocabulary and concepts
├── LICENSE                  # MIT License
├── Makefile                 # Developer shortcuts
├── README.md                # Project documentation
├── docker-compose.yml       # Local PostgreSQL + pgvector container
├── pyproject.toml           # Packaging configuration
├── requirements.txt         # Pinned project dependencies
│
├── vault/                   # User's private Markdown vault (gitignored)
│   └── <category>/.gitkeep  # Preserved directory structure
│
├── examples/
│   ├── antigravity/         # Antigravity MCP config and agent instructions
│   └── sample_vault/        # Committed synthetic demo vault
│
├── lifeos/                  # Core Python package
│   ├── config.py            # Settings and environment validation
│   ├── models.py            # Pydantic data schemas
│   ├── vault.py             # Path security and vault manager
│   ├── chunker.py           # Markdown section parser & hashing
│   ├── embeddings.py        # Local FastEmbed provider (384-dim)
│   ├── database.py          # PostgreSQL + pgvector client
│   ├── indexer.py           # Vault scanner and batch synchronizer
│   ├── retrieval.py         # Semantic search & provenance formatter
│   ├── memory.py            # Controlled agent memory writer
│   ├── watcher.py           # Real-time watchdog filesystem observer
│   ├── local_model.py       # Offline Ollama reasoning agent
│   └── server.py            # MCP Server over stdio
│
├── scripts/
│   ├── setup.py             # Setup and pre-warm script
│   ├── index.py             # CLI vault indexer
│   └── verify.py            # Diagnostic check script
│
├── tests/                   # Pytest automated test suite
└── docs/                    # Architectural and integration guides
    ├── adr/                 # Architecture Decision Records
    ├── antigravity.md       # Antigravity setup guide
    ├── architecture.md      # Deep-dive architecture notes
    ├── hackathon-submission.md # Pitch and demo scripts
    ├── local-model.md       # Local LLM guide
    ├── security.md          # Threat model and defenses
    └── vault-format.md      # Vault formatting specifications

License

MIT License. See LICENSE for details.

Available Tools

6 tools
lifeos_add_memoryA

Store an agent-generated memory entry under vault/memory/.

Restricted write operation:

  • Memory is always written physically into vault/memory/{filename}.md.

  • 'category' is recorded as metadata only.

  • Canonical files (identity, goals, projects, career, health, learning) cannot be overwritten.

  • Injects YAML frontmatter with source: agent and timestamp.

  • Automatically indexes the new memory into pgvector.

Args: category: Semantic category metadata tag (e.g. 'work', 'preferences', 'decisions'). filename: Kebab-case filename ending with .md (e.g. '2026-10-02-backend-priority.md'). content: The Markdown text to record.

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes
categoryYes
filenameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does it well: it discloses the physical write path, that category is metadata-only, that canonical files are protected from overwrite, frontmatter injection (source: agent + timestamp), and a pgvector indexing side effect. It does not say what error/return occurs if a canonical filename is attempted or whether any permissions are required.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the primary action, then a tight bulleted list of behavioral constraints, then args. The Args block partly restates names already implied by the schema, a minor redundancy, but every bullet earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and the description thoroughly covers write semantics for an unannotated mutation tool. The remaining gap is failure behavior for the protected canonical-file case and any auth prerequisites.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% (bare titles only), so the description must compensate — and it does, documenting all three params with format constraints (kebab-case, .md suffix) and concrete examples for both filename and category.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Store) and resource (agent-generated memory entry) plus the exact destination path (vault/memory/). All five siblings are read-only retrieval tools, so this write tool is trivially distinguishable from them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'agent-generated memory entry' implies the caller context (an agent persisting its own findings), but there is no explicit when-to-use, when-not-to-use, or routing guidance versus alternatives. Usage is inferable rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lifeos_get_contextA

Return a compact, deterministic bootstrap context snapshot for the user.

Reads core canonical files directly (profile, communication instructions, current goals, and active project overviews). This is a deterministic bootstrap operation that does not perform vector search or dump the vault.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it explicitly states the operation is deterministic, does not perform vector search, and does not dump the vault, which sets clear expectations about scope and safety. However, it doesn't mention the return format beyond "snapshot" or any caching/idempotency guarantees, leaving a small gap for a no-annotation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is tightly worded and front-loaded, opening with the primary purpose in the first sentence and qualifying scope in the second. The final sentence partially repeats the "deterministic" qualifier but adds the useful negative constraints, so it mostly earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema, the description does not need to enumerate return values, and it focuses appropriately on what is read and what is not done. It is nearly complete for a read-only bootstrap tool, though it could briefly mention the expected read-only/non-mutating nature to align with the absent annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so the baseline is 4 per the scoring rules. The description appropriately does not discuss parameters since none exist, and it correctly focuses on behavioral scope instead.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (Return) and resource (compact, deterministic bootstrap context snapshot) and enumerates exactly what is read (profile, communication instructions, current goals, active project overviews). This clearly distinguishes it from siblings like lifeos_search and lifeos_read_file by describing a scoped, read-only bootstrap operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly establishes this as a deterministic bootstrap operation that does not perform vector search or dump the vault, implicitly contrasting it with lifeos_search. It gives strong context for when to use it (bootstrap), though it doesn't name a specific alternative tool by name for the non-bootstrap case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lifeos_get_instructionsA

Retrieve the user's explicit personal instructions from identity/how_i_want_ai_to_treat_me.md.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. 'Retrieve' correctly implies a non-destructive read and it discloses the exact backing file, which is useful behavioral context. It says nothing about what happens if the file is absent or about auth/permissions, so gaps remain for a no-annotation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that front-loads the action and resource with zero filler. Nothing to trim.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists and there are no parameters, so the description needn't explain return values or arguments. The main uncovered case is failure behavior when the referenced file does not exist, which is minor for a simple read.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so per the baseline there is nothing for the description to clarify. No misleading parameter claims are made.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Retrieve) and resource (the user's explicit personal instructions), and pins down the exact source file identity/how_i_want_ai_to_treat_me.md. That source path distinguishes it from generic siblings like lifeos_read_file, though it doesn't explicitly name the alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to use this versus lifeos_get_context, lifeos_read_file, or lifeos_search. The intent is inferable from the resource name, but no condition, prerequisite, or alternative is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lifeos_list_topicsA

List all vault categories and tracked Markdown files in a concise hierarchy.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. "List" implies a read-only operation and "concise hierarchy" hints at the output structure, but permissions, side effects, and other behavioral traits are not explicitly stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that communicates the scope and output shape with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple, parameterless list tool with an output schema, the description is nearly complete: it states what is listed and implies a hierarchical result. The only minor gap is the lack of explicit behavioral context, but the output schema covers return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so there are no parameter semantics to document. The baseline score for a parameterless tool is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ("List") and names the resources ("vault categories and tracked Markdown files"). It is clear what the tool does, but it does not explicitly differentiate itself from sibling tools such as lifeos_search or lifeos_read_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states what the tool does but provides no guidance on when to use it versus alternatives like lifeos_search or lifeos_get_context. There are no exclusions or usage conditions mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lifeos_read_fileA

Read the exact contents of a specific Markdown file from the vault.

Strict path validation prevents directory traversal outside the vault root.

Args: relative_path: Vault-relative path (e.g. 'projects/chronolog.md', 'identity/values.md').

ParametersJSON Schema
NameRequiredDescriptionDefault
relative_pathYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It usefully discloses that strict path validation prevents directory traversal outside the vault root, which is real behavioral context. However, it says nothing about read-only guarantees, error behavior for missing files, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, followed by a short security note and a clearly labeled Args section. Efficient overall, though the security sentence sits between the purpose and the argument documentation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained. Path format, vault scoping, and traversal safety are covered. Missing only edge-case behavior such as a nonexistent path, which is minor for a single-parameter read tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the single parameter is only described as 'Relative Path' in the schema. The description compensates by stating the path is vault-relative and giving concrete format examples ('projects/chronolog.md', 'identity/values.md'), which adds genuine meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb ('Read') plus resource ('exact contents of a specific Markdown file from the vault'), which is far more precise than the tool name alone. It does not explicitly contrast with siblings like lifeos_search, but the 'exact contents / specific file' framing implicitly separates it from search-based retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: call this when you already know the vault-relative path of a file. There is no explicit statement of when to prefer lifeos_search or lifeos_get_context instead, and no mention of prerequisites or failure conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.0
    • First observedlifeos_add_memory
    • First observedlifeos_get_context
    • First observedlifeos_get_instructions
    • First observedlifeos_list_topics
    • First observedlifeos_read_file
    • First observedlifeos_search

TDQS

A3.8/5.0

Scored across 6 tools

Disambiguation4/5

Most tools target clearly distinct operations (semantic search vs exact read vs listing vs write). However, lifeos_get_context and lifeos_get_instructions overlap: get_context already pulls 'communication instructions' while get_instructions pulls 'personal instructions' from a specific identity file, which could cause misselection between the two.

Naming Consistency5/5

All tools use a consistent snake_case pattern with the lifeos_ prefix (lifeos_get_context, lifeos_search, lifeos_read_file, lifeos_get_instructions, lifeos_list_topics, lifeos_add_memory). Verb-first style is predictable throughout, with only the bare 'search' as a mild deviation.

Tool Count4/5

Six tools is a reasonable, well-scoped set for a personal vault assistant covering bootstrap, discovery, search, read, and memory write. It leans slightly thin, but each tool earns its place without redundancy.

Completeness3/5

The read/lookup side is well covered (context, search, read, list, instructions), but write operations are restricted to adding memories only. There is no way to update, edit, or delete memory entries or canonical files, leaving notable lifecycle gaps for an agent managing the vault.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides persistent, local-first AI memory across sessions via MCP tools for storing, searching, and retrieving context from past interactions.
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Local-first knowledge backend for AI agents that connects MCP hosts to an Obsidian-compatible vault with indexed retrieval, token-budgeted memory recall, and secure ingestion.
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides a file-first personal memory layer for AI agents, enabling them to store and retrieve memories as markdown files with an SQLite index. The MCP server offers read-only search by default, with optional write tools for manual memory addition and conflict resolution.
    3 npm
    MIT