OP

OpenViking

⭐ 33,142•Python / Rust•Agent Memory & RAG

Self-evolving context database unifying memory, RAG, and skills for AI agents.

Self-EvolvingMemoryRAGSkillsContext DatabaseMulti-AgentMCP

Overview

OpenViking is a self-evolving context database purpose-built for AI agents, consolidating memory, RAG, and skills into a single coherent storage layer. With ~33.1K GitHub stars, it automatically learns from interactions, restructures its own schema, promotes recurring patterns into reusable skills, and surfaces relevant context for each agent decision. Designed as a foundational layer beneath LangGraph, CrewAI, and the OpenAI Agents SDK.

Features

  • ✓Unified storage layer for memory, RAG, and skills
  • ✓Self-evolving schema that adapts to agent behavior
  • ✓Automatic skill extraction from recurring patterns
  • ✓Graph-based relationship mapping between concepts
  • ✓Cross-session continuity with intelligent summarization
  • ✓MCP-native server mode for any agent
  • ✓Time-aware memory with temporal queries
  • ✓Multi-backend support: SQLite, PostgreSQL, Chroma

Installation

pip install open-viking

Pros

  • +Eliminates 3+ separate storage systems for memory/RAG/skills
  • +Self-improving without manual intervention
  • +Multi-agent ready with shared and isolated namespaces
  • +MCP-native — plug into any agent framework
  • +Strong community with ~30K stars
  • +Temporal intelligence for sophisticated memory recall

Cons

  • −Very new with a still-evolving API
  • −Self-evolving model may be harder to debug
  • −New paradigm with a learning curve
  • −No straightforward migration path from existing systems
  • −Performance at scale is an unsolved problem

Alternatives

Documentation

OpenViking

Overview

OpenViking is a self-evolving context database purpose-built for AI agents, unifying memory, RAG (Retrieval-Augmented Generation), and skills into a single coherent storage layer. With approximately 29,800 GitHub stars, OpenViking represents a new architectural category — moving beyond the fragmented approach of separate memory stores, vector indexes, and skill registries that plague most agent systems today.

Traditional agent architectures require developers to stitch together a vector database (for RAG), a session store (for short-term memory), a long-term memory layer (like MemGPT or Mem0), and a separate skills registry. OpenViking consolidates these into one self-evolving system: as the agent operates, the context database automatically learns from interactions, restructures its own schema, promotes recurring patterns into reusable skills, and surfaces the most relevant context for each decision.

The project's name references the concept of "exploring uncharted territory" — the context database is designed to autonomously discover structure in unstructured agent experience, much as explorers charted maps from raw terrain. It positions itself as a foundational layer beneath agent frameworks like LangGraph, CrewAI, and the OpenAI Agents SDK, acting as the persistent intelligence layer that makes agents truly improve over time.

Features

  • Unified storage layer: Combines memory, RAG, and skills into a single database — no stitching required
  • Self-evolving schema: Database schema adapts automatically based on agent behavior patterns
  • Automatic skill extraction: Recurring patterns in agent interactions are promoted to reusable skills
  • Contextual retrieval: RAG retrieval tuned specifically for agent workflows, not generic document search
  • Cross-session continuity: Agent sessions build on each other; context carries over with intelligent summarization
  • Multi-agent support: Shared context layer supports multi-agent orchestration with isolated namespaces
  • MCP-native: Exposes its capabilities as an MCP server for any agent to consume
  • Vector-native: Built-in vector search for semantic context retrieval without external dependencies
  • Time-aware memory: Supports temporal queries — "what did I decide last week about X?"
  • Incremental learning: No batch retraining; the context database evolves continuously during operation

Installation

# Install via pip
pip install open-viking

# Or clone from source
git clone https://github.com/OpenVikingAI/OpenViking
cd OpenViking
pip install -e .

Quick Start

from open_viking import VikingContext

# Initialize the context database
ctx = VikingContext(
    backend="sqlite",  # or "postgres", "chroma", etc.
    agent_id="my-coding-agent",
    auto_evolve=True,
)

# Store a memory with context
ctx.store(
    content="User prefers PEP 8 over Google style for Python projects",
    category="preference",
    tags=["python", "style", "pep8"],
    source="conversation-2026-08-15",
)

# Retrieve relevant context for a decision
context = ctx.retrieve(
    query="What code style should I use for this Python file?",
    top_k=3,
    include_skills=True,
)

# Extract a skill from recurring patterns
skill = ctx.extract_skill(
    name="python-refactor-workflow",
    pattern_source="last-50-sessions",
)

# List available skills
skills = ctx.list_skills()
for skill in skills:
    print(f"{skill.name}: {skill.description}")

Core Concepts

Context Database

The core data structure in OpenViking is the Context Database — a hybrid storage system that combines:

  • Vector store for semantic similarity search
  • Graph store for relationship mapping between concepts
  • Document store for raw content preservation
  • Schema registry for evolving structure

