Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cursor/rules/concept-rag-guidance.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ alwaysApply: true
---
# Overview

Before using concept-rag MCP tools, fetch the `concept-rag://intents` resource.
Before using concept-rag MCP tools, fetch the `concept-rag://activities` resource.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ A RAG MCP server that enables LLMs to interact with a vector database chunked li
---

## 🎯 Overview
Concept-RAG uses an **Intent → Skill → Tool** architecture to help AI agents to efficiently acquire knowledge.

```
User Goal → Intent (problem domain) → Skill (solution domain) → Tools
```
Concept-RAG uses an **Goal → Activity → Skill → Tool** architecture to help AI agents to efficiently acquire knowledge.

After initial setup of an always-applied [rule](prompts/ide-setup.md), agents are able to use an exposed [guidance](prompts/guidance.md) resource to:
1. **Match the user's goal** to an [intent](prompts/intents/index.md) (e.g., "understand a topic", "explore a concept")
1. **Match the user's goal** to an [activity](prompts/activities/index.md) (e.g., "understand a topic", "explore a concept")
2. **Follow the [skill](prompts/skills/index.md) workflow** which orchestrates the right [tool](docs/api-reference.md) sequence
3. **Synthesize the answer** with citations

Expand Down
38 changes: 19 additions & 19 deletions docs/architecture/skills-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
The skills interface provides a three-tier abstraction layer over MCP tools:

```
Intent (Problem Domain) → Skill (Solution Domain) → Tool (Atomic Operation)
Activity (Problem Domain) → Skill (Solution Domain) → Tool (Atomic Operation)
```

This reduces tool selection errors and enables successful multi-step workflows by providing intent-based abstractions with context preservation.
This reduces tool selection errors and enables successful multi-step workflows by providing activity-based abstractions with context preservation.

## Architecture

```
Cursor Rule (prompts/agent-quick-rules.md)
↓ instructs agent to read
Intent Index (concept-rag://intents)
Activity Index (concept-rag://activities)
↓ agent matches user goal
Intent Description (concept-rag://intents/{id})
Activity Description (concept-rag://activities/{id})
↓ maps to skill
Skill Description (concept-rag://skills/{id})
↓ guides tool workflow
Expand All @@ -32,13 +32,13 @@ MCP Tools (existing 11 tools)

| Layer | Domain | Focus | Example |
|-------|--------|-------|---------|
| **Intent** | Problem | User goals, needs | "I want to understand X" |
| **Activity** | Problem | User goals, needs | "I want to understand X" |
| **Skill** | Solution | Multi-tool workflows | `catalog_search` → `chunks_search` → synthesize |
| **Tool** | Solution | Atomic operations | `catalog_search`, `chunks_search` |

## Available Intents
## Available Activities

| Intent | User Goal | Skill |
| Activity | User Goal | Skill |
|--------|-----------|-------|
| `understand-topic` | Learn about a topic from the library | deep-research |
| `know-my-library` | Discover available content | library-discovery |
Expand All @@ -54,9 +54,9 @@ MCP Tools (existing 11 tools)

| Resource URI | Description |
|--------------|-------------|
| `concept-rag://intents` | Intent index (read first) |
| `concept-rag://intents/understand-topic` | Understand a topic intent |
| `concept-rag://intents/know-my-library` | Know my library intent |
| `concept-rag://activities` | Activity index (read first) |
| `concept-rag://activities/understand-topic` | Understand a topic activity |
| `concept-rag://activities/know-my-library` | Know my library activity |
| `concept-rag://skills` | Skill index |
| `concept-rag://skills/deep-research` | Deep research skill |
| `concept-rag://skills/library-discovery` | Library discovery skill |
Expand All @@ -65,10 +65,10 @@ MCP Tools (existing 11 tools)

```
prompts/
├── intents/
│ ├── index.md # Intent index
│ ├── understand-topic.md # Intent definition
│ └── know-my-library.md # Intent definition
├── activities/
│ ├── index.md # Activity index
│ ├── understand-topic.md # Activity definition
│ └── know-my-library.md # Activity definition
├── skills/
│ ├── index.md # Skill index
│ ├── deep-research.md # Skill definition
Expand All @@ -80,15 +80,15 @@ prompts/

### For Agents

1. Read the intent index: `concept-rag://intents`
2. Match user's goal to an intent
3. Read the intent's linked skill
1. Read the activity index: `concept-rag://activities`
2. Match user's goal to an activity
3. Read the activity's linked skill
4. Follow the skill's tool workflow
5. Synthesize answer with citations

