--- title: Jiki Documentation Strategy description: home published: true date: 2025-04-06T03:37:28.811Z tags: editor: markdown dateCreated: 2025-04-04T07:01:55.964Z ---
๐Ÿ” Metadata (click to view) ```yaml title: "Janusian Documentation Strategy" description: "A strategy for building human-readable, RAG-optimized documentation for AI agents at NeuroMentum." classification: "internal" document_type: "concept" access_groups: "neuromentum" project: "infra_docs" category: "meta" tags: ["documentation", "RAG", "ai_agent", "wiki", "postgres"] hierarchy: ["meta"] created: "2025-04-04" last_reviewed: "2025-04-04" agent_usage_hint: "Use this strategy to format all documentation for dual human-agent readability." version: "v1" ```
# ๐Ÿชถ **Janusian Documentation Strategy** ### For AI Agent & PostgreSQL Infrastructure at NeuroMentum --- ## ๐ŸŒŸ **Preamble: The Janusian Vision** Our documentation is more than technical scaffolding โ€” itโ€™s an interface between human insight and machine inference. Following **Janusian design principles**, this plan ensures: - ๐Ÿง  **Human-readability** (wiki-style hierarchy, intuitive naming) - ๐Ÿค– **AI-compatibility** (semantic metadata, chunked content, retriever-optimized) - ๐Ÿ”„ **Dual-perspective thinking**: all docs are shaped for both **intelligent co-developers** and **intelligent consumers** (agents, LLMs, and future tools) - ๐Ÿ”ฎ **Future-proofing** via metadata, version control, and traceable structure --- ## ๐Ÿ“ 1. **Folder Hierarchy: Wiki-Readable, Logically Scoped** Keep folder structure intuitive, max 3โ€“4 levels deep: ``` docs/ โ”œโ”€โ”€ postgres/ โ”‚ โ”œโ”€โ”€ schemas/ โ”‚ โ”œโ”€โ”€ monitoring/ โ”‚ โ””โ”€โ”€ admin_tasks/ โ”œโ”€โ”€ personas/ โ”‚ โ”œโ”€โ”€ chatgpt/ โ”‚ โ”œโ”€โ”€ khebri/ โ”‚ โ”œโ”€โ”€ scarabone/ โ”‚ โ””โ”€โ”€ scarabtwo/ โ”œโ”€โ”€ agent_architecture/ โ”‚ โ”œโ”€โ”€ kafka/ โ”‚ โ”œโ”€โ”€ llm_integration/ โ”‚ โ””โ”€โ”€ task_orchestration/ โ”œโ”€โ”€ reference/ โ”‚ โ””โ”€โ”€ utf8_handling.md โ””โ”€โ”€ manifest.md ``` ๐Ÿ“Œ Each folder = a logical domain ๐Ÿ“Œ Each file = a self-contained, RAG-chunkable unit --- ## ๐Ÿท๏ธ 2. **Embedded Metadata per File** Every file begins with **structured YAML frontmatter**: ```yaml --- title: "Khebri Schema" description: "PostgreSQL schema for thread tracking and status." project: "chatBCI" category: "schemas" tags: ["postgres", "khebri", "thread", "active_status", "sql"] hierarchy: ["postgres", "schemas"] created: "2025-03-31" last_reviewed: "2025-04-04" visibility: ["human", "ai_agent", "scout_agent"] agent_usage_hint: "Use when setting up or querying thread states" version: "v1" --- ``` ๐Ÿ“Ž Purpose: - Helps RAG engines **filter** and **rank** results - Enables **traceability** for future tooling - Bridges intent between human and AI agents --- ## ๐Ÿ“ฆ 3. **Chunking + RAG Readiness Guidelines** Each doc should: - Be under **1000โ€“1500 tokens per section** - Use **semantic headings** (e.g., `## Create Thread Table`, `## Reset Identity Counter`) - Include **examples + explanations** (`Why`, `When`, `How`) - Add **"Janusian Intent"** callouts: ```md > ๐Ÿง  Janusian Intent: This query resets identity counters to preserve clean state across simulation iterations and testing loops. ``` --- ## ๐Ÿง  4. **Central Metadata Registry: `janus_index.json`** Maintained at project root (`docs/`), this file tracks every document: ```json { "docs/postgres/schemas/khebri.sql": { "title": "Khebri Schema", "tags": ["postgres", "schema", "threads"], "hierarchy": ["postgres", "schemas"], "version": "v1", "agent_usage_hint": "Used during thread setup, task tracking", "visibility": ["ai_agent", "human"] } } ``` ๐Ÿ’ก **Bonus**: Later you can auto-generate this via a crawler script. --- ## ๐Ÿงฌ 5. **Versioning + Change History** Use simple folder or file-based versioning: ``` docs/ โ””โ”€โ”€ personas/ โ””โ”€โ”€ khebri/ โ”œโ”€โ”€ v1.md โ””โ”€โ”€ v2.md ``` Or append version into frontmatter and add `CHANGELOG.md` per folder: ```yaml version: "v2" changelog: - "2025-04-01: Added updated persona structure" - "2025-03-31: Initial draft" ``` --- ## โš™๏ธ 6. **RAG Integration Features (Future-Ready)** Later, these files can power: - **Chunk-based vector search** - **Metadata + embedding fusion retrieval** - **Agent-specific prompt context filters** (via `tags`, `hierarchy`, `agent_usage_hint`) - **Access gating** with `visibility` field ๐Ÿ“ฆ Optional: Extend with `graph` or `relations` fields to define links: ```yaml graph: links_to: ["state_transitions.md", "thread_multistates.md"] agent_role: "architect" ``` --- ## ๐Ÿš€ 7. **Starter Scripts to Support This System** We can build: - `build_index.py`: Scans folders, extracts frontmatter, outputs `janus_index.json` - `chunk_docs.py`: Breaks large docs into overlapping chunks with hierarchy/context - `rag_query_preview.py`: Preview which doc chunks would be retrieved for a given question Let me know if you'd like these generated! ๐Ÿ’ป --- ## ๐Ÿงญ 8. **Agent-Aware Style Guidelines** | Style Area | Guideline | |------------------|-----------| | ๐Ÿ’ฌ Headings | Use `##` or `###` consistently for chunk boundaries | | ๐Ÿ’ก Intent Blocks | Add "Janusian Intent" sections to explain *purpose* | | ๐Ÿ’ป Code Blocks | Use real SQL / shell / markdown examples | | ๐Ÿ”— Cross-links | Use relative paths: `[See thread states](../states.md)` | | ๐Ÿ”’ Access Hints | Use `visibility` to mark human vs. agent-readable | --- ## ๐Ÿ“Œ Final Summary **Your RAG-ready Janusian doc system** will be: - ๐Ÿ” **Searchable** by humans and AI - ๐Ÿงฑ **Modular**, well-scoped, chunkable - ๐Ÿท๏ธ **Metadata-rich**, with project, version, intent, and role info - ๐Ÿง  **Philosophically aligned** with human-AI co-development - ๐Ÿ’ก **Designed to scale**, as agents and tooling grow ---