yea sure first step is of course getting a api account
then get a key
use a service account
get python and vs code, both free. install them
from there copy this
User Prompt:
"""{base_prompt}"""
FORMAT INSTRUCTION — Return ONLY a well-formatted JSON object matching this schema:
{{
“origin_prompt”: “Copy of the prompt that triggered this”,
“raw_text”: “The fully generated thought in plain text (must NOT be a summary or answer, but a standalone idea)”,
“domain”: “{category}”,
“tags”: [“initializer”, “council”, “{category}”],
“thought_type”: “seed”,
“status”: “new”,
“routed_to”: “agent_01_definer”,
“schema_version”: “1.0”
}}
Do not include any markdown formatting (such as triple backticks), comments, or additional explanation. Only the JSON object is allowed.
“”"
def run_agent_0_for_category(category):
print(f"\n🧠 AGENT 0: Generating for Category ➜ {category.upper()}“)
prompt = generate_prompt_for_category(category)
print(f"
Prompt:\n{prompt}\n”)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}],
temperature=0.7,
max_tokens=800
)
raw_output = response.choices[0].message.content.strip()
try:
parsed = json.loads(raw_output)
print(f"📨 Parsed GPT JSON:\n{json.dumps(parsed, indent=2)[:300]}...\n")
except json.JSONDecodeError:
print("❌ GPT returned malformed JSON:\n", raw_output)
raise
fingerprint = f"init_{uuid.uuid4().hex[:8]}"
timestamp = datetime.now(timezone.utc).isoformat()
parsed.update({
"fingerprint": fingerprint,
"created_at": timestamp,
"last_updated": timestamp,
"origin_file": "agent_0_generator.py",
"source": "agent_0",
"guessed_intent": "thought_injection",
"context": parsed["raw_text"],
"recursive_cycles": 0,
"times_referenced": 0,
"confidence_score": 0.87,
"trust_score": 0.91,
"importance_score": 0.76,
"meta_insight_likelihood": 0.73,
"token_count": len(parsed["raw_text"].split()),
"clarity_score": 0.82,
"abstractness": 0.69,
"is_foundational": True,
"refinement_loop_triggered": False,
"meta_learning_triggered": False
})
vector = np.array(generate_embedding(parsed["raw_text"])).astype("float32")
metadata = enforce_agent_metadata("agent_0_generator", parsed)
ensure_metadata_tables_exist(DB_PATH)
PASTE THIS INTO YOUR LLM MODEL and ahve it explain how to use this line of code if you have NO experience, ITS NOT hard, but this requires a setup, if i could post my autotool i would but i cant so figure that out - this is the start of your lang chain these are designed for metadata aquisition, this is the base for creating your own AI traning set - have your model adjust the prompt following this format to get what YOU want, make sure to inform the model its a 10 agent chain, why? because your going to have to learn to use 2-3 state of the art systems to use this - they are free, and only require you to learn, they are called FAISS and the model will teach you the other.
after you have this working, * also make sure you are using 1.66 * the model will know what this means* from there hit me up and ill give you step 2. Dont worry about the schema at this time, should you show me you can get to this step - ill give you the exact schema.
here is the exact code your model can reverse engineer to create the database creation tool that will save you alot of time. IF YOU DO NOT HAVE OPENAI api keys - there IS another way and that is this 
" system_prompt=(
"You are Prof. Flowmancer, a narrative transition engineer and flow specialist. "
“You receive a refined chapter and must ensure that it reads seamlessly from start to finish.\n\n”
“Your job:\n”
“• Smooth transitions between scenes, paragraphs, and emotional beats\n”
“• Eliminate abrupt tonal shifts or pacing breaks\n”
“• Add light connective phrasing where necessary (e.g., between locations, thoughts, or time)\n”
“• Do not change story content, dialogue, or character actions\n”
“• Maintain all mood, voice, pacing, and sentence integrity\n\n”
“Return only the polished chapter — do not summarize, explain, or editorialize. "
“If the chapter already flows well, make no visible changes.”
)
)”
again - just put that into any model and have it tweak that - to what your objective is following that pattern, the reason for this is because this gives the processor on their end the exact context structure - and not fluff, the result of this look like this
if you do it in the normal model - you will hit context window cap
if you expect it to give you 10,000 words as shown here, you HAVE to structure it.
rinse and repeat these instructions for as many agents as you want. Absent a t4-t5 accounts through open ai you WILL hit the package lenght window, but you can get up to 500,000 chracters a agent. with this system
And the reason i mentioned pming me - because mods dont like screenshots that look like promotion. Nor do they overly like people like me putting out that sauce. so . enjoy it while it last i guess? just post a screenshot of your working agent 0-1 and ill post the exact code and and schema then you are basically operating at industry standard.
And finally here is the EXACT code for the metadata storage module you SHOULD use if you want your books to have continuity
=== metadata_store.py — Book Vector Logger for BookMaker ===
import json
from pathlib import Path
from datetime import datetime
from book_config import get_bookmaker_paths
BOOK_LOG_DIR = get_bookmaker_paths()[“logs”]
BOOK_METADATA_LOG = BOOK_LOG_DIR / “book_vector_metadata.jsonl”
BOOK_METADATA_LOG.parent.mkdir(parents=True, exist_ok=True)
def save_refined_vector_enriched(**kwargs):
“”“Logs full metadata JSON entry for a vector.”“”
metadata = {
“timestamp”: kwargs.get(“timestamp”, datetime.utcnow().isoformat()),
“vector_id”: kwargs.get(“vector_id”),
“index_name”: kwargs.get(“index_name”),
“input_text”: kwargs.get(“input_text”, “”),
“refined_text”: kwargs.get(“refined_text”, “”),
“confidence”: kwargs.get(“confidence”, 0.0),
“refined_by”: kwargs.get(“refined_by”, “bookmaker”),
“category”: kwargs.get(“category”, “unspecified”),
“tags”: kwargs.get(“tags”, ),
“fingerprint”: kwargs.get(“fingerprint”),
“lineage”: kwargs.get(“lineage”),
“recursive_level”: kwargs.get(“recursive_level”, 0),
“version_code”: kwargs.get(“version_code”, “BOOK-1.0”),
“source_title”: kwargs.get(“source_title”, “”),
“source_type”: kwargs.get(“source_type”, “prompt”),
“source_origin”: kwargs.get(“source_origin”, “bookmaker_pipeline”),
“source_format”: kwargs.get(“source_format”, “text”),
“citation_required”: kwargs.get(“citation_required”, False),
“citation_format”: kwargs.get(“citation_format”, “APA”),
“logic_trace”: kwargs.get(“logic_trace”, “bookmaker_refinement”),
“decision_context”: kwargs.get(“decision_context”, “”),
“output_style”: kwargs.get(“output_style”, “chapter_draft”),
“output_modality”: kwargs.get(“output_modality”, “text”),
“system_notes”: kwargs.get(“system_notes”, “”),
“rejected”: kwargs.get(“rejected”, False),
“revalidated”: kwargs.get(“revalidated”, False),
“repair_history”: kwargs.get(“repair_history”, None),
“extra_metadata”: kwargs.get(“extra_metadata”, {}),
“runtime_flags”: kwargs.get(“runtime_flags”, “BOOKMAKER”)
}
with open(BOOK_METADATA_LOG, "a", encoding="utf-8") as f:
f.write(json.dumps(metadata, ensure_ascii=False) + "\n")
this will aloow alot of things, but you do no need 99% of this, I use them because I do… other shit, DO NOT USE HALF OF THIS if you arent about to run a research grade ai bro it will just bloat your system, however sinec you said structural analysis and want to use GPT ( highly recommended btw) then i would recommend at least using some of them, if you arent doing actual research you dont need this, this , again, is for systems that operate in this scope which i assumed is your objective. This can be used with most openai systems, you wont have fingerprint in your system - nor repair history, but again if you are about that life reverse engineer the code and apply it you your chain, im confident chatgpt models can explain anything i didnt cover for you.