
reflow
Semi-automated, research backed, document improvement workflow
Repository Info
About This Server
Semi-automated, research backed, document improvement workflow
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Research Agent
AI-powered research agent with local-first RAG (Retrieval-Augmented Generation) capabilities.
Overview
Research Agent is a comprehensive tool that combines the power of AI with local knowledge management to provide intelligent research assistance. It features a hybrid architecture with a Python CLI backend and MCP (Model Context Protocol) server integration for seamless interaction with modern AI development environments like Cursor.
Features
- Local-First RAG Pipeline: Vector database with ChromaDB, local embeddings, and intelligent re-ranking
- Hybrid Document Processing: Markdown-aware chunking with metadata extraction
- MCP Server Integration: Seamless integration with Cursor IDE and other MCP-compatible tools
- Flexible Architecture: Modular design supporting both CLI and programmatic access
- Team-Ready Design: Built with future team collaboration features in mind
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Cursor IDE │◄──►│ MCP Server │◄──►│ Backend CLI │
│ (Client) │ │ (FastMCP) │ │ (Core Logic) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │
│ ▼
│ ┌─────────────────┐
│ │ Vector Store │
│ │ (ChromaDB) │
│ └─────────────────┘
│ │
│ ▼
│ ┌─────────────────┐
└──────────────►│ Knowledge Base │
│ (Documents) │
└─────────────────┘
Technology Stack
- Backend: Python 3.11+ with ChromaDB, sentence-transformers, Typer
- MCP Server: FastMCP framework for Model Context Protocol integration
- Vector Database: ChromaDB (primary), SQLite+sqlite-vec (fallback)
- Embeddings: sentence-transformers/multi-qa-MiniLM-L6-cos-v1 (default)
- Re-ranking: cross-encoder/ms-marco-MiniLM-L6-v2
Quick Start
Prerequisites
- Python 3.11 or higher
- uv package manager (recommended) or pip
Installation
- Clone the repository:
git clone <repository-url>
cd research-agent
- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
# Using uv (recommended)
uv pip install -e ".[dev]"
# Or using pip
pip install -e ".[dev]"
Configuration
- Copy the environment template:
cp .env.example .env
- Edit
.envwith your API keys (optional, for external LLM providers):
# Edit .env with your preferred editor
nano .env
- The main configuration is in
researchagent.config.json. The default settings work for local-only usage.
Basic Usage
CLI Usage
# Initialize knowledge base
research-agent kb init
# Add documents
research-agent kb add-document path/to/document.md
research-agent kb add-folder path/to/documents/
# Query knowledge base
research-agent query "What is the main concept?"
# List collections
research-agent collections list
MCP Server Usage
The MCP server provides integration with Cursor IDE and other MCP-compatible tools. Configuration details are in the project documentation.
Development
Project Structure
src/
├── research_agent_backend/ # Python CLI Backend
│ ├── cli/ # CLI commands
│ ├── core/ # Core business logic
│ ├── services/ # Service layer
│ ├── models/ # Data models
│ ├── utils/ # Utilities
│ └── tests/ # Backend tests
├── mcp_server/ # FastMCP Server
│ ├── tools/ # MCP tool definitions
│ ├── handlers/ # Request handlers
│ └── tests/ # MCP server tests
├── config/ # Configuration management
└── shared/ # Shared components
Development Setup
- Install development dependencies:
uv pip install -e ".[dev]"
- Set up pre-commit hooks:
pre-commit install
- Run tests:
pytest
- Code formatting:
black .
isort .
- Type checking:
mypy src/
Contributing
- Fork the repository
- Create a feature branch
- Make changes following the project coding standards
- Add tests for new functionality
- Run the test suite and ensure all tests pass
- Submit a pull request
Configuration
Main Configuration File
The primary configuration is in researchagent.config.json. It extends config/defaults/default_config.json with project-specific settings.
Key configuration sections:
embedding_model: Embedding model configurationvector_store: Vector database settingschunking_strategy: Document processing settingsrag_pipeline: Query processing parameterslogging: Logging configuration
Environment Variables
Environment variables are used only for sensitive data like API keys. See .env.example for available options.
Testing
The project includes comprehensive testing:
# Run all tests
pytest
# Run with coverage
pytest --cov=src --cov-report=html
# Run specific test categories
pytest -m unit
pytest -m integration
pytest -m e2e
Documentation
- Architecture Guide
- Development Workflow
- Project Standards
License
MIT License - see LICENSE file for details.
Support
For questions, issues, or contributions, please visit the project repository or contact the development team.
Quick Start
Clone the repository
git clone https://github.com/malteristo/reflowInstall dependencies
cd reflow
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.