OKF quickstart
Install
Section titled “Install”pip install "astromesh-okf[langchain]"No framework, no model
Section titled “No framework, no model”The tools are plain methods that return strings.
from astromesh_okf import OKFTools
kb = OKFTools("./my-bundle")print(kb.kb_index("/"))print(kb.kb_find(type="Policy"))print(kb.kb_read("policies/refunds"))No bundle yet? Clone the repository and try astromesh-okf index examples/bundles/support.
With LangChain
Section titled “With LangChain”create_agent runs on LangGraph underneath, so the same tools work in a hand-built LangGraph graph (ToolNode).
pip install "astromesh-okf[langchain]" langchain langchain-openaiexport OPENAI_API_KEY=...import osfrom pathlib import Path
from langchain.agents import create_agent
from astromesh_okf import Bundlefrom astromesh_okf.integrations.langchain import okf_tools
QUESTION = "Can I get a refund after 3 weeks on the Team plan?"BUNDLE = Path(__file__).parent / "bundles" / "support"SYSTEM = "Answer using the knowledge base tools. Bundle index:\n" + Bundle(BUNDLE).index("/")
if __name__ == "__main__": agent = create_agent( os.getenv("OKF_EXAMPLE_MODEL", "openai:gpt-4.1-mini"), okf_tools(BUNDLE), system_prompt=SYSTEM, ) result = agent.invoke({"messages": [("user", QUESTION)]}) print(result["messages"][-1].content)This is examples/langgraph_agent.py from the repository. The root index goes into the system prompt so the agent does not spend a tool call on it.
As an MCP server
Section titled “As an MCP server”Install the mcp extra, then point your client at the bundle with an absolute path.
pip install "astromesh-okf[mcp]"astromesh-okf mcp /absolute/path/to/bundleClaude Code
claude mcp add okf-support -- astromesh-okf mcp /absolute/path/to/bundleClaude Desktop (claude_desktop_config.json) or Cursor (.cursor/mcp.json)
{ "mcpServers": { "okf-support": { "command": "astromesh-okf", "args": ["mcp", "/absolute/path/to/bundle"] } } }- Integrations: the other seven frameworks.
- Introduction: what the tools return and when to use them.