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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:

- name: Install dependencies
run: |
uv sync --dev
uv sync --group all --group dev
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make installs deterministic: add --locked to uv sync.

Without --locked, uv may relock/modify during CI. Using --locked fails fast if the lockfile is out-of-date, which is what we want in CI. Also, dev is synced by default, but keeping it explicit is fine. (docs.astral.sh)

Apply this diff:

-          uv sync --group all --group dev
+          uv sync --group all --group dev --locked
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uv sync --group all --group dev
uv sync --group all --group dev --locked
🤖 Prompt for AI Agents
.github/workflows/ci.yml around line 96: the CI step runs "uv sync --group all
--group dev" which can modify the lockfile during CI; update the command to
include --locked so it becomes "uv sync --locked --group all --group dev" to
ensure the lockfile is enforced and the job fails fast if the lock is out of
date.

uv add pytest-cov
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Don’t mutate pyproject/lock in CI; declare pytest-cov in dev group instead.

uv add pytest-cov writes to pyproject/lock at build time. Move pytest-cov into the dev dependency group in pyproject.toml and install via sync; uv’s dev group is first-class and intended for this. (docs.astral.sh)

Apply this diff to the workflow:

-          uv add pytest-cov
+          # pytest-cov should be declared in [dependency-groups.dev] in pyproject.toml
+          # and installed via the uv sync above.

Then, in pyproject.toml (outside this file), ensure:

[dependency-groups]
dev = [
  "pytest",
  "pytest-cov",
  # ruff, mypy, etc.
]

I can raise a follow-up PR to move pytest-cov (and ruff/mypy) into the dev group and drop this CI mutation.

🤖 Prompt for AI Agents
.github/workflows/ci.yml around line 97: the workflow currently mutates
pyproject/lock by running "uv add pytest-cov"; remove that mutation and instead
rely on the project dev dependency group — delete the "uv add pytest-cov" step
and replace it with running uv sync or the existing install step that reads
dependency groups (so CI installs the dev group rather than writing the
lockfile); also ensure pytest-cov is declared in pyproject.toml under
[dependency-groups].dev so the CI install picks it up.


