Skip to content

Commit

Permalink
clearer docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzejay committed Nov 20, 2024
1 parent 38c0d61 commit 9329119
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions docs/concepts/knowledge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,12 @@ crew = Crew(
tasks=[task],
verbose=True,
process=Process.sequential,
knowledge={"sources": [string_source], "metadata": {"preference": "personal"}}, # Enable knowledge by adding the sources here
knowledge={"sources": [string_source], "metadata": {"preference": "personal"}}, # Enable knowledge by adding the sources here. You can also add more sources to the sources list.
)

result = crew.kickoff(inputs={"question": "What city does John live in and how old is he?"})
```

## Additionally:
You can add more sources as well as not need to re-declare the knowledge store every kickoff.
If you had sources from previous runs, you no longer need to declare the knowledge store.

```python
from crewai import Agent, Task, Crew, Process, LLM

# Create a knowledge store with a list of sources and metadata
llm = LLM(model="gpt-4o-mini", temperature=0)
# Create an agent with the knowledge store
agent = Agent(
role="About User",
goal="You know everything about the user.",
backstory="""You are a master at understanding people and their preferences.""",
verbose=True,
allow_delegation=False,
llm=llm,
)
task = Task(
description="Answer the following questions about the user: {question}",
expected_output="An answer to the question.",
agent=agent,
)

crew = Crew(
agents=[agent],
tasks=[task],
verbose=True,
process=Process.sequential,
knowledge={"sources": [string_source], "metadata": {"preference": "personal"}}, # Enable knowledge by adding the sources here
)

result = crew.kickoff(inputs={"question": "What city does John live in and how old is he?"})
```

## Embedder Configuration

Expand Down

0 comments on commit 9329119

Please sign in to comment.