PromptisePromptise
Docs
GitHub
Promptise - AI Framework LogoPromptise

The foundation layer for agentic intelligence. Build, secure and operate autonomous AI systems with Promptise Foundry.

pip install promptise

[01] Foundry

  • MCPcast
  • The Promptise Agent
  • Reasoning Engine
  • MCP
  • Agent Runtime
  • Prompt Engineering
  • Execution Engine
  • Agent Identity

[02] Resources

  • Documentation
  • GitHub
  • Guides
  • Learning Paths
  • Questions

[03] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

Open source · Python

← Guides> Library> Topic

Context engineering: managing what the model sees

A model answers from what is in its context window on that call and nothing else. Context engineering is the work of choosing that content: the instructions, the conversation so far, retrieved documents, tool results and memory, all within a token limit.

More context is not always better. Long prompts cost more and run slower, and models tend to use information at the start and end of a long input better than material in the middle, an effect known as lost in the middle. The guides here cover managing the context window in AI agents, where to place documents and questions in long prompts, compressing prompts with tools such as LLMLingua, grounding answers in supplied text, and the agent harness that assembles context on each turn.

[n.01/02]> 6 guides
  1. 01Grounding LLM Answers: Give the Model the Right ContextGround LLM answers in your own text: paste the source, fence it with delimiters, require citations and handle gaps. Real return-policy example.Beginner · 7 minOct 18, 2026
  2. 02What Is an Agent Harness? Parts and How to Build OneWhat an agent harness is and how to build one: the tool loop, context compaction, token budgets, loop guards and verification, with runnable code.Intermediate · 18 minOct 18, 2026
  3. 03Context Engineering for AI Agents: Context Window ManagementContext engineering for AI agents in Python: keep what matters in long runs, trim the rest, and cut input tokens 18x. Real token counts per step.Intermediate · 26 minOct 11, 2026
  4. 04How Context Shapes LLM Output: The Model Continues ItWhy LLMs copy the patterns in your context, flaws included: next-token prediction, Codex and multi-turn research, a real example and three fixes.Intermediate · 4 minOct 18, 2026
  5. 05Long-Context Prompting: Placement, Structure and RAGLong-context prompting tactics: where to put documents and the question, how to tag sources, quote-then-answer, and when to retrieve instead of stuffing.Intermediate · 8 minOct 18, 2026
  6. 06Prompt Compression: LLMLingua and Lost in the MiddlePrompt compression techniques compared: selection, LLMLingua, summaries. Fix lost in the middle with reordering. Real example: 15,900 tokens cut to 1,400.Advanced · 9 minOct 18, 2026
[n.02/02]> go further

Related topics

  • RAG (Retrieval-Augmented Generation)9
  • Cost Control9
  • Grounding and Citations6
  • Hallucinations11
  • LLM Mental Models19
  • Model Context Protocol (MCP)37
  • Prompt Writing Basics4
  • Reliability and Fallbacks6

Topic hubs

  • Cost control and rate limits→
  • Building AI agents in Python→
  • Tools and the Model Context Protocol (MCP)→
  • Memory, context and RAG→

By category and level

  • AI Engineering guides71
  • Prompt Engineering guides54
  • Beginner guides36
  • Intermediate guides80
  • Advanced guides24

Search every guide.

The library lists all guides with filters for topic, level, category and reading time.

All guidesLearning paths