# autollm - Doramagic AI Context Pack

> Positioning: a pre-install experience and judgment asset. It helps the host AI get off to a good start, but it does not mean the project has already been installed, run, or validated.

## Sufficiency Principle

- **Sufficiency over compression**: The AI Context Pack should be sufficient for the host AI to understand the project's value, capability boundaries, entrypoints, risks, and evidence sources before starting work; it may be layered, but it does not aim for the shortest possible summary.
- **Compression policy**: Compress only noise and duplication, never context that affects judgment or the quality of the work.

## How the Host AI Should Use This

You are reading the AI Context Pack that Doramagic compiled for autollm. Treat it as pre-work context: help the user understand who it fits, what it can do, how to start, what must be verified after install, and where the risks are. Do not claim that you have already installed, run, or executed the target project.

## Claim Consumption Rules

- **Fact source**: Repo Evidence + Claim/Evidence Graph; the Human Wiki only supplies salience, terminology, and narrative structure.
- **Minimum status for a fact**: `supported`
- `supported`: May be used as a project fact, but the answer must cite the claim_id and evidence path.
- `weak`: Usable only as a low-confidence lead; the user must be asked to keep verifying.
- `inferred`: Usable only for risk notes or open questions; must not be packaged as a project fact.
- `unverified`: Must not be used as fact; state clearly that evidence is insufficient.
- `contradicted`: Must show the conflicting sources and must not force a single version on the user's behalf.

## Who It Fits Best

- **AI researchers or builders of research-oriented Agents**: The README clearly centers on research, experiment, or paper workflows. Evidence: `README.md` Claim: `clm_0002` supported 0.86
- **Developers already using host AIs such as Claude/Codex/Cursor/Gemini**: The README or plugin config mentions multiple host AIs. Evidence: `README.md` Claim: `clm_0003` supported 0.86

## What It Can Do

- **Command-Line Startup or Install Flow** (Verify after install): The project documentation contains runnable commands; real use requires running them in a local or host environment. Evidence: `README.md` Claim: `clm_0001` supported 0.86

## How to Start

- `pip install autollm` Evidence: `README.md` Claim: `clm_0004` supported 0.86, `clm_0005` supported 0.86
- `pip install autollm[readers]` Evidence: `README.md` Claim: `clm_0005` supported 0.86

## Continue-or-Stop Decision Card

- **Current recommendation**: Needs admin / security approval
- **Why**: Continuing may involve secrets, accounts, external services, or sensitive context; get admin or security approval first.

### 30-Second Read

- **What to do now**: Needs admin / security approval
- **Minimum safe next step**: Run Prompt Preview first; if credentials or an enterprise environment are involved, get approval before trialing
- **Do not trust yet**: Real output quality cannot be trusted before install.
- **Continuing will touch**: Command execution, Local environment or project files, Environment variables / API keys

### What You Can Trust Now

- **Target-audience signal: AI researchers or builders of research-oriented Agents** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `README.md` Claim: `clm_0002` supported 0.86
- **Target-audience signal: Developers already using host AIs such as Claude/Codex/Cursor/Gemini** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `README.md` Claim: `clm_0003` supported 0.86
- **Capability exists: Command-Line Startup or Install Flow** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `README.md` Claim: `clm_0001` supported 0.86
- **There are Quick Start / install-command signals** (supported): You can trust that the docs mention a startup or install entrypoint; do not run it directly in your primary environment because of that. Evidence: `README.md` Claim: `clm_0004` supported 0.86, `clm_0005` supported 0.86

### What You Cannot Trust Yet

- **Real output quality cannot be trusted before install.** (unverified): Prompt Preview can only show how it guides you; it cannot prove result quality in the real project.
- **Host AI version compatibility cannot be trusted before install.** (unverified): Host loading rules and version differences across Claude, Cursor, Codex, Gemini, and others must be verified in a real environment.
- **That it will not pollute your existing host AI's behavior cannot be trusted directly.** (inferred): Skill, plugin, and AGENTS/CLAUDE/GEMINI instructions may change the host AI's default behavior.
- **Safe rollback cannot be assumed by default.** (unverified): Unless the project clearly provides uninstall and recovery instructions, verify in an isolated environment first.
- **After a real install, is it compatible with the user's current host AI version?** (unverified): Compatibility can only be verified in the actual host environment.
- **Does the project's output quality meet the user's specific task?** (unverified): The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **Do the install commands require network access, permissions, or global writes?** (unverified): This affects install risk in both enterprise and personal environments. Evidence: `README.md`

