بنقرة واحدة
pageindex-integration
PageIndex tree-based document indexing integration patterns for Mimir RAG pipeline
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
PageIndex tree-based document indexing integration patterns for Mimir RAG pipeline
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Agile Scrum feature management and sprint scope discipline for Project Mimir — Product Backlog management via GitHub Issues, Sprint scope sanctity, mid-sprint adjustment protocols, sprint planning workflows, and session boundaries. Triggers when planning sprints, managing features, handling scope changes, or discussing project management.
Issue-driven development and code review workflow for Project Mimir — GitHub Issue creation, branch naming conventions, PR templates, self-review checklists, and PR integration. Triggers when creating branches, committing code, creating pull requests, reviewing code, or managing GitHub workflow.
ISO/IEC 29110 documentation workflow for Project Mimir — creating Sprint Reports (PM-02), Test Scripts (SI-04), updating Traceability Matrix (SI-03), and maintaining compliance with documentation standards. Triggers when creating reports, closing sprints, writing test documentation, or updating project management documents.
Next.js App Router frontend patterns for Project Mimir — page structure, API integration via lib/api.ts, shadcn/ui component usage, polling and debounce patterns, toast notifications, badge design, and TypeScript conventions. Triggers when building React components, creating pages, integrating APIs, styling UI elements, or working on the ro-ai-dashboard frontend.
Standard Rust/Axum backend patterns for Project Mimir — error handling with anyhow, SQLx compile-time queries, tenant_auth_middleware security, Vault secret injection, Direct HTTP Dispatch for LLM providers, and inline TDD test modules. Triggers when writing Rust code, creating API routes, handling database queries, or implementing backend features.
Test-Driven Development (TDD) enforcement for Project Mimir — Red-Green-Refactor cycle for Rust backend (#[cfg(test)] modules) and Next.js frontend (Jest + React Testing Library). Triggers when implementing features, fixing bugs, writing tests, or reviewing code for test coverage.
| name | pageindex-integration |
| description | PageIndex tree-based document indexing integration patterns for Mimir RAG pipeline |
PageIndex is a vectorless, reasoning-based RAG system that builds hierarchical tree indexes from documents. It serves as "Step 0" in the Mimir pipeline — structure understanding before vector embedding.
PDF Document → [PageIndex: Tree Construction] → Enriched Chunks → [Mimir: Vector Pipeline]
↓ ↓
Hierarchical JSON Qdrant Embeddings
(sections, pages) (chunks + metadata)
# pageindex_service.py — FastAPI sidecar wrapping PageIndex
from fastapi import FastAPI, UploadFile
from pageindex import PageIndex
import tempfile
import os
app = FastAPI(title="Mimir — PageIndex Sidecar")
@app.post("/v1/index")
async def create_index(file: UploadFile):
with tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) as tmp:
content = await file.read()
tmp.write(content)
tmp_path = tmp.name
try:
# Route LLM calls through Heimdall
pi = PageIndex(
api_base="http://heimdall:8080/v1", # Use local Heimdall
model="qwen3.5-9b", # Local model via Heimdall
)
result = pi.create_index(tmp_path)
return {"tree": result.to_dict(), "pages": result.page_count}
finally:
os.unlink(tmp_path)
{
"title": "Insurance Policy Document",
"children": [
{
"title": "Section 1: Coverage Details",
"page_start": 1,
"page_end": 5,
"children": [
{
"title": "1.1 Basic Coverage",
"page_start": 1,
"page_end": 3
},
{
"title": "1.2 Additional Riders",
"page_start": 3,
"page_end": 5
}
]
}
]
}
def tree_to_enriched_chunks(tree: dict, pdf_text: dict[int, str]) -> list[dict]:
"""Convert PageIndex tree to enriched chunks for Mimir vector pipeline."""
chunks = []
def walk(node, parent_path=""):
path = f"{parent_path} > {node['title']}" if parent_path else node['title']
# Collect text from pages in this section
text = ""
for page_num in range(node.get("page_start", 0), node.get("page_end", 0) + 1):
text += pdf_text.get(page_num, "")
if text.strip():
chunks.append({
"content": text,
"metadata": {
"section_path": path,
"page_start": node.get("page_start"),
"page_end": node.get("page_end"),
"source": "pageindex",
"hierarchy_level": len(path.split(" > "))
}
})
for child in node.get("children", []):
walk(child, path)
walk(tree)
return chunks
// In mimir pipeline step
let resp = reqwest::Client::new()
.post("http://pageindex-sidecar:8650/v1/index")
.multipart(reqwest::multipart::Form::new()
.part("file", reqwest::multipart::Part::bytes(pdf_bytes)))
.send()
.await?;
let tree: PageIndexTree = resp.json().await?;
| Setting | Default | Description |
|---|---|---|
PAGEINDEX_ENABLED | false | Enable PageIndex step |
PAGEINDEX_URL | http://pageindex:8650 | Sidecar URL |
PAGEINDEX_MODEL | qwen3.5-9b | LLM for tree construction |
PAGEINDEX_LLM_URL | http://heimdall:8080/v1 | Route via Heimdall |