Skip to main content
Glama

Tribal

A personal knowledge context engine for software development. Tribal captures learnings, debugging insights, heuristics, and decision rationale from development work, then makes that knowledge retrievable by coding agents via MCP (Model Context Protocol).

Prerequisites

  • Rust (stable toolchain, 1.89+)

  • Rust nightly (for rustfmt — rustup toolchain install nightly)

  • Docker (for local Postgres and test containers)

  • just — cargo install just

  • sqlx-cli — cargo install sqlx-cli --no-default-features --features postgres

  • cargo-deny — cargo install cargo-deny

Related MCP server: mesh-memory

Setup

git clone git@github.com:samfolo/tribal.git
cd tribal
just db-up
just db-migrate
just check
just test

Running

# Run the MCP server (stdio transport)
just serve

# Run with a specific project
just serve-project <project_id>

Development

# Format code (requires nightly rustfmt)
just fmt

# Lint and format check
just check

# Run all tests
just test

# Run unit tests only (no database required)
just test-unit

# Full pre-push check (format, lint, test)
just pre-push

# Regenerate sqlx offline query metadata
just sqlx-prepare

Licence

MIT

Available Tools

10 tools
tribal_discoverTribal: Discover KnowledgeA

Search Tribal's knowledge base using natural language. Returns knowledge items ranked by semantic similarity to your query, with optional structured filters to narrow results.

Use this as your first step when you need context: before starting work on a feature, debugging an issue, or making a design decision. Ask questions the way you'd ask a colleague: "What do I know about connection pooling in this project?" or "Have I seen this async deadlock pattern before?"

Semantic search is the primary mechanism. Filters (project, kind, tags, time) narrow the candidate set but are not required. If you need to understand an item's evidence, contradictions, or derivation chain, follow up with tribal_explore using the item's ID.

Superseded items (replaced by newer understanding) are excluded by default. Set include_superseded to true for the historical picture.

Results include standing (evidential profile) when requested, which summarises each item's support count, contradiction count, observation frequency, and diversity of supporting evidence.

Inputs: query (required), cursor, include_references, include_standing, +6 more. Returns: applied_project_id, embedding_model, embedding_profile_id, exact, +3 more

tribal_exploreTribal: Explore RelationshipsA

Traverse the relationship graph from a specific knowledge item. Use this after tribal_discover to understand an item's context: what supports it, what contradicts it, what it was derived from, or what it supersedes.

Typical workflow:

  1. tribal_discover finds relevant items

  2. Pick an item with interesting standing (high support, or contradictions)

  3. tribal_explore to see the evidence, contradictions, or derivation chain