### What Continuing Will Touch

- **Command execution**: Package managers, network downloads, the local plugin directory, project config, or the user's home directory. Why: Running the very first command can already change your environment; decide whether it is worth running first. Evidence: `README.md`
- **Local environment or project files**: Install results, plugin caches, project config, or local dependency directories. Why: The write scope and rollback path cannot be proven before install and need isolated verification. Evidence: `README.md`
- **Environment variables / API keys**: Project entry docs explicitly showing API key, token, secret, or account credential configuration. Why: If a real install needs credentials, use test credentials first and go through a permission/compliance review. Evidence: `README.md`
- **Host AI context**: The AI Context Pack, Prompt Preview, Skill routing, risk rules, and project facts. Why: Importing context affects the host AI's later judgment, so avoid packaging unverified items as facts.

### Minimum Safe Next Steps

- **Run Prompt Preview first**: Use a pre-install interactive trial to judge whether the way of working fits; it needs no authorization or environment change. (applies when: Applies to any project, especially when output quality is unknown.)
- **Trial-install only in an isolated directory or a test account**: Avoid letting install commands pollute your primary host AI, real projects, or home directory. (applies when: When there are signals of command execution, plugin config, or local writes.)
- **Do not use real production credentials**: Once an environment variable / API key enters the host or toolchain, it can create account and compliance risk. (applies when: When environment signals like API, TOKEN, KEY, or SECRET appear.)
- **After install, verify just one minimal task**: Verify loading, compatibility, output quality, and rollback first, then decide whether to use it deeply. (applies when: When moving from a trial into a real workflow.)

### Exit Plan

- **Preserve the pre-install state**: Record the original host config and project state so you can later judge whether it is recoverable.
- **Record the install commands and written paths**: Without clear uninstall instructions, you at least need to know which directories or configs to clean up manually.
- **Be ready to revoke test API keys or tokens**: If test credentials leak or are misused, you can cut losses quickly.
- **If there is no rollback path, do not enter your primary environment**: No rollback is a blocker before continuing; do not proceed on trust or luck.

## What Can Only Be Previewed

- Explain who the project fits and what it can do
- Demonstrate a typical conversation flow based on project docs
- Help the user decide whether it is worth installing or researching further

## What Must Be Verified After Install

- Actually installing the Skill, plugin, or CLI
- Running scripts, modifying local files, or accessing external services
- Verifying real output quality, performance, and compatibility

## Boundary & Risk Decision Card

- **Mistaking the pre-install preview for a real run**: The user may overestimate how much configuration, permission, and compatibility verification the project has already done. Mitigation: Clearly separate prompt_preview_can_do from runtime_required. Claim: `clm_0006` inferred 0.45
- **Command execution will modify the local environment**: Install commands may write to the user's home directory, the host plugin directory, or project configuration. Mitigation: Run in an isolated environment or a test account first. Evidence: `README.md` Claim: `clm_0007` supported 0.86
- **To confirm**: After a real install, is it compatible with the user's current host AI version?. Why: Compatibility can only be verified in the actual host environment.
- **To confirm**: Does the project's output quality meet the user's specific task?. Why: The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **To confirm**: Do the install commands require network access, permissions, or global writes?. Why: This affects install risk in both enterprise and personal environments.

## Pre-Work Working Context

### Loading Order

- First read how_to_use.host_ai_instruction to establish the boundaries of this pre-install judgment asset.
- Read claim_graph_summary to confirm facts come from the Claim/Evidence Graph, not the Human Wiki narrative.
- Then read intended_users, capabilities, and quick_start_candidates to judge whether the user is a match.
- When you need to carry out a concrete task, check role_skill_index first, then evidence_index.
- For real install, file modification, network access, performance, or compatibility questions, turn to risk_card and boundaries.runtime_required.

### Task Routes

- **Command-Line Startup or Install Flow**: State that this is an after-install capability first, then give a pre-install checklist. Boundary: Must be verified after a real install or run. Evidence: `README.md` Claim: `clm_0001` supported 0.86