### For Developers

- Add new intents to `prompts/intents/`
- Add new activities to `prompts/activities/`
- Add new skills to `prompts/skills/`
- Register resources in `src/conceptual_index.ts`
- Update indexes to include new entries
Expand All @@ -98,7 +98,7 @@ prompts/
- **MCP Resources over Tools**: Reduces tool count, leverages existing infrastructure
- **Static .md files**: Editable, version controlled, no runtime logic
- **Tiered loading**: Index < 50 lines; verbose loaded on demand
- **Separation of concerns**: Problem domain (intents) vs. solution domain (skills/tools)
- **Separation of concerns**: Problem domain (activities) vs. solution domain (skills/tools)

## References

Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ All major technical decisions are documented in **[Architecture Decision Records
### Key Documentation

- **[API Reference](api-reference.md)** - Complete MCP tool documentation with JSON I/O schemas
- **[Intent/Skill Architecture](architecture/skills-interface.md)** - Intent-based tool selection
- **[Activity/Skill Architecture](architecture/skills-interface.md)** - Activity-based tool selection
- **[Database Schema](database-schema.md)** - Four-table normalized schema with derived fields
- **[Test Suite](../src/__tests__/README.md)** - Comprehensive test documentation

Expand Down
20 changes: 10 additions & 10 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ nav:
- Overview: prompts/guidance.md
- IDE Setup: prompts/ide-setup.md

- Intents:
- Overview: prompts/intents/index.md
- Understand Topic: prompts/intents/understand-topic.md
- Explore Concept: prompts/intents/explore-concept.md
- Explore Category: prompts/intents/explore-category.md
- Analyze Document: prompts/intents/analyze-document.md
- Know My Library: prompts/intents/know-my-library.md
- Identify Patterns: prompts/intents/identify-patterns.md
- Identify Best Practices: prompts/intents/identify-best-practices.md
- Curate Lexicon: prompts/intents/curate-lexicon.md
- Activities:
- Overview: prompts/activities/index.md
- Understand Topic: prompts/activities/understand-topic.md
- Explore Concept: prompts/activities/explore-concept.md
- Explore Category: prompts/activities/explore-category.md
- Analyze Document: prompts/activities/analyze-document.md
- Know My Library: prompts/activities/know-my-library.md
- Identify Patterns: prompts/activities/identify-patterns.md
- Identify Best Practices: prompts/activities/identify-best-practices.md
- Curate Lexicon: prompts/activities/curate-lexicon.md

- Skills:
- Overview: prompts/skills/index.md
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Intent: Analyze a Document
# Activity: Analyze a Document

## Problem Domain

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Intent: Curate Concept Lexicon
# Activity: Curate Concept Lexicon

## Problem Domain

**User Goal:** The user wants to create a curated dictionary of concepts from the knowledge base that are applicable to a specific project, domain, or codebase.

## Recognition

Match this intent when the user says:
Match this activity when the user says:
- "Create a concept lexicon for [project/domain]"
- "What concepts from my library apply to [project]?"
- "Build a vocabulary reference for [domain]"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Intent: Explore a Category
# Activity: Explore a Category

## Problem Domain

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Intent: Explore a Concept
# Activity: Explore a Concept

## Problem Domain

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Intent: Identify Best Practices
# Activity: Identify Best Practices

## Problem Domain

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Intent: Identify Patterns
# Activity: Identify Patterns

## Problem Domain

Expand Down
8 changes: 4 additions & 4 deletions prompts/intents/index.md → prompts/activities/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Intent Index
# Activity Index

Match the user's goal to an intent. Each intent may use multiple skills in sequence.
Match the user's goal to an activity. Each activity may use multiple skills in sequence.

## Available Intents
## Available Activities

| Intent | User Goal | Primary Skill | Supporting Skills |
| Activity | User Goal | Primary Skill | Supporting Skills |
|--------|-----------|---------------|-------------------|
| [understand-topic](understand-topic.md) | Learn about a topic | `deep-research` | `concept-exploration`, `document-analysis` |
| [know-my-library](know-my-library.md) | Discover available content | `library-discovery` | `category-exploration` |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Intent: Know My Library
# Activity: Know My Library

## Problem Domain

**User Goal:** The user doesn't know what content is available in their library and wants to discover or explore it.

## Recognition

Match this intent when the user says:
Match this activity when the user says:
- "What do I have?"
- "What's in my library?"
- "What documents do I have?"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Intent: Understand a Topic
# Activity: Understand a Topic

## Problem Domain

**User Goal:** The user has a knowledge gap about a specific topic and wants to learn what their library says about it.

## Recognition

Match this intent when the user says:
Match this activity when the user says:
- "What does my library say about X?"
- "Research topic X"
- "I want to understand X"
Expand Down
14 changes: 7 additions & 7 deletions prompts/guidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ How to use concept-rag effectively.

---

## The Intent → Skill → Tool Model
## The Activity → Skill → Tool Model

```
User Goal → Intent (problem domain) → Skill (solution domain) → Tools
User Goal → Activity (problem domain) → Skill (solution domain) → Tools
```

1. **Identify the intent** — What is the user trying to accomplish?
2. **Follow the skill** — Each intent maps to a skill with a tool workflow
1. **Identify the activity** — What is the user trying to accomplish?
2. **Follow the skill** — Each activity maps to a skill with a tool workflow
3. **Execute tools** — Follow the skill's tool sequence
4. **Synthesize answer** — Combine findings with citations

---

## Step 1: Identify the Intent
## Step 1: Identify the Activity

Fetch `concept-rag://intents` to see available intents and match the user's goal.
Fetch `concept-rag://activities` to see available activities and match the user's goal.

---

## Step 2: Follow the Skill

Each intent links to a skill. The skill describes:
Each activity links to a skill. The skill describes:
- Which tools to use and in what order
- What context to preserve between calls
- Expected output format
Expand Down
2 changes: 1 addition & 1 deletion prompts/ide-setup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Paste the following into your IDE rules location:

```
Before using concept-rag MCP tools, fetch the `concept-rag://intents` resource.
Before using concept-rag MCP tools, fetch the `concept-rag://activities` resource.
```
4 changes: 2 additions & 2 deletions prompts/skills/category-exploration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Understand what concepts appear in a specific domain/category.

## Fulfills Intent
## Fulfills Activity

[explore-category](../intents/explore-category.md)
[explore-category](../activities/explore-category.md)

## Tool Workflow

Expand Down
4 changes: 2 additions & 2 deletions prompts/skills/concept-exploration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Track where a concept appears across the library and find source attribution.

## Fulfills Intent
## Fulfills Activity

[explore-concept](../intents/explore-concept.md)
[explore-concept](../activities/explore-concept.md)

## Tool Workflow

Expand Down
4 changes: 2 additions & 2 deletions prompts/skills/deep-research.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Synthesize knowledge across multiple documents to answer a user's question.

## Fulfills Intent
## Fulfills Activity

[understand-topic](../intents/understand-topic.md)
[understand-topic](../activities/understand-topic.md)

## Tool Workflow

Expand Down
4 changes: 2 additions & 2 deletions prompts/skills/document-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Extract and analyze concepts from a specific document.

## Fulfills Intent
## Fulfills Activity

[analyze-document](../intents/analyze-document.md)
[analyze-document](../activities/analyze-document.md)

## Tool Workflow

Expand Down
4 changes: 2 additions & 2 deletions prompts/skills/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Skill Index

Skills define tool workflows to fulfill user intents. Workflows may include **loops** for iterative refinement.
Skills define tool workflows to fulfill user activities. Workflows may include **loops** for iterative refinement.

## Available Skills

Expand All @@ -17,7 +17,7 @@ Skills define tool workflows to fulfill user intents. Workflows may include **lo
## Execution Model

```
1. Match intent to skill(s)
1. Match activity to skill(s)
2. Execute skill workflow
├─ Tools may be called multiple times
Expand Down
4 changes: 2 additions & 2 deletions prompts/skills/library-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Browse and inventory available content to help users understand their library.

## Fulfills Intent
## Fulfills Activity

[know-my-library](../intents/know-my-library.md)
[know-my-library](../activities/know-my-library.md)

## Tool Workflow

Expand Down
4 changes: 2 additions & 2 deletions prompts/skills/pattern-research.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Find design patterns applicable to a specific problem or domain.

## Fulfills Intent
## Fulfills Activity

[identify-patterns](../intents/identify-patterns.md)
[identify-patterns](../activities/identify-patterns.md)

## Tool Workflow

Expand Down
4 changes: 2 additions & 2 deletions prompts/skills/practice-research.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

Discover industry best practices and anti-patterns for a domain.

## Fulfills Intent
## Fulfills Activity

[identify-best-practices](../intents/identify-best-practices.md)
[identify-best-practices](../activities/identify-best-practices.md)

## Tool Workflow

Expand Down
Loading