- name: Run linting with ruff (if available)
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ This new vision for Archon replaces the old one (the agenteer). Archon used to b
# SUPABASE_SERVICE_KEY=your-service-key-here
```

NOTE: Supabase introduced a new type of service key but use the legacy one (the longer one).
IMPORTANT NOTES:
- For cloud Supabase: they recently introduced a new type of service role key but use the legacy one (the longer one).
- For local Supabase: set SUPABASE_URL to http://host.docker.internal:8000 (unless you have an IP address set up).

OPTIONAL: If you want to enable the reranking RAG strategy, uncomment lines 20-22 in `python\requirements.server.txt`. This will significantly increase the size of the Archon Server container which is why it's off by default.
OPTIONAL: If you want to enable the reranking RAG strategy, add " --group server-reranking" to the end of the uv install on line 18 of `python/server/Dockerfile.server`. This will significantly increase the size of the Archon Server container which is why it's off by default.

3. **Database Setup**: In your [Supabase project](https://supabase.com/dashboard) SQL Editor, copy, paste, and execute the contents of `migration/complete_setup.sql`

Expand Down Expand Up @@ -205,7 +207,7 @@ Once everything is running:
### 🤖 AI Integration

- **Model Context Protocol (MCP)**: Connect any MCP-compatible client (Claude Code, Cursor, even non-AI coding assistants like Claude Desktop)
- **10 MCP Tools**: Comprehensive yet simple set of tools for RAG queries, task management, and project operations
- **MCP Tools**: Comprehensive yet simple set of tools for RAG queries, task management, and project operations
- **Multi-LLM Support**: Works with OpenAI, Ollama, and Google Gemini models
- **RAG Strategies**: Hybrid search, contextual embeddings, and result reranking for optimal AI responses
- **Real-time Streaming**: Live responses from AI agents with progress tracking
Expand Down Expand Up @@ -256,7 +258,7 @@ Archon uses true microservices architecture with clear separation of concerns:
| -------------- | -------------------- | ---------------------------- | ------------------------------------------------------------------ |
| **Frontend** | `archon-ui-main/` | Web interface and dashboard | React, TypeScript, TailwindCSS, Socket.IO client |
| **Server** | `python/src/server/` | Core business logic and APIs | FastAPI, service layer, Socket.IO broadcasts, all ML/AI operations |
| **MCP Server** | `python/src/mcp/` | MCP protocol interface | Lightweight HTTP wrapper, 10 MCP tools, session management |
| **MCP Server** | `python/src/mcp/` | MCP protocol interface | Lightweight HTTP wrapper, MCP tools, session management |
| **Agents** | `python/src/agents/` | PydanticAI agent hosting | Document and RAG agents, streaming responses |

### Communication Patterns
Expand Down
20 changes: 11 additions & 9 deletions python/Dockerfile.agents
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Agents Service - Lightweight PydanticAI agents ONLY (no ML models)
FROM python:3.11-slim
# Agents Service - Lightweight Pydantic AI agents
FROM python:3.12-slim

WORKDIR /app

# Install dependencies
COPY requirements.agents.txt .
RUN pip install --no-cache-dir -r requirements.agents.txt
# Install uv
RUN pip install --no-cache-dir uv

# Copy ONLY agents code - no dependencies on server code
# Copy pyproject.toml for dependency installation
COPY pyproject.toml .

# Install only agents dependencies using uv
RUN uv pip install --system --group agents

# Copy agents code - no dependencies on server code
# Agents use MCP tools for all operations
COPY src/agents/ src/agents/
COPY src/__init__.py src/
Expand All @@ -16,9 +21,6 @@ COPY src/__init__.py src/
ENV PYTHONPATH="/app:$PYTHONPATH"
ENV PYTHONUNBUFFERED=1

# NO ML models in agents container!
# Agents use MCP tools for all ML operations

# Expose Agents port
ARG ARCHON_AGENTS_PORT=8052
ENV ARCHON_AGENTS_PORT=${ARCHON_AGENTS_PORT}
Expand Down
17 changes: 11 additions & 6 deletions python/Dockerfile.mcp
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# MCP Service - Lightweight HTTP-based microservice
FROM python:3.11-slim
FROM python:3.12-slim

WORKDIR /app

# Install dependencies
COPY requirements.mcp.txt .
RUN pip install --no-cache-dir -r requirements.mcp.txt
# Install uv
RUN pip install --no-cache-dir uv

# Copy pyproject.toml for dependency installation
COPY pyproject.toml .

# Install only mcp dependencies using uv
RUN uv pip install --system --group mcp

# Create minimal directory structure
RUN mkdir -p src/mcp_server/features/projects src/mcp_server/features/tasks src/mcp_server/features/documents src/server/services src/server/config

# Copy only MCP-specific files (lightweight protocol wrapper)
# Copy only MCP-specific files
COPY src/mcp_server/ src/mcp_server/
COPY src/__init__.py src/

# Copy only the minimal server files MCP needs for HTTP communication
# Copy the server files MCP needs for HTTP communication
COPY src/server/__init__.py src/server/
COPY src/server/services/__init__.py src/server/services/
COPY src/server/services/mcp_service_client.py src/server/services/
Expand Down
30 changes: 17 additions & 13 deletions python/Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# Server Service - Web crawling and document processing microservice

# Build stage
FROM python:3.11 AS builder
FROM python:3.12 AS builder

WORKDIR /build

# Install build dependencies
# Install build dependencies and uv
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir uv

# Copy pyproject.toml for dependency installation
COPY pyproject.toml .

# Copy and install Python dependencies
COPY requirements.server.txt .
RUN pip install --user --no-cache-dir -r requirements.server.txt
# Install server dependencies to a virtual environment using uv
RUN uv venv /venv && \
. /venv/bin/activate && \
uv pip install --group server

# Runtime stage
FROM python:3.11-slim
FROM python:3.12-slim

WORKDIR /app

Expand Down Expand Up @@ -45,11 +48,11 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Copy Python packages from builder
COPY --from=builder /root/.local /root/.local
# Copy the virtual environment from builder
COPY --from=builder /venv /venv

# Install Playwright browsers
ENV PATH=/root/.local/bin:$PATH
ENV PATH=/venv/bin:$PATH
RUN playwright install chromium
Comment on lines +55 to 56
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Aug 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure Playwright is installed before invoking its CLI

With the current pyproject, “playwright install chromium” will fail. After adding Playwright to the server group, prefer invoking via module for clarity.

Apply:

-ENV PATH=/venv/bin:$PATH
-RUN playwright install chromium
+ENV PATH=/venv/bin:$PATH
+RUN python -m playwright install chromium
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ENV PATH=/venv/bin:$PATH
RUN playwright install chromium
ENV PATH=/venv/bin:$PATH
RUN python -m playwright install chromium
🤖 Prompt for AI Agents
In python/Dockerfile.server around lines 55-56, the Dockerfile calls "playwright
install chromium" before Playwright is installed; change this to run after the
pip install step that installs the server extras and invoke the CLI via the
module: replace the current RUN line with a RUN python -m playwright install
chromium and ensure that this RUN comes after the layer that installs project
dependencies (pip install .[server] or equivalent) so Playwright is present when
the install command runs.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coleam00 Thanks for confirming! You're right - since the virtual environment from the builder stage already contains Playwright (installed via the server group dependencies), it's available when the playwright install chromium command runs. I appreciate the clarification that the current setup is working correctly.


# Copy server code and tests
Expand All @@ -58,8 +61,9 @@ COPY src/__init__.py src/
COPY tests/ tests/

# Set environment variables
ENV PYTHONPATH="/app:/root/.local/lib/python3.11/site-packages:$PYTHONPATH"
ENV PYTHONPATH="/app:$PYTHONPATH"
ENV PYTHONUNBUFFERED=1
ENV PATH="/venv/bin:$PATH"

# Expose Server port
ARG ARCHON_SERVER_PORT=8181
Expand Down
135 changes: 101 additions & 34 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,64 +1,131 @@
[project]
name = "archon"
version = "0.1.0"
description = "MCP server for integrating web crawling and RAG into AI agents and AI coding assistants"
description = "Archon - the command center for AI coding assistants."
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
# Base dependencies - empty since we're using dependency groups
dependencies = []

[dependency-groups]
# Development dependencies for linting and testing
dev = [
"mypy>=1.17.0",
"pytest>=8.0.0",
"pytest-asyncio>=0.21.0",
"pytest-mock>=3.12.0",
"pytest-timeout>=2.3.0",
"pytest-cov>=6.2.1",
"ruff>=0.12.5",
"requests>=2.31.0",
"factory-boy>=3.3.0",
]

# Server container dependencies
server = [
# Web framework
"fastapi>=0.104.0",
"uvicorn>=0.24.0",
"python-multipart>=0.0.20",
"watchfiles>=0.18",
# Web crawling
"crawl4ai==0.6.2",
"mcp==1.7.1",
# Real-time communication
"python-socketio[asyncio]>=5.11.0",
# Database and storage
"supabase==2.15.1",
"openai==1.71.0",
"dotenv==0.9.9",
"python-dotenv>=1.0.0",
"sentence-transformers>=4.1.0",
"cryptography>=41.0.0",
"asyncpg>=0.29.0",
# AI/ML libraries
"openai==1.71.0",
# Document processing
"pypdf2>=3.0.1",
"python-multipart>=0.0.20",
"pdfplumber>=0.11.6",
"python-docx>=1.1.2",
"markdown>=3.8",
"fastapi>=0.104.0",
"uvicorn>=0.24.0",
"pydantic>=2.0.0",
# Security and utilities
"python-jose[cryptography]>=3.3.0",
"cryptography>=41.0.0",
"slowapi>=0.1.9",
# Core utilities
"httpx>=0.24.0",
"pydantic-ai>=0.0.13",
"pydantic>=2.0.0",
"python-dotenv>=1.0.0",
"docker>=6.1.0",
# Logging
"logfire>=0.30.0",
"python-socketio[asyncio]>=5.11.0",
"pytest-asyncio>=1.0.0",
"docker>=7.1.0",
]

[project.optional-dependencies]
test = [
# Testing (needed for UI-triggered tests)
"pytest>=8.0.0",
"pytest-asyncio>=0.21.0",
"pytest-mock>=3.12.0",
"pytest-timeout>=2.3.0",
]

# Optional reranking dependencies for server
server-reranking = [
"sentence-transformers>=4.1.0",
"torch>=2.0.0",
"transformers>=4.30.0",
]

# MCP container dependencies
mcp = [
"mcp==1.12.2",
"httpx>=0.24.0",
"pydantic>=2.0.0",
"python-dotenv>=1.0.0",
"supabase==2.15.1",
"logfire>=0.30.0",
"fastapi>=0.104.0",
]

# Agents container dependencies
agents = [
"pydantic-ai>=0.0.13",
"pydantic>=2.0.0",
"fastapi>=0.104.0",
"uvicorn>=0.24.0",
"requests>=2.31.0",
"docker>=7.0.0",
"factory-boy>=3.3.0",
"httpx>=0.24.0",
"python-dotenv>=1.0.0",
"structlog>=23.1.0",
]
api = [

# All dependencies for running unit tests locally
# This combines all container dependencies plus test-specific ones
all = [
# All server dependencies
"fastapi>=0.104.0",
"uvicorn>=0.24.0",
"pydantic>=2.0.0",
"python-multipart>=0.0.20",
"watchfiles>=0.18",
"crawl4ai==0.6.2",
"python-socketio[asyncio]>=5.11.0",
"supabase==2.15.1",
"asyncpg>=0.29.0",
"openai==1.71.0",
"pypdf2>=3.0.1",
"pdfplumber>=0.11.6",
"python-docx>=1.1.2",
"markdown>=3.8",
"python-jose[cryptography]>=3.3.0",
"cryptography>=41.0.0",
"slowapi>=0.1.9",
"docker>=6.1.0",
"logfire>=0.30.0",
# MCP specific (mcp version)
"mcp==1.12.2",
# Agents specific
"pydantic-ai>=0.0.13",
"structlog>=23.1.0",
# Shared utilities
"httpx>=0.24.0",
]

[dependency-groups]
dev = [
"mypy>=1.17.0",
"pytest-cov>=6.2.1",
"ruff>=0.12.5",
"pydantic>=2.0.0",
"python-dotenv>=1.0.0",
# Test dependencies
"pytest>=8.0.0",
"pytest-asyncio>=0.21.0",
"pytest-mock>=3.12.0",
"pytest-timeout>=2.3.0",
"requests>=2.31.0",
"factory-boy>=3.3.0",
]

[tool.ruff]
Expand Down Expand Up @@ -102,4 +169,4 @@ check_untyped_defs = true

# Third-party libraries often don't have type stubs
# We'll explicitly type our own code but not fail on external libs
ignore_missing_imports = true
ignore_missing_imports = true
26 changes: 0 additions & 26 deletions python/requirements.agents.txt

This file was deleted.

8 changes: 0 additions & 8 deletions python/requirements.mcp.txt

This file was deleted.

Loading