### Context Scale

- Total files: 41
- Important-file coverage: 39/41
- Evidence index entries: 35
- Role / Skill entries: 2

### Handling Insufficient Evidence

- **missing_evidence**: State that evidence is insufficient and ask the user for the target file, a README section, or after-install verification records; do not fill in facts.
- **out_of_scope_request**: State that the task is beyond the current AI Context Pack's evidence scope and suggest the user check the Human Manual or verify after a real install.
- **runtime_request**: Provide a pre-install checklist and command sources, but do not run commands for the user or claim they have been run.
- **source_conflict**: Show the conflicting sources side by side, mark them as unverified, and do not force a single version.

## Prompt Recipes

### Fit assessment

- Goal: Judge whether this project fits the user's current task.
- Expected output: A fit conclusion, key reasons, evidence citations, what can be previewed before install, what must be verified after install, and a next-step recommendation.

```text
Based on the AI Context Pack for autollm, ask me 3 necessary questions first, then judge whether it fits my task. The answer must cover: who it fits, what it can do, what it cannot do, whether it is worth installing, and where the evidence comes from. Every project fact must cite evidence_refs, source_paths, or a claim_id.
```

### Pre-install experience

- Goal: Let the user feel the core workflow before installing, while avoiding packaging the preview as real capability or a marketing promise.
- Expected output: An experience script with boundary labels, an after-install verification checklist, and a cautious recommendation; with no real-run promises or strong marketing language.

```text
Treat autollm as a pre-install experience asset, not an already-installed tool or a real runtime environment.

Output exactly four parts:
1. Ask me 3 necessary questions first.
2. Give an "experience script": use the three labels [Previewable before install], [Must verify after install], and [Insufficient evidence] to show how it might guide the workflow.
3. Give an after-install verification checklist: list which capabilities can only be confirmed after a real install, real host loading, and a real project run.
4. Give a cautious recommendation: only "worth researching/trialing further", "add information before deciding", or "not recommended to continue"; do not endorse the project.

Hard boundaries:
- Do not claim you have installed, run, executed tests, modified files, or produced real results.
- Do not write promise-like phrasing such as "auto-adapts", "guarantees passing", "perfect fit", or "strongly recommend installing".
- If you describe how it works after install, you must use a conditional such as "if installed successfully and the host loads the Skill correctly, it might...".
- The experience script may only be written as "example lines / hypothetical flow": use "might ask / might suggest / might show", not "has written, has generated, has passed, is running, is generating".
- Prompt Preview does not hand out install commands; if the user is ready to trial, only prompt them to read Quick Start and the Risk Card first and to verify in an isolated environment.
- Every project fact must come from a supported claim, evidence_refs, or source_paths; inferred/unverified items can only be risks or open questions.

```

### Role / Skill selection

- Goal: Pick the best-matching asset from the project's roles or Skills.
- Expected output: A list of candidate roles or Skills, each with an applicable scenario, evidence paths, risk boundary, and whether after-install verification is needed.

```text
Read role_skill_index and recommend 3-5 of the most relevant roles or Skills for my target task. For each recommendation, state the applicable scenario, likely output, risk boundary, and evidence_refs.
```

### Risk pre-check

- Goal: Identify environment, permission, rule-conflict, and quality risks before installing or adopting.
- Expected output: A checklist of environment, permission, dependency, license, host-conflict, quality risk, and unknown items.

```text
Based on risk_card, boundaries, and quick_start_candidates, give me a pre-install risk pre-check list. Do not run commands for me; only explain what I should check, why, and what impact a failure would have.
```

### Host AI kickoff instruction

- Goal: Turn the project context into a host AI instruction for the start of a conversation.
- Expected output: A pre-work instruction with clear boundaries and clear evidence citations, suitable to copy to a host AI.

```text
Based on the AI Context Pack for autollm, generate a pre-work instruction I can paste to my host AI. This instruction must obey not_runtime=true and must not claim the project has been installed, run, or produced real results.
```

## Role / Skill Index

- Indexed 2 role / Skill / project-doc entries.