Unlike traditional databases with fixed schemas, the context database auto-generates schema extensions as it observes new data patterns. For example, if an agent starts tracking "decision confidence" alongside every architectural decision, the database will create that field automatically.

Self-Evolving Mechanism

The self-evolution system works in three phases:

  1. Observation: The database monitors agent interactions and tracks frequency, relationships, and patterns
  2. Abstraction: When a pattern recurs above a threshold, the system proposes a new schema element or skill
  3. Promotion: Promoted patterns become first-class citizens in the database — queryable, reusable, and versioned

Skill Extraction

One of OpenViking's signature features is its ability to promote recurring agent behaviors into formalized skills. When an agent repeatedly performs a specific multi-step operation (e.g., "review PR → check CI → update docs → notify team"), OpenViking can:

  1. Detect the pattern across sessions
  2. Propose a skill definition
  3. Allow the agent to review and accept the skill
  4. Store the skill for future reuse

Advanced Features

Multi-Agent Coordination

OpenViking supports shared context layers for multi-agent systems:

ctx = VikingContext(
    backend="postgres",
    shared_namespace="team-project",
)

# Each agent has isolated memory but shares project context
coder = ctx.agent_session("coder")
reviewer = ctx.agent_session("reviewer")
pm = ctx.agent_session("project-manager")

# Shared knowledge is accessible across agents
pm.store(content="Deadline moved to Aug 25", category="project-decision")
# Coder can now retrieve this context

Temporal Queries

OpenViking's time-aware memory supports natural-language temporal queries:

ctx.query("What did we decide about the database schema last week?")
ctx.query("List all preferences the user has expressed in the past month")
ctx.query("How has my approach to testing changed over the last 10 sessions?")

MCP Server Integration

OpenViking can run as an MCP server, making it accessible to any agent:

{
  "mcpServers": {
    "open-viking": {
      "command": "open-viking",
      "args": ["--backend", "sqlite", "--path", "./viking.db"]
    }
  }
}

Examples

Example 1: RAG-Powered Coding Agent

ctx = VikingContext(agent_id="code-reviewer")

# Store repository context
ctx.store(
    content=read_file("README.md"),
    category="documentation",
    tags=["project", "context"],
)

# Review code with context from past decisions
review = ctx.retrieve(
    query="What coding patterns does this project use?",
    top_k=10,
)

Example 2: Meeting Notes Integration

ctx = VikingContext(agent_id="meeting-assistant")

# Store meeting decisions
ctx.store(
    content="Team agreed to use SQLite for MVP, revisit with PostgreSQL at 100K users",
    category="decision",
    tags=["database", "architecture"],
    metadata={"date": "2026-08-15", "attendees": ["alice", "bob"]},
)

# Query across all meetings
decisions = ctx.query("List all architecture decisions from this month")

Example 3: Automatic Skill Discovery

# After 20+ sessions of agent activity
suggested_skills = ctx.discover_skills(threshold=5)
# Returns: [{"name": "deploy-to-production", "frequency": 12, "avg_duration": "8 min"}]

Pros

  • ✅ Unified architecture: Eliminates the need for separate memory, RAG, and skill stores
  • ✅ Self-improving: Gets better the more it's used, without manual intervention
  • ✅ Multi-agent ready: Built-in support for shared and isolated agent contexts
  • ✅ MCP-native: Plug into any agent framework that supports MCP
  • ✅ Strong community: ~30K stars indicates active adoption and contributions
  • ✅ Temporal intelligence: Time-aware queries enable sophisticated memory recall
  • ✅ Backend flexibility: Supports SQLite, PostgreSQL, Chroma, and more

Cons

  • ❌ Very new: Early-stage project with a still-evolving API
  • ❌ Abstraction overhead: The self-evolving model may be harder to debug than fixed-schema alternatives
  • ❌ Learning curve: The unified storage model is a new paradigm for many developers
  • ❌ No migration path: If you already have separate memory/RAG systems, migration requires rethinking your data model
  • ❌ Performance unknowns: Self-evolving schema at scale is an unsolved problem in many contexts

When to Use

  • Building multi-session agent applications: When you need agents that truly learn and improve over time
  • Consolidating agent infrastructure: When your current stack has 3+ separate storage systems for memory/RAG/skills
  • Research and experimentation: When you want to explore self-improving agent architectures
  • Multi-agent orchestration: When multiple agents need shared context with isolated namespaces
  • Agent productization: When you're building a product where the agent should get better with usage

Resources

Related Projects

  • Mem0 — Developer-friendly AI memory
  • MemGPT — Persistent memory for LLM agents
  • Zep — Long-term memory server for LLM apps
  • Codebase Memory MCP — Sub-ms code intelligence MCP