Content
# Sage MCP Server
A reflective companion for wayfaring through thought. Sage is an MCP (Model Context Protocol) server that helps you capture, explore, and connect your reflections through an emergent, rhizomatic structure.
## Philosophy
Sage embodies the concept of **wayfaring** from Tim Ingold: knowledge emerges through movement and exploration, not from predetermined categories. The path creates itself as you walk it.
### Key Principles
- **Organic Emergence**: Tags and connections form naturally through use, not imposed upfront
- **Rhizomatic Structure**: Any reflection can connect to any other, in any direction, for any reason
- **Context and Embodiment**: Reflections capture not just ideas, but contexts—what's pressing on you, what necessity drives exploration
- **Recursive Growth**: Reflections become resources for future reflections; the structure generates new possibilities for thinking
See `project_vision/vision.md` for the complete philosophical foundation.
## Features
- **Reflective Sessions**: Timestamped conversations with Sage for deepening personal exploration
- **Full-Text Search**: Find past reflections by content or tags
- **Emergent Tags**: Mark themes as they crystallize through use
- **Rhizomatic Connections**: Create pathways between reflections
- **Pathway Navigation**: Explore the network of ideas that emerges
## Installation
1. Clone this repository
2. Create a virtual environment:
```bash
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
## Configuration
Add to your MCP settings (e.g., Claude Desktop config):
```json
{
"mcpServers": {
"sage": {
"command": "python3",
"args": ["/path/to/lagrieta_mcp/server.py"]
}
}
}
```
## Available Tools
### `sage_reflect`
Share an experience, thought, feeling, or moment. Sage responds with gentle curiosity to deepen exploration.
**Parameters:**
- `text` (string) - What you want to reflect on
### `sage_start_session`
Begin a new reflection session. Retrieves the most recent session to provide continuity.
### `sage_end_session`
Save the current session to the database.
**Parameters:**
- `session_content` (string) - The full conversation to save
### `sage_search`
Search through reflections by content or tags.
**Parameters:**
- `query` (string) - Search text, or tag name prefixed with `#` (e.g., `#wayfaring`)
- `limit` (integer, optional) - Maximum results (default: 10)
**Examples:**
```
sage_search("embodiment") # Search by content
sage_search("#wayfaring") # Search by tag
```
### `sage_tag`
Add tags to a session to mark emergent themes.
**Parameters:**
- `session_id` (integer) - Session to tag
- `tags` (array of strings) - Tags to add (e.g., `["wayfaring", "language"]`)
### `sage_connect`
Create a rhizomatic connection between two sessions.
**Parameters:**
- `from_session_id` (integer) - Starting session
- `to_session_id` (integer) - Destination session
- `connection_type` (string, optional) - Nature of connection (e.g., "resonance", "elaboration", "contrast")
- `note` (string, optional) - Explanation of the connection
**Suggested connection types:**
- `resonance` - themes that echo and reinforce
- `elaboration` - one thought expanding another
- `contrast` - productive tension between ideas
- `echo` - similar patterns in different contexts
- `recursion` - thoughts that loop back on themselves
### `sage_explore`
Navigate the rhizomatic pathways.
**Parameters:**
- `session_id` (integer, optional) - Session to explore from; omit for overview
**Two modes:**
1. **With session_id**: Shows tags and connected sessions from that point
2. **Without session_id**: Shows overview of the entire rhizome
## Database Structure
Sage uses SQLite to store reflections with a schema designed for organic growth:
- **sessions** - Timestamped reflection conversations
- **reflections** - Individual reflection entries with context
- **tags** - Emergent themes and concepts
- **reflection_tags** - Many-to-many tag associations
- **connections** - Rhizomatic pathways between reflections
The database grows more valuable and interconnected with each reflection, tag, and connection you add.
## Development
Session notes and implementation details are tracked in `llm_auto_coding/`.
## Architecture
- `server.py` - MCP server implementation with tool handlers
- `database.py` - SQLite operations and data model
- `reflections/` - Storage for the database and any exported files
- `project_vision/` - Philosophical foundations and design principles
## The Rhizome Grows
The structure doesn't constrain thought—it emerges from it. Start reflecting, notice themes, discover connections, and watch the pathways form beneath your feet.
**This is wayfaring.**