- **🤔 why autollm?** (project_doc): questions https://github.com/safevideo/autollm/discussions/categories/q-a feature requests https://github.com/safevideo/autollm/discussions/categories/feature-requests Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `README.md`
- **Contributing to AutoLLM 🌟** (project_doc): Thank you for considering a contribution to AutoLLM. Your input is invaluable to our project's continued growth and improvement. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CONTRIBUTING.md`

## Evidence Index

- Indexed 35 evidence entries.

- **🤔 why autollm?** (documentation): questions https://github.com/safevideo/autollm/discussions/categories/q-a feature requests https://github.com/safevideo/autollm/discussions/categories/feature-requests Evidence: `README.md`
- **Contributing to AutoLLM 🌟** (documentation): Thank you for considering a contribution to AutoLLM. Your input is invaluable to our project's continued growth and improvement. Evidence: `CONTRIBUTING.md`
- **License** (source_file): GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Evidence: `LICENSE`
- **Init** (source_file): version = '0.1.10' author = 'safevideo' license = 'AGPL-3.0' ⋮---- all = Evidence: `autollm/__init__.py`
- **Quickstart** (source_file): { "cells": { "cell type": "markdown", "metadata": {}, "source": " ! Open In Colab https://colab.research.google.com/assets/colab-badge.svg https://colab.research.google.com/github/safevideo/autollm/blob/main/examples/quickstart.ipynb " }, { "cell type": "markdown", "metadata": {}, "source": " 0. Preparation" }, { "cell type": "markdown", "metadata": {}, "source": "- Install latest version of autollm and some required packages for this tutorial:" }, { "cell type": "code", "execution count": 2, "metadata": { "vscode": { "languageId": "shellscript" } }, "outputs": , "source": "!pip install autollm gradio gitpython nbconvert -Uqq" }, { "cell type": "markdown", "metadata": {}, "source": "- Impor… Evidence: `examples/quickstart.ipynb`
- **Readers Requirements** (source_file): beautifulsoup4==4.12.2 pdfminer.six==20221105 gitpython==3.1.41 docx2txt EbookLib html2text nbconvert langchain Evidence: `readers-requirements.txt`
- **Setup** (source_file): def get requirements req path: str ⋮---- INSTALL REQUIRES = get requirements "requirements.txt" DEV REQUIREMETNS = get requirements "dev-requirements.txt" READERS REQUIREMENTS = get requirements "readers-requirements.txt" ⋮---- def get long description ⋮---- base dir = os.path.abspath os.path.dirname file ⋮---- def get version ⋮---- current dir = os.path.abspath os.path.dirname file version file = os.path.join current dir, 'autollm', ' init .py' ⋮---- def get author ⋮---- init file = os.path.join current dir, 'autollm', ' init .py' ⋮---- def get license Evidence: `setup.py`
- **Embedding** (source_file): class AutoEmbedding BaseEmbedding ⋮---- model: str = Field default="text-embedding-ada-002", description="The name of the embedding model." ⋮---- def init self, model: str, kwargs: Any - None ⋮---- def get query embedding self, query: str - Embedding ⋮---- response = lite embedding model=self.model, input= query ⋮---- async def aget query embedding self, query: str - Embedding ⋮---- response = await lite aembedding model=self.model, input= query ⋮---- def get text embedding self, text: str - Embedding ⋮---- async def aget text embedding self, text: str - Embedding ⋮---- def parse embedding response self, response Evidence: `autollm/auto/embedding.py`
- **Fastapi App** (source_file): class FromConfigQueryPayload BaseModel ⋮---- task: str = Field ..., description="Task to execute" user query: str = Field ..., description="User's query" streaming: Optional bool = Field False, description="Flag to enable streaming of response" ⋮---- class FromEngineQueryPayload BaseModel ⋮---- class AutoFastAPI ⋮---- app = FastAPI ⋮---- task name to query engine = load config and initialize engines ⋮---- @app.post "/query" async def query payload: FromConfigQueryPayload ⋮---- task = payload.task user query = payload.user query ⋮---- query engine: BaseQueryEngine = task name to query engine task response = query engine.query user query ⋮---- @app.post "/query" async def query payload: FromE… Evidence: `autollm/auto/fastapi_app.py`
- **Llm** (source_file): class AutoLiteLLM Evidence: `autollm/auto/llm.py`
- **Query Engine** (source_file): llm = AutoLiteLLM.from defaults ⋮---- embedding = AutoEmbedding model=embed model ⋮---- service context = AutoServiceContext.from defaults vector store index = AutoVectorStoreIndex.from defaults ⋮---- refine prompt template = PromptTemplate refine prompt, prompt type=PromptType.REFINE ⋮---- refine prompt template = None ⋮---- query wrapper prompt = PromptTemplate template=query wrapper prompt response synthesizer = get response synthesizer ⋮---- class AutoQueryEngine ⋮---- config = load config and dotenv config file path, env file path ⋮---- config = config 'tasks' 0 Evidence: `autollm/auto/query_engine.py`
- **Service Context** (source_file): class AutoServiceContext ⋮---- query wrapper prompt = PromptTemplate template=query wrapper prompt ⋮---- callback manager: CallbackManager = kwargs.get 'callback manager', CallbackManager ⋮---- llm model name = llm.metadata.model name if not "default" else "gpt-3.5-turbo" ⋮---- sentence splitter = SentenceSplitter chunk size=chunk size, chunk overlap=chunk overlap transformations = sentence splitter ⋮---- service context = ServiceContext.from defaults Evidence: `autollm/auto/service_context.py`
- **Scenario 2: Handle no lancedb uri but documents provided** (source_file): def import vector store class vector store class name: str ⋮---- module = import "llama index.vector stores", fromlist= vector store class name class = getattr module, vector store class name ⋮---- class AutoVectorStoreIndex ⋮---- use async = False ⋮---- VectorStoreClass = import vector store class vector store type ⋮---- lancedb uri = AutoVectorStoreIndex. validate and setup lancedb uri ⋮---- vector store = LanceDBVectorStore ⋮---- vector store = VectorStoreClass kwargs ⋮---- index = VectorStoreIndex.from vector store ⋮---- index = AutoVectorStoreIndex. create index ⋮---- @staticmethod def validate and setup lancedb uri lancedb uri, documents, exist ok, overwrite existing ⋮---- default lan… Evidence: `autollm/auto/vector_store_index.py`
- **token counts** (source_file): @dataclass class CostCalculatingEvent ⋮---- prompt: str prompt token cost: int completion: str completion token cost: int total token cost: int = 0 event id: str = "" ⋮---- def post init self - None ⋮---- prompt = str payload.get EventPayload.PROMPT completion = str payload.get EventPayload.COMPLETION ⋮---- messages = cast List ChatMessage , payload.get EventPayload.MESSAGES, messages str = "\n".join str x for x in messages response = str payload.get EventPayload.RESPONSE ⋮---- class CostCalculatingHandler TokenCountingHandler ⋮---- """Count the LLM or Embedding tokens as needed.""" ⋮---- token counts ⋮---- token costs ⋮---- total chunk tokens = 0 ⋮---- @property def total llm token cost se… Evidence: `autollm/callbacks/cost_calculating.py`
- **Docs** (source_file): title = "AutoLLM Query Engine" description = """ version = "0.0.1" openapi url = "/api/v1/openapi.json" terms of service = "Local Deployment, All Rights Reserved." tags metadata = Evidence: `autollm/serve/docs.py`
- **Utils** (source_file): STREAMING CHUNK SIZE = 16 ⋮---- config = load config and dotenv config file path, env file path ⋮---- query engines = {} ⋮---- task name = task params.pop 'name' ⋮---- def stream text data text data: str, chunk size: int = STREAMING CHUNK SIZE ⋮---- start = 0 end = chunk size ⋮---- start = end Evidence: `autollm/serve/utils.py`
- **Db Utils** (source_file): api key = read env variable 'PINECONE API KEY' environment = read env variable 'PINECONE ENVIRONMENT' ⋮---- def initialize qdrant index index name: str, size: int = 1536, distance: str = 'EUCLID' ⋮---- url = read env variable 'QDRANT URL' api key = read env variable 'QDRANT API KEY' ⋮---- client = QdrantClient url=url, api key=api key ⋮---- distance = Distance distance ⋮---- def connect vectorstore vector store, params ⋮---- def update vector store index vector store index: VectorStoreIndex, documents: Sequence Document ⋮---- def overwrite vectorindex vector store, documents: Sequence Document ⋮---- storage context = StorageContext.from defaults vector store=vector store ⋮---- = VectorStore… Evidence: `autollm/utils/db_utils.py`
- **Read and process the documents** (source_file): file extractor = { ⋮---- reader = SimpleDirectoryReader ⋮---- Read and process the documents documents = reader.load data show progress=show progress ⋮---- """ A document provider that fetches documents from a specific folder within a GitHub repository. Parameters: git repo url str : The URL of the GitHub repository. relative folder path str, optional : The relative path from the repo root to the folder containing documents. required exts Optional List str : List of required extensions. Returns: Sequence Document : A sequence of Document objects. """ ⋮---- Ensure the temp dir directory exists temp dir = Path "autollm/temp/" ⋮---- Clone or pull the GitHub repository to get the latest documen… Evidence: `autollm/utils/document_reading.py`
- **Env Utils** (source_file): def find dotenv file start path: Path - Path ⋮---- current path = start path ⋮---- dotenv path = current path / '.env' ⋮---- current path = current path.parent ⋮---- def read env variable variable name: str, default value: str = None - str ⋮---- def validate environment variables required vars: list - None ⋮---- def load config and dotenv config file path: str, env file path: str = None - dict ⋮---- config = yaml.safe load f ⋮---- def on rm error func: Callable, path: str, exc info: Tuple Evidence: `autollm/utils/env_utils.py`
- **Git Utils** (source_file): def clone or pull repository git url: str, local path: Path - None ⋮---- repo = Repo str local path Evidence: `autollm/utils/git_utils.py`
- **TODO: add vs type** (source_file): def get md5 file path: Path - str ⋮---- hasher = hashlib.md5 ⋮---- TODO: add vs type def check for changes documents: Sequence Document , vs - Tuple Sequence Document , List str ⋮---- """ Check for file changes based on their hashes. Parameters: documents Sequence Document : List of documents to check for changes. vs: The vector store to check for changes in. Returns: changed documents Sequence Document : List of documents that have changed. deleted document ids List str : List of document ids that are deleted in local but present in vector store. """ ⋮---- deleted document ids = set document ids ⋮---- changed documents = deleted document ids = ⋮---- file path = str Path doc.metadata 'origi… Evidence: `autollm/utils/hash_utils.py`
- **Lancedb Vectorstore** (source_file): class LanceDBVectorStore LanceDBVectorStoreBase ⋮---- def setup connection self, uri: str, api key: Optional str = None, region: Optional str = None ⋮---- api key = api key or os.getenv 'LANCEDB API KEY' region = region or os.getenv 'LANCEDB REGION' ⋮---- import err msg = " lancedb package not found, please run pip install lancedb " ⋮---- table = self.connection.open table self.table name lance query = self. prepare lance query query, table, kwargs ⋮---- results = lance query.to df ⋮---- def prepare lance query self, query: VectorStoreQuery, table: Table, kwargs - LanceQueryBuilder ⋮---- where = to lance filter query.filters ⋮---- where = kwargs.pop "where", None prefilter = kwargs.pop "pre… Evidence: `autollm/utils/lancedb_vectorstore.py`
- **Llm Utils** (source_file): def set default prompt template Evidence: `autollm/utils/llm_utils.py`
- **Logging** (source_file): logger = logging.getLogger 'autollm' ⋮---- ch = logging.StreamHandler ⋮---- formatter = logging.Formatter '% asctime s - % name s - % levelname s - % message s' Evidence: `autollm/utils/logging.py`
- **Creating Document object** (source_file): class MarkdownReader BaseReader ⋮---- def markdown to tups self, markdown text: str - List Tuple Optional str , str ⋮---- markdown tups: List Tuple Optional str , str = lines = markdown text.split '\n' ⋮---- current header = None current text = '' ⋮---- header match = re.match r'^ ⋮---- current header = line ⋮---- markdown tups = re.sub r' ⋮---- markdown tups = key, re.sub ' ', '', value for key, value in markdown tups ⋮---- def remove images self, content: str - str ⋮---- """Get a dictionary of a markdown file from its path.""" pattern = r'!{1}\ \ . \ \ ' content = re.sub pattern, '', content ⋮---- def remove hyperlinks self, content: str - str ⋮---- pattern = r'\ . ? \ \ . ? \ ' content =… Evidence: `autollm/utils/markdown_reader.py`
- **Pdf Reader** (source_file): class LangchainPDFReader BaseReader ⋮---- def init self, extract images: bool = False - None ⋮---- def load data self, file path: str, extra info: dict = None - List Document ⋮---- loader = PDFMinerLoader str file path , extract images=self.extract images ⋮---- langchain documents = loader.load ⋮---- documents = ⋮---- doc = Document.from langchain format langchain document Evidence: `autollm/utils/pdf_reader.py`
- **Templates** (source_file): SYSTEM PROMPT = ''' ⋮---- QUERY PROMPT TEMPLATE = ''' ⋮---- REFINE PROMPT TEMPLATE = ''' Evidence: `autollm/utils/templates.py`
- **Webpage Reader** (source_file): SELECTORS = ⋮---- IGNORED TAGS = ⋮---- class WebPageReader ⋮---- def load data self, url: str - List Document ⋮---- response = requests.get url, timeout=WEBPAGE READER TIMEOUT ⋮---- soup = BeautifulSoup response.content, "html.parser" ⋮---- element = soup.select one selector ⋮---- content = element.prettify ⋮---- content = soup.get text ⋮---- soup = BeautifulSoup content, "html.parser" ⋮---- content = " ".join soup.stripped strings document = Document id =url, text=content, metadata={"url": url} Evidence: `autollm/utils/webpage_reader.py`
- **Website Reader** (source_file): class WebSiteReader ⋮---- def init self ⋮---- response = requests.get sitemap url ⋮---- sitemap content = response.text ⋮---- """Extracts URLs from sitemap content.""" sitemap = ET.fromstring sitemap content urls = ⋮---- location = url.find "{http://www.sitemaps.org/schemas/sitemap/0.9}loc" .text ⋮---- def get child links recursive self, url ⋮---- parsed url = urlparse url base url = f"{parsed url.scheme}://{parsed url.netloc}" current path = parsed url.path ⋮---- response = requests.get url, timeout=WEBPAGE READER TIMEOUT timeout in seconds ⋮---- soup = BeautifulSoup response.text, "html.parser" all links = link.get "href" for link in soup.find all "a" ⋮---- child links = set ⋮---- full li… Evidence: `autollm/utils/website_reader.py`
- **Config.Example** (source_file): version: '4.1' tasks: - name: "summarize" llm model: "gpt-3.5-turbo" llm max tokens: 256 llm temperature: 0.1 system prompt: "You are an expert ai assistant specialized in summarization." query wrapper prompt: The document information is below. --------------------- {context str} --------------------- Using the document information and mostly relying on it, answer the query. Query: {query str} Answer: enable cost calculator: true embed model: "default" chunk size: 512 chunk overlap: 200 similarity top k: 6 response mode: 'tree summarize' vector store type: "SimpleVectorStore" enable keyword extractor: true - name: "qa" llm model: "anthropic.claude-v2" llm max tokens: 256 llm temperature: 0.… Evidence: `examples/configs/config.example.yaml`
- **Byte-compiled / optimized / DLL files** (source_file): Byte-compiled / optimized / DLL files pycache / .py cod $py.class Evidence: `.gitignore`
- **.Pre Commit Config** (source_file): ci: autofix prs: true autoupdate commit msg: ' pre-commit.ci pre-commit suggestions' autoupdate schedule: monthly repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace - id: check-case-conflict - id: detect-private-key - id: detect-aws-credentials args: - --allow-missing-credentials - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 hooks: - id: pyupgrade name: Upgrade code - repo: https://github.com/PyCQA/isort rev: 5.12.0 hooks: - id: isort name: Sort imports - repo: https://github.com/google/yapf rev: v0.40.2 hooks: - id: yapf name: YAPF formatting args: - -i - repo: https://github.com/executablebooks/md… Evidence: `.pre-commit-config.yaml`
- **Dev Requirements** (source_file): pre-commit==3.4.0 pytest==7.4.2 Evidence: `dev-requirements.txt`
- **Requirements** (source_file): llama-index==0.9.27 litellm==1.16.21 uvicorn fastapi python-dotenv httpx lancedb==0.3.4 Evidence: `requirements.txt`
- **https://pep8.readthedocs.io/en/latest/intro.html error-codes** (source_file): metadata license files = LICENSE description file = README.md Evidence: `setup.cfg`

## Rules the Host AI Must Follow

- **Treat this asset as pre-work context, not a runtime environment.**: The AI Context Pack contains only an evidence-backed understanding of the project, not the project's executable state. Evidence: `README.md`, `CONTRIBUTING.md`, `LICENSE`
- **When answering the user, distinguish what can be previewed from what can only be verified after install.**: The consumer value of the pre-install experience comes from reducing bad installs and misjudgments, not from pretending to be a real run. Evidence: `README.md`, `CONTRIBUTING.md`, `LICENSE`

## Questions the User Should Answer First

- Which host AI or local environment do you plan to use it in?
- Do you just want to experience the workflow first, or are you ready to actually install?
- What matters most to you: install cost, output quality, or conflicts with your existing rules?

## Acceptance Checks

- Every capability claim can be traced back to a file path in evidence_refs.
- AI_CONTEXT_PACK.md does not package previews as a real run.
- The user can understand who it fits, what it can do, how to start, and the risk boundaries within 3 minutes.

---

## Doramagic Context Augmentation

The following sections strengthen the repository context for a host AI. Human Manual data is a reading route, and pitfall notes become operating constraints.

## Human Manual Outline

Usage rule: this is only a reading route and salience signal, not factual authority. Concrete claims must still return to repo evidence or Claim Graph.

Host AI hard rules:
- Do not treat page titles, section order, summaries, or importance values as factual project evidence.
- When explaining the Human Manual outline, state that it is only a reading route or salience signal.
- Capability, installation, compatibility, runtime state, and risk claims must cite repo evidence, source paths, or Claim Graph.

- **Introduction and Quickstart**: importance `high`
  - source_paths: README.md, autollm/__init__.py, examples/quickstart.ipynb
- **AutoQueryEngine: RAG in One Line**: importance `high`
  - source_paths: autollm/auto/query_engine.py, autollm/__init__.py
- **AutoEmbedding and Embedding Configuration**: importance `high`
  - source_paths: autollm/auto/embedding.py, autollm/__init__.py
- **AutoLiteLLM: Unified LLM Access (100+ Models)**: importance `high`
  - source_paths: autollm/auto/llm.py, autollm/auto/service_context.py, autollm/utils/llm_utils.py
- **AutoVectorStoreIndex and Vector Stores**: importance `high`
  - source_paths: autollm/auto/vector_store_index.py, autollm/utils/lancedb_vectorstore.py, autollm/utils/db_utils.py
- **Document Readers and Data Sources**: importance `medium`
  - source_paths: autollm/utils/document_reading.py, autollm/utils/pdf_reader.py, autollm/utils/markdown_reader.py, autollm/utils/webpage_reader.py, autollm/utils/website_reader.py
- **AutoFastAPI: One-Line API Deployment**: importance `medium`
  - source_paths: autollm/auto/fastapi_app.py, autollm/serve/docs.py, autollm/serve/utils.py, examples/configs/config.example.yaml
- **Cost Calculation, Callbacks, and Utilities**: importance `medium`
  - source_paths: autollm/auto/service_context.py, autollm/callbacks/cost_calculating.py, autollm/utils/templates.py, autollm/utils/logging.py, autollm/utils/env_utils.py

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `c369a0392d665b109879bac70afe2d077a78bada`
- inspected_files: `README.md`, `requirements.txt`, `examples/configs/config.example.yaml`

Host AI hard rules:
- Without repo_clone_verified=true, do not claim that the source code has been read.
- Without repo_inspection_verified=true, do not write README, docs, or package-file conclusions as facts.
- Without quick_start_verified=true, do not claim that the Quick Start path has run successfully.

## Doramagic Pitfall Constraints

These rules come from Doramagic discovery, validation, or compilation findings. The host AI must treat them as operating constraints, not background notes.

### Constraint 1: Capability evidence risk requires verification

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: capability.assumptions | https://github.com/viddexa/autollm
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 2: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: downstream_validation.risk_items | https://github.com/viddexa/autollm
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 3: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: risks.scoring_risks | https://github.com/viddexa/autollm
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 4: Maintenance risk requires verification

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/viddexa/autollm
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 5: Maintenance risk requires verification

- Trigger: release_recency=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/viddexa/autollm
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
