Real-world Examples

See Cogency in action with practical examples that you can copy, modify, and deploy.

1

Basic Agent

Beginner

A simple agent that can answer questions and perform calculations.

 from cogency.agent import Agent from cogency.llm import GeminiLLM agent = Agent( name="Helper", llm=GeminiLLM(api_key="your-key") ) result = await agent.run("What is 15 * 23?") 
2

Customer Support

Intermediate

Support agent with memory and knowledge base access.

 from cogency.agent import Agent from cogency.memory import SemanticMemory agent = Agent( name="Support Agent", llm=GeminiLLM(), memory=SemanticMemory() ) # Tools auto-discovered from /tools/ 
3

Research Agent

Advanced

Multi-step research agent with web search and analysis.

 from cogency.agent import Agent from cogency.tools import WebSearchTool agent = Agent( name="Research Assistant", tools=[WebSearchTool()], max_depth=5 # Deep reasoning ) report = await agent.run( "Research AI trends in 2024" ) 
4

Production API

Production

FastAPI integration with streaming and monitoring.

 from fastapi import FastAPI from cogency.agent import Agent app = FastAPI() agent = Agent(monitoring=True) @app.post("/chat") async def chat(message: str): async for response in agent.stream(message): yield response 

More Examples Coming Soon

We're building a comprehensive library of examples for every use case.

Discord Bot

AI-powered Discord moderator and assistant

Data Analysis

Automated insights from CSV and databases

E-commerce Helper

Product recommendations and support

Ready to Build Your Own?

Start with any example and customize it for your needs