Project Structure
BindAI projects provide a consistent way to organize agents, tools, workflows, knowledge, memory, templates, configuration, connections, and tests. You can use BindAI components without creating a project, but a project provides a convenient structure for keeping an AI application organized as it grows.Creating a Project
Create a new project with the BindAI CLI:Default Project Layout
A BindAI application can be organized around the following structure:.bindai/ directory is used for BindAI project metadata. Project-scoped provider connection metadata is stored in .bindai/connections.toml.
Provider credentials are not stored in that file. They are stored separately in the operating system credential store.
Project Files
main.py
main.py can serve as the application’s entry point.
A simple application can create an agent and execute it:
bindai.toml
bindai.toml is the project-level BindAI configuration file.
It can be used to keep application configuration separate from Python source code.
For example:
provider setting selects the provider used by the project.
The model setting configures the project’s default model.
The optional connection setting selects a named project-scoped provider connection.
When connection is configured, BindAI resolves the named connection and obtains its stored provider credential during provider resolution.
Keep secrets such as API keys out of bindai.toml.
Use environment variables, project-scoped provider connections, or another secure secret-management mechanism for credentials.
You can inspect and modify project configuration through the CLI:
.bindai/connections.toml
.bindai/connections.toml contains metadata for project-scoped provider connections.
For example:
connections.toml.
Instead, BindAI stores the credential in the operating system credential store.
This separation allows the project to reference a named provider credential without putting the credential directly into project configuration or source code.
Connections can be managed through the CLI:
- An explicitly supplied API key
- The credential stored for the selected project connection
- The provider environment variable
.env
The local .env file can contain environment variables required by the application.
For example:
.env.
Never commit API keys or other secrets to source control.
Agents
Theagents/ directory can contain application-specific agent definitions.
For example:
Agent.builder():
Tools
Thetools/ directory can contain reusable tools used by agents.
For example:
tool decorator:
Workflows
Theworkflows/ directory can contain workflow-related application code.
For example:
- Agents
- Tools
- Conditional execution
- Loops
- Parallel execution
- Retries
- Timeouts
- Scheduling
- Human tasks
Knowledge
Theknowledge/ directory can contain application resources used by knowledge and retrieval systems.
For example:
- Document ingestion
- Parsing
- Chunking
- Embeddings
- Metadata
- Semantic retrieval
- BM25 retrieval
- Hybrid retrieval
- Filtering
- Reranking
- Conversational retrieval
- Knowledge pipelines
Memory
Thememory/ directory can be used to organize application-specific memory resources or implementations.
BindAI provides several memory implementations, including:
- In-memory memory
- SQLite
- PostgreSQL
- Vector memory
- Pinecone
- Chroma
- Conversation memory
- Custom memory implementations
Templates
Thetemplates/ directory can contain reusable application or workflow templates.
For example:
- Basic workflows
- Conditions
- Loops
- Parallel execution
- Human tasks
- Retries
- Timeouts
- Scheduling
Tests
Store project tests inside thetests/ directory.
For example:
External Service Connections
Applications that communicate with external services can organize connection-related code separately from agents and workflows. BindAI’s Connections package currently provides integrations for:- Webhooks
- GitHub
- Slack
- Notion
- Jira
- Discord
- Resend
- Vercel
- Netlify
These application-level external-service connections are separate from BindAI’s project-scoped provider connections. Project-scoped provider connections select stored AI provider credentials and are represented by .bindai/connections.toml.
MCP
Applications using Model Context Protocol can keep MCP-related configuration and integration code separate from core agent logic. BindAI’s current MCP support includes:- MCP client connections
- Tool discovery
- Tool calling
- MCP tools exposed through the BindAI tool system
Organizing Larger Projects
As an application grows, organize components by responsibility. For example:Separating Responsibilities
A useful way to think about the project structure is:Multi-Agent Project Structure
Applications using multiple agents can organize specialists independently. For example:Environment and Source Control
Keep application secrets separate from source code. A typical project should include a.gitignore that excludes local environment files and other generated or sensitive content.
For example:
- API keys
- Access tokens
- Passwords
- Private credentials
- Other sensitive configuration
.env.example pattern can be used to document required environment variables without exposing their values.
Project-scoped provider connection credentials should also never be committed to source control. The connection metadata in .bindai/connections.toml identifies the provider, while the actual credential remains in the operating system credential store.
Recommended Development Workflow
A typical BindAI project workflow is:-
Create a project with
bindai new. - Configure the project’s environment.
- Configure the required provider.
- Optionally create a project-scoped provider connection.
-
Select the provider connection in
bindai.tomlwhen one is configured. -
Build agents inside
agents/. -
Add reusable tools inside
tools/. - Add memory when persistent or conversational state is required.
- Add knowledge and retrieval when application-specific information is required.
- Add workflows when execution requires multiple coordinated steps.
- Add external Connections when external services are required.
- Add MCP integrations when external MCP tools are required.
- Add templates for reusable application patterns.
-
Write tests inside
tests/. -
Run
bindai doctorto validate the project environment and configured provider connection. - Run the application with the BindAI CLI.
Minimal Project
Not every project needs the complete structure. A small application can start with only:bindai.toml:
