Matrix Memory Model - Deterministic Reasoning with Graphs General MD Below is a fully rewritten, professional, GitHub-ready Markdown (MD) Operations Guide designed specifically as agent instructions for Leonata. It is structured for clarity, automation readiness, and operational reliability.
You can paste this directly into:
/docs/AGENT_OPERATION_GUIDE.md
or
/AGENT.md
in your GitHub repository.
Leonata is a deterministic, query-based text analysis engine designed to ingest, structure, and query large document collections. It builds internal semantic and relational structures from input data and enables fast, precise retrieval, summarization, and topic exploration.
This guide defines the operational procedures and responsibilities of automated agents, scripts, or operators interacting with Leonata via its command-line interface.
Leonata does not require model training, does not modify input data, and produces reproducible results from identical inputs.
Agents interacting with Leonata MUST be capable of performing the following operations safely and deterministically:
- Project creation and initialization
- Document ingestion
- Metadata tagging and classification
- Subproject creation using filters
- Query execution
- Summary generation
- Output formatting and export
- Project inspection and validation
Agents MUST NOT modify internal project data structures directly. All operations MUST be performed using the Leonata CLI.
- Windows 11 (x64)
- Leonata installed via
.msiinstaller - Leonata executable available in system PATH
Verify installation:
leonata --versionDefault project storage location:
%USERPROFILE%\.leonata
This directory contains:
.leonata/
├── PROJECT_NAME/
│ ├── index data
│ ├── semantic structures
│ └── metadata
Agents MUST NOT modify these files directly.
Leonata supports ingestion of:
- .txt
- .docx
- .html
- .xml
- .csv
Document parsing is performed using embedded Apache Tika.
Leonata operates using the following hierarchy:
Data Directory
└── Project
├── Documents
├── Metadata
└── Subprojects
└── Filtered subsets
Agents MUST follow this sequence.
Purpose: Initialize a clean analysis environment.
leonata --project PROJECT_NAME --delete_project INPUT_FILESExample:
leonata --project ENV_RESEARCH --delete_project "data/**/*.pdf"This performs:
- Deletes existing project data
- Parses input files
- Builds semantic structures
- Stores indexed project
Agents MUST verify successful ingestion.
leonata -p PROJECT_NAME --list filesOptional metadata inspection:
leonata -p PROJECT_NAME --list metaPurpose: Retrieve ranked relevant text and semantic structure.
Basic query:
leonata -p PROJECT_NAME -q "query text"Example:
leonata -p ENV_RESEARCH -q "carbon sequestration methods"Include topic structure and generative summary:
leonata -p PROJECT_NAME -q "query text" -iqts -gtAgents SHOULD generate summaries after ingestion.
leonata -p PROJECT_NAME -osRecommended structured summary:
leonata -p PROJECT_NAME \
-os \
-ists \
-stc 6 \
-srtc 10 \
-qtc 4Leonata supports structured CSV ingestion with category tagging.
These define metadata.
Example CSV:
Department,Author,Text
Engineering,Smith,"New solar cell design..."
Command:
leonata -p PROJECT_NAME \
-cc Department,Author \
-tc Text \
input.csvThis produces semantic tagging:
Department: Engineering
Author: Smith
These define semantic content.
-tc Text
Multiple text columns supported:
-tc Title,Abstract,Body
Subprojects allow filtered analysis without modifying the main project.
leonata -p PROJECT_NAME \
-sp SUBPROJECT_NAME \
--filter COLUMN_NAME VALUE1,VALUE2Example:
leonata -p ENV_RESEARCH \
-sp SOLAR_ONLY \
--filter Department Engineeringleonata -p PROJECT_NAME \
-sp SUBPROJECT_NAME \
-q "solar efficiency"Agents MAY request specific output formats.
Default:
JSON
Plain text:
-f textDebug dump:
-f dumpExample:
leonata -p PROJECT_NAME -q "battery storage" -f jsonLeonata can produce structured generative summaries.
Enable using:
-gtExample:
leonata -p PROJECT_NAME -q "grid stability" -iqts -gtExport classified results as CSV:
-ctExample:
leonata -p PROJECT_NAME -os -ctLeonata includes an embedded Java runtime to start Apache Tika.
Default behavior:
- Starts automatically
- Parses non-text formats
Agents SHOULD NOT install external Java.
If input files are plain text:
--text_onlyExample:
leonata -p PROJECT_NAME --text_only data/*.txtRecursive ingestion supported:
leonata -p PROJECT_NAME -r data/Wildcard ingestion supported:
leonata -p PROJECT_NAME "data/**/*.pdf"Leonata automatically generates metadata:
| Tag | Description |
|---|---|
| FILE | source file name |
| FOLDER_0 | root folder |
| FOLDER_1 | subfolder |
| TEXT_COLUMN | originating CSV column |
Agents MAY use these in filters.
Example:
--filter _FILE_ report1.pdfAgents MAY use interactive mode for manual workflows:
leonata -p PROJECT_NAME --interactiveRetrieve engine statistics:
leonata -p PROJECT_NAME --statisticsAgents MUST explicitly delete projects before re-initialization:
leonata -p PROJECT_NAME --delete_projectFailure to delete may cause stale or mixed analysis states.
Leonata is deterministic.
Agents MUST ensure:
- Same input files
- Same parameters
- Same project name
This guarantees identical outputs.
Agents MUST handle these failure conditions:
| Failure | Required Response |
|---|---|
| Project exists | Use --delete_project |
| File not found | Abort operation |
| Invalid CSV columns | Validate schema |
| Permission denied | Verify directory access |
| Tika failure | Use --text_only |
Agents MUST NOT:
- Modify
.leonatainternal files - Attempt parallel writes to same project
- Interrupt ingestion mid-process
- Modify project during query execution
Recommended ingestion pipeline:
leonata --project PROJECT_NAME --delete_project INPUT_FILES
leonata -p PROJECT_NAME --statistics
leonata -p PROJECT_NAME -os -ists -stc 6
leonata -p PROJECT_NAME -q "primary query" -iqts -gt
leonata -p PROJECT_NAME --list filesrepo/
├── AGENT.md
├── docs/
│ └── AGENT_OPERATION_GUIDE.md
├── scripts/
│ └── ingestion.sh
├── examples/
│ └── example_commands.md
leonata --project CLIMATE --delete_project "data/**/*.pdf"
leonata -p CLIMATE --statistics
leonata -p CLIMATE -os -ists -stc 5 -srtc 10
leonata -p CLIMATE -q "carbon capture" -iqts -gt
leonata -p CLIMATE -sp SOLAR --filter _FILE_ solar_report.pdf
leonata -p CLIMATE -sp SOLAR -q "efficiency"Leonata enables deterministic, structured analysis of large document collections through:
- Project-based indexing
- Metadata tagging
- Filtered subprojects
- Structured semantic queries
- Generative topic summaries
Agents MUST operate Leonata exclusively through its CLI interface using defined commands and MUST NOT modify internal project data directly.
If you'd like, I can also create:
/AGENT.mdoptimized for autonomous AI agents/OPERATIONS.mdoptimized for human operators/API_AGENT_SPEC.mdoptimized for integration with orchestration systems (LangChain, Claude Code, etc.)