Catalog PyPI
Back to packageRELEASE DETAILS

1.0.1

PyPI

agentami

Create an agent that can handle a large number of tools with persistence support.

Published3 May 2025
Direct dependencies16
Transitive dependenciesNot calculated

README

Version 1.0.1 documentation

AgentAmi

AgentAmi is a flexible agentic framework built using LangGraph, designed to scale with large numbers of tools and intelligently select the most relevant ones for a given user query. It helps with decreasing token size significantly.

It supports:

  • Dynamic tool selection via inbuilt runtime RAG (very efficient) with an option to easily replace it with your own tool_selector.
  • Pruner to limit context length and improve performance (it's inbuilt, you don't have to do anything).

Quick start

Refer the main.py file for a complete sample usage.

pip install agentami
from agentami import AgentAmi
from langchain.chat_models import ChatOpenAI
from langgraph.checkpoint.memory import InMemorySaver
from agentami.agents.ami import AgentAmi

# Replace ... (ellipsis) with the commented instructions

tools = [...]  # List of LangChain-compatible tools
agent = AgentAmi(
    model=ChatOpenAI(model="gpt-4o"),
    tools=tools,  # List of LangChain-compatible tools
    checkpointer=InMemorySaver(),  # Optional. No persistence if omitted.

    # Optional parameters:
    tool_selector=...,  # Custom function to select relevant tools. Defaults to internal tool_selector.
    top_k=...,  # Number of top tools to use. Defaults to 3.
    context_size=...,  # Number of past user prompts to retain. Defaults to 7.
    disable_pruner=...,  # If True, disables pruning & will increase token usage. Defaults to False
    prompt_template=...  # Custom prompt template. Defaults to a generic bot template.
)
agent_ami = agent.graph # Your regular langgraph's graph.

Things you should be aware about:

  • Running for the first time will take time as it installs the dependencies (models used by internal tool_selector).
  • Your first agent_ami.invoke() or agent_agent_ami.astream() may take time if you have hundreds of tools, because it initialises a vector store and embeds the tool descriptions at runtime for each AgentAmi() object
  • Your eventual prompts' response time would be fine.
  • Checkout ROADMAP.md file for future features.

How to integrate your own tool selector?

Just make a function that accepts (query: str, top_k: int) and parameters and returns List[str] #List of tool names.

from typing import List


# function template:
def my_own_tool_selector(query: str, top_k: int) -> List[str]:
    # Your logic to select tools based on the query
    return ["tool1", "tool2", "tool3"]  # Return top_k selected tool names

AgentAmi

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 16

Native requirements
16 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
langchain
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
langchain>=0.3.24runtime
langchain-core
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
langchain-core>=0.3.56runtime
langchain-openai
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
langchain-openai>=0.3.14runtime
langgraph
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
langgraph>=0.3.34runtime
langgraph-checkpoint
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
langgraph-checkpoint>=2.0.25runtime
langgraph-sdk
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
langgraph-sdk>=0.1.63runtime
openai
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
openai>=1.76.0runtime
tiktoken
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
tiktoken>=0.9.0runtime
faiss-cpu
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
faiss-cpu>=1.11.0runtime
sentence-transformers
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
sentence-transformers>=4.1.0runtime
scikit-learn
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
scikit-learn>=1.6.1runtime
pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
pydantic>=2.11.3runtime
python-dotenv
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
python-dotenv>=1.1.0runtime
requests
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
requests>=2.32.3runtime
orjson
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
orjson>=3.10.16runtime
rich
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
rich>=14.0.0runtime

Distribution files

2 collected
agentami-1.0.1-py3-none-any.whl

bdist_wheel · 8.02 KB · Python py3

Source file
agentami-1.0.1.tar.gz

sdist · 8.79 KB · Python source

Source file

Repository

PENDING
ami-sh/agentami

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:27 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:09f8cc6d038fa82d6cfd93d9f9897a79c8de439073d07cbb43eacc87dd5037a4

Other collected versions

View all collected versions →