Sokrates Monorepo Initialization and Restructuring

Summary

This process documents the transition of the Sokrates project from a fragmented set of directories into a unified monorepo managed by uv. The restructuring involved migrating the core knowledge management system (formerly “sets,” now “eidos”), establishing workspace members for the intelligence layer and agent bundles, and standardizing the directory hierarchy for NixOS configurations.

Details

The initialization of the sokrates repository was a foundational event that established the project’s architectural layout. The process began with the consolidation of code previously located in a temporary directory (grimoire-foundation-sets-rename/, now eidos/) into a clean, top-level structure.

Workspace Configuration

The project utilizes uv for Python workspace management. A root-level pyproject.toml defines the workspace members, allowing for local cross-dependencies between packages using [tool.uv.sources]. The uv.lock file is committed to the repository to ensure reproducible environments across the development and production (NixOS) stacks.

Component Migration and Renaming

A significant portion of the restructuring involved the “Eidos” component (the knowledge graph API, formerly Grimoire).

  • Renaming: The internal Python package was renamed from sets to eidos across 76 files to align with the project’s naming conventions.
  • Promotion: The code was moved from a nested sets_app directory to the top-level eidos/ directory (now eidos/, formerly grimoire/).
  • Dependencies: The eidos package was configured with FastAPI, Neo4j, Voyage AI, and MCP integrations.

Directory Structure

The resulting monorepo structure was established as follows:

  • eidos/: The core knowledge management system and API (formerly grimoire/).
  • agents/: The intelligence layer (pydantic-ai agents — curator, future specialists).
  • bundles/: Contains specialized agent configurations:
    • cowork/: The base knowledge worker bundle.
    • code/: A stub for the V2 coding-specific bundle.
    • compound/: A stub for the V3 Agent SDK bundle.
  • nixos/: Renamed from NixOS/ to maintain lowercase consistency; contains fleet management and appliance configurations.
  • wiki/: Wiki pipeline — normalize, embed, discover, extract, synthesize, load.
  • plugin/: Claude Code plugin (sokrates-ctl CLI, skills, agents).

Execution Steps

The restructuring was performed through a series of automated bash commands and file edits:

  1. Git repository initialization on the main branch.
  2. Directory creation and file movement using mv and mkdir.
  3. Global string replacement for package renaming.
  4. Scaffolding of pyproject.toml files for all workspace members to ensure they resolve and import correctly.
  5. Standardization of .gitignore to include workspace-level lockfiles while excluding temporary build artifacts.