Skip to main content

Decision intelligence system for AI agents - hierarchical memory with outcome-weighted retrieval

Project description

Mind v5

Decision intelligence system for AI agents. Mind helps agents make better decisions over time by learning from outcomes.

Documentation

Guide Description
Getting Started 15-minute setup guide
Core Concepts Understanding memories, decisions, causality
User Guide Step-by-step usage with examples
API Reference Complete endpoint documentation
Installation Production deployment options
Troubleshooting Common issues and solutions

Core Concepts

  • Hierarchical Temporal Memory: Memories exist at 4 levels (Working, Recent, Reference, Identity)
  • Outcome-Weighted Salience: Memories that lead to good decisions become more prominent
  • Decision Tracing: Every decision is tracked with the context that informed it
  • Causal Learning: Understanding WHY decisions work, not just correlation
  • Multi-Source Retrieval: Combines vector search, keywords, salience, recency, and causal signals

Quick Start

Option A: One-Command Install (Recommended)

# Install Mind
pip install vibeship-mind

# Setup and start (downloads PostgreSQL, pgvector automatically)
mind up

That's it! Mind will:

  1. Download PostgreSQL binaries (no system install needed)
  2. Download and install pgvector extension
  3. Initialize the database
  4. Start the API server on http://localhost:8001

Option B: With Existing PostgreSQL

# Install Mind
pip install vibeship-mind

# Configure your database
export MIND_DATABASE_URL=postgresql+asyncpg://user:pass@localhost:5432/mind

# Start server (skip automatic PostgreSQL setup)
mind serve

Option C: Docker Compose (Production)

# Copy environment config
cp .env.example .env

# Start all services (Postgres, NATS, Qdrant, API)
docker-compose up -d

# Check status
docker-compose ps

Verify It Works

# Run smoke test
pip install httpx
python scripts/smoke_test.py

Use the API

# Health check
curl http://localhost:8001/health

# Create a memory
curl -X POST http://localhost:8001/v1/memories/ \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "550e8400-e29b-41d4-a716-446655440000",
    "content": "User prefers concise code examples",
    "content_type": "preference",
    "temporal_level": 3,
    "salience": 0.8
  }'

# Retrieve memories (semantic search)
curl -X POST http://localhost:8001/v1/memories/retrieve \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "550e8400-e29b-41d4-a716-446655440000",
    "query": "code examples",
    "limit": 5
  }'

# Track a decision
curl -X POST http://localhost:8001/v1/decisions/track \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "550e8400-e29b-41d4-a716-446655440000",
    "session_id": "660e8400-e29b-41d4-a716-446655440001",
    "decision_type": "response_style",
    "decision_summary": "Used concise examples",
    "confidence": 0.85
  }'

# Record outcome
curl -X POST http://localhost:8001/v1/decisions/outcome \
  -H "Content-Type: application/json" \
  -d '{
    "trace_id": "<trace_id_from_track>",
    "quality": 0.9,
    "signal": "explicit_positive",
    "feedback": "User understood quickly"
  }'

API Endpoints

Method Endpoint Description
GET /health Health check
POST /v1/memories/ Create memory
GET /v1/memories/{memory_id} Get memory by ID
POST /v1/memories/retrieve Retrieve memories (semantic search)
POST /v1/decisions/track Track a decision
POST /v1/decisions/outcome Record decision outcome
GET /metrics Prometheus metrics

CLI Commands

Command Description
mind up One-command start: setup + serve
mind setup Download PostgreSQL, pgvector, initialize database
mind serve Start the API server
mind serve --reload Start with auto-reload (development)
mind db init Initialize database tables
mind db migrate Run database migrations
mind health Check service health
mind version Show version information
mind mcp Start MCP server for AI agents

Setup Options

mind setup --skip-postgres     # Use existing PostgreSQL
mind setup --skip-pgvector     # Skip pgvector installation
mind setup --skip-db-init      # Skip database initialization

Development

# Install dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/unit -v

# Start API in development mode
python -m mind.cli serve --reload

# Run linting
ruff check src/
mypy src/

Architecture

                         +------------------+
                         |    API Layer     |
                         |   (FastAPI)      |
                         +--------+---------+
                                  |
        +------------+------------+------------+------------+
        |            |            |            |            |
+-------v----+ +-----v------+ +---v----+ +----v-----+ +-----v------+
|  Memory    | |  Decision  | | Event  | | Causal   | | Retrieval  |
|  Service   | |  Service   | | Service| | Service  | | Service    |
+-------+----+ +-----+------+ +---+----+ +----+-----+ +-----+------+
        |            |            |            |            |
        +------------+------------+------------+------------+
                                  |
     +-------------+--------------+--------------+-------------+
     |             |              |              |             |
+----v----+  +-----v-----+  +-----v-----+  +-----v-----+  +----v----+
|Postgres |  |  Qdrant   |  |   NATS    |  | FalkorDB  |  | Temporal|
|(pgvector)|  | (vectors) |  | (events)  |  | (causal)  |  |(workflows)
+---------+  +-----------+  +-----------+  +-----------+  +---------+

Configuration

See .env.example for all configuration options.

License

MIT License - see LICENSE for details.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vibeship_mind-5.0.0.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vibeship_mind-5.0.0-py3-none-any.whl (345.0 kB view details)

Uploaded Python 3

File details

Details for the file vibeship_mind-5.0.0.tar.gz.

File metadata

  • Download URL: vibeship_mind-5.0.0.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for vibeship_mind-5.0.0.tar.gz
Algorithm Hash digest
SHA256 9179bc249fe7edb8a12a6837707123855708f33bcfd57e02f3d50e836fa40ae1
MD5 8e7d39f59ff868fbd684e5d9ea1aac67
BLAKE2b-256 b71aca6d7173feb15354c47524c3e48b14ea2fbefe7839753ed75f870a1b1903

See more details on using hashes here.

File details

Details for the file vibeship_mind-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: vibeship_mind-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 345.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for vibeship_mind-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22ccfec6a5d8394cf3b5f9ebf770c7ca358bd59e4d51b9f6d56133df5c9be850
MD5 6094d5d79a8f4a1f70118b561e5e481c
BLAKE2b-256 84c6fe183aed69ee80d57af948b77fad6131fa686773b7ba58d06d1c1ee6c738

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page