This repository contains code examples and implementations following the LangChain JS/TS tutorials.
LangChain is a framework for developing applications powered by language models. It enables the creation of applications that are:
- Context-aware: Connect language models to sources of data
- Reasoning: Use language models to make decisions and take actions
This repository serves as a learning playground for exploring LangChain's capabilities. It includes implementations of various tutorials and examples from the official documentation, allowing for hands-on experience with:
- Building conversational agents
- Creating chains and sequences
- Implementing retrieval-augmented generation (RAG)
- Working with various language models
- Utilizing vector stores and embedding techniques
- Bun v1.2.4 or later
To install dependencies:
bun install
To run the default example:
bun run index.ts
For specific examples:
bun run examples/<example-name>.ts
examples/
- Individual tutorial implementationssrc/
- Shared components and utilitiesdata/
- Sample data used by examples
This repository follows tutorials from the LangChain documentation, including:
- Chat models and chat prompts
- Building conversational agents
- Retrieval-augmented generation
- Working with structured outputs
- Memory and state management
The repository includes an advanced implementation of a multi-agent system for comprehensive crypto contract analysis:
-
Architecture: Uses LangGraph's supervisor pattern to coordinate specialized agents
-
Workflow:
- Data collection from multiple sources (social, market, on-chain)
- Multi-faceted analysis through specialized agents
- Opportunity evaluation based on combined insights
- Detailed report generation
-
Key Components:
- Data Fetcher Agent: Retrieves data from Farcaster, Coingecko, and Etherscan
- Analysis Agents: Separate agents for social, market, and on-chain analysis
- Evaluation Agent: Assesses investment opportunity based on all analyses
- Report Generation Agent: Creates comprehensive markdown reports
To run the contract analysis:
bun run tests/onchain-supervisor/run_contract_analysis.ts
This project is intended for learning purposes.
This project was created using bun init
in bun v1.2.4. Bun is a fast all-in-one JavaScript runtime.