Direction controls traversal:

  • "inbound": What do others assert about this item? (supports, contradictions, what supersedes it)

  • "outbound": What does this item assert about others? (what it's derived from, what it supports)

  • "both": Full neighbourhood in all directions

Relation types:

  • "supports": Evidence that reinforces the item

  • "contradicts": Evidence that challenges the item

  • "supersedes": A newer item that replaces this one

  • "derived_from": Provenance. The input used to produce this item

Depth controls hops: depth 1 = direct relations, depth 2 = relations of relations. Higher depth gives more context but more results. Depth is capped at 3 to avoid mixing unrelated evidence across distant graph regions; use multiple targeted calls for deeper investigation.

Inputs: item_id (required), depth, direction, include_references, +4 more. Returns: anchor, anchor_standing, exact, related_items, +1 more

tribal_feedbackTribal: Rate Retrieval QualityA

Record a quality signal about a retrieval session. Use this when Tribal's knowledge meaningfully helped (or failed to help) your current task.

This is NOT about rating individual items. Item-level signals are captured through the Supports/Contradicts relationship system during ingest. This is about rating the combination of items returned for a query, assembled in a particular way.

Rate "positive" when: Tribal surfaced knowledge that directly informed your approach, saved you from a known pitfall, or provided context that improved your decision-making.

Rate "negative" when: The query should have found relevant knowledge but didn't, or the returned items were irrelevant or misleading for the task at hand.

Feedback builds an organic eval dataset. Be selective: only rate when the signal is clear. If no trace_id is available from the retrieval response, do not submit feedback rather than fabricating a trace_id. Incomplete feedback is noise.

Inputs: query_text (required), rating (required), returned_item_ids (required), trace_id (required), +3 more. Returns: feedback_id

tribal_get_itemTribal: Get Knowledge Item by IDA

Retrieve one or more knowledge items by their IDs. Use this when you have a specific item ID (from a standing field, a previous session, or a cross-reference) and need the full item.

For semantic search, use tribal_discover. For relationship traversal, use tribal_explore. This tool is for direct lookup when you already know what you want.

The response is keyed by item ID. Missing or unknown IDs map to null.

Inputs: item_ids (required), include_references, include_standing. Returns: items

tribal_ingestTribal: Ingest KnowledgeA

Submit raw text for knowledge extraction into Tribal. The system extracts structured knowledge items (facts, heuristics, procedures, decision records), detects duplicates, identifies relationships with existing knowledge, and stores the results.

This is an asynchronous operation. Returns a job_id immediately. Use tribal_job_status to poll for completion.

Use this tool when you've learned something worth preserving: a debugging insight, an architectural decision, a reusable pattern, a gotcha about a library, or any experience that would help you or another agent working on this codebase in the future.

Do NOT use this for storing code snippets, file contents, or documentation. Tribal stores knowledge about work, not the artefacts themselves.

Project, model, and principal are sourced from session context (see tribal_set_context). You only need to provide the content itself.

Inputs: content (required), project_id. Returns: job_id

tribal_job_statusTribal: Check Ingest Job StatusA

Check the progress of an ingest job submitted via tribal_ingest.

Job lifecycle: queued → extracting → triaging → relating → completed/failed

Terminal states:

  • "completed": Pipeline ran to conclusion. Check outcome for details:

    • "success": All candidates triaged successfully and relations committed.

    • "partial": Some triage tasks failed permanently; the relation task ran on a subset.

    • "empty": Relation task ran with zero items to relate (all duplicates or all triage failures). If tasks_failed > 0, the pipeline likely failed at triage; treat as degraded rather than "nothing new".

  • "failed": Pipeline could not complete. outcome = "failure". Check error context.

Set wait_seconds to block until the job completes or the timeout expires. This collapses ingest + poll into a single round-trip for fast operations. With wait_seconds=0 (default), returns immediately with current status.

Inputs: job_id (required), wait_seconds. Returns: batch_size, created_at, items_created, job_id, +6 more

tribal_reindexTribal: Reindex EmbeddingsA

Start a reindex to a new embedding geometry, naming the target provider, model, and dimension on the command. Reads and writes continue against the active profile while the new space fills; the swap is atomic. An unchanged target is a no-op. Operator-only; the worker drives the run to completion.

Inputs: model (required), provider (required), base_url, dimensions, +1 more. Returns: The outcome of a reindex request.

tribal_reindex_cancelTribal: Cancel ReindexA

Cancel the live reindex run, if any. The run is aborted and its building profile is failed at the next task boundary; the active profile, and every read and write against it, is untouched. Reindex is single-flight, so there is at most one live run. Operator-only.

Inputs: no named parameters. Returns: The outcome of a reindex cancel request.

tribal_reindex_pruneTribal: Prune ReindexesA

Reclaim storage from past reindexes. Every non-active complete profile and every failed profile is superseded, and their embeddings are deleted; the active profile and run history are untouched. Operator-only.

Inputs: no named parameters. Returns: The outcome of a reindex prune request.

tribal_set_contextTribal: Set Session ContextA

Set or override session-level context for Tribal. Use this at the start of a session to declare your model identity, or when switching to a different project.

Session context is used as the default for all subsequent tool calls. For example, setting a project here means tribal_ingest and tribal_discover will use it automatically without needing project_id on every call.

The server resolves what it can at connection start (project from git remote, principal from auth). Use this tool to fill in what the server cannot infer (model name, provider) or to override what it resolved (e.g., switching projects).

Inputs: model, project_id, provider. Returns: Returns the full session context after applying changes.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a unique and clearly defined purpose. There is no overlap between search, exploration, ingestion, job monitoring, feedback, and administration tools.

    Naming Consistency5/5

    All tools follow the 'tribal_verb_noun' pattern consistently, making it easy to infer each tool's function from its name.

    Tool Count5/5

    With 10 tools, the server is well-scoped for managing a knowledge base. Each tool serves a distinct and necessary role without unnecessary bloat.

    Completeness4/5

    The toolset covers the core lifecycle of knowledge management (search, explore, retrieve, ingest, feedback), but lacks explicit tools for updating or deleting individual items, which is a minor gap.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Universal AI memory layer that provides cross-client, cross-repo context management with semantic search, automatic code indexing, and session management. Enables persistent developer memory across projects with typed memories, graph-based relationships, and RAG-powered retrieval.
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Self-hosted semantic memory for AI agents. Save worklogs, decisions, and notes via MCP, then recall them across sessions by meaning rather than keyword. Backed by Postgres + pgvector with local embeddings (multilingual-e5-base).
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A persistent, trust-scored project memory for AI coding agents, backed by PostgreSQL + pgvector, providing durable memory of architecture decisions, bug patterns, and coding conventions.
      26 npm
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Analytical memory for AI agents: a real Postgres your agent connects to over MCP and queries in plain English — GROUP BY, JOIN, aggregate over what it remembered, not just top-k vector recall.
      10
      2
      Functional Source , Version 1.1, ALv